diff --git a/.gitignore b/.gitignore index dea969504a90f1..181e4e5d3b4b62 100644 --- a/.gitignore +++ b/.gitignore @@ -68,11 +68,9 @@ ipch/ /config_fips.gypi *-nodegyp* /gyp-mac-tool -/dist-osx /npm.wxs /tools/msvs/npm.wixobj /tools/msvs/genfiles/ -/tools/osx-pkg.pmdoc/index.xml /test/addons/??_*/ email.md deps/v8-* @@ -100,6 +98,7 @@ deps/npm/node_modules/.bin/ # build/release artifacts /*.tar.* +/*.pkg /SHASUMS*.txt* # test artifacts diff --git a/LICENSE b/LICENSE index fd8a2577935dc1..196fa789a4644b 100644 --- a/LICENSE +++ b/LICENSE @@ -100,7 +100,7 @@ The externally maintained libraries used by Node.js are: """ COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) - Copyright © 1991-2016 Unicode, Inc. All rights reserved. + Copyright © 1991-2017 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html Permission is hereby granted, free of charge, to any person obtaining @@ -231,7 +231,7 @@ The externally maintained libraries used by Node.js are: # ---------COPYING.libtabe ---- BEGIN-------------------- # # /* - # * Copyrighy (c) 1999 TaBE Project. + # * Copyright (c) 1999 TaBE Project. # * Copyright (c) 1999 Pai-Hsiang Hsiao. # * All rights reserved. # * diff --git a/Makefile b/Makefile index c9fed0c03b32f4..9e25cb01e355bd 100644 --- a/Makefile +++ b/Makefile @@ -530,8 +530,7 @@ BINARYTAR=$(BINARYNAME).tar XZ=$(shell which xz > /dev/null 2>&1; echo $$?) XZ_COMPRESSION ?= 9e PKG=$(TARNAME).pkg -PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -PKGDIR=out/dist-osx +MACOSOUTDIR=out/macos release-only: @if [ "$(DISTTYPE)" != "nightly" ] && [ "$(DISTTYPE)" != "next-nightly" ] && \ @@ -561,24 +560,54 @@ release-only: fi $(PKG): release-only - $(RM) -r $(PKGDIR) - $(RM) -r out/deps out/Release + $(RM) -r $(MACOSOUTDIR) + mkdir -p $(MACOSOUTDIR)/installer/productbuild + cat tools/macos-installer/productbuild/distribution.xml.tmpl \ + | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ + | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ + >$(MACOSOUTDIR)/installer/productbuild/distribution.xml ; \ + + @for dirname in tools/macos-installer/productbuild/Resources/*/; do \ + lang=$$(basename $$dirname) ; \ + mkdir -p $(MACOSOUTDIR)/installer/productbuild/Resources/$$lang ; \ + printf "Found localization directory $$dirname\n" ; \ + cat $$dirname/welcome.html.tmpl \ + | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ + | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ + >$(MACOSOUTDIR)/installer/productbuild/Resources/$$lang/welcome.html ; \ + cat $$dirname/conclusion.html.tmpl \ + | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ + | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ + >$(MACOSOUTDIR)/installer/productbuild/Resources/$$lang/conclusion.html ; \ + done $(PYTHON) ./configure \ --dest-cpu=x64 \ --tag=$(TAG) \ --release-urlbase=$(RELEASE_URLBASE) \ $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS) - $(MAKE) install V=$(V) DESTDIR=$(PKGDIR) - SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)/usr/local" bash \ + $(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/node + SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/node/usr/local" bash \ tools/osx-codesign.sh - cat tools/osx-pkg.pmdoc/index.xml.tmpl \ - | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ - | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ - > tools/osx-pkg.pmdoc/index.xml - $(PACKAGEMAKER) \ - --id "org.nodejs.pkg" \ - --doc tools/osx-pkg.pmdoc \ - --out $(PKG) + mkdir -p $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules + mkdir -p $(MACOSOUTDIR)/pkgs + mv $(MACOSOUTDIR)/dist/node/usr/local/lib/node_modules/npm \ + $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules + unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npm + unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npx + $(NODE) tools/license2rtf.js < LICENSE > \ + $(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf + cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources + pkgbuild --version $(FULLVERSION) \ + --identifier org.nodejs.node.pkg \ + --root $(MACOSOUTDIR)/dist/node $(MACOSOUTDIR)/pkgs/node-$(FULLVERSION).pkg + pkgbuild --version $(NPMVERSION) \ + --identifier org.nodejs.npm.pkg \ + --root $(MACOSOUTDIR)/dist/npm \ + --scripts ./tools/macos-installer/pkgbuild/npm/scripts \ + $(MACOSOUTDIR)/pkgs/npm-$(NPMVERSION).pkg + productbuild --distribution $(MACOSOUTDIR)/installer/productbuild/distribution.xml \ + --resources $(MACOSOUTDIR)/installer/productbuild/Resources \ + --package-path $(MACOSOUTDIR)/pkgs ./$(PKG) SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh pkg: $(PKG) diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js new file mode 100644 index 00000000000000..229a4e60652b64 --- /dev/null +++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js @@ -0,0 +1,97 @@ +'use strict'; +const common = require('../common.js'); +const url = require('url'); +const URL = url.URL; +const assert = require('assert'); +const inputs = require('../fixtures/url-inputs.js').urls; + +const bench = common.createBenchmark(main, { + type: Object.keys(inputs), + method: ['legacy', 'whatwg'], + n: [1e5] +}); + +// At the time of writing, when using a passed property name to index +// the object, Crankshaft would generate a LoadKeyedGeneric even when it +// remains a constant in the function, so here we must use the literal +// instead to get a LoadNamedField. +function useLegacy(n, input) { + const obj = url.parse(input); + const noDead = { + protocol: obj.protocol, + auth: obj.auth, + host: obj.host, + hostname: obj.hostname, + port: obj.port, + pathname: obj.pathname, + search: obj.search, + hash: obj.hash + }; + // It's necessary to assign the values to an object + // to avoid loop invariant code motion. + bench.start(); + for (var i = 0; i < n; i += 1) { + noDead.protocol = obj.protocol; + noDead.auth = obj.auth; + noDead.host = obj.host; + noDead.hostname = obj.hostname; + noDead.port = obj.port; + noDead.pathname = obj.pathname; + noDead.search = obj.search; + noDead.hash = obj.hash; + } + bench.end(n); + return noDead; +} + +function useWHATWG(n, input) { + const obj = new URL(input); + const noDead = { + protocol: obj.protocol, + auth: `${obj.username}:${obj.password}`, + host: obj.host, + hostname: obj.hostname, + port: obj.port, + pathname: obj.pathname, + search: obj.search, + hash: obj.hash + }; + bench.start(); + for (var i = 0; i < n; i += 1) { + noDead.protocol = obj.protocol; + noDead.auth = `${obj.username}:${obj.password}`; + noDead.host = obj.host; + noDead.hostname = obj.hostname; + noDead.port = obj.port; + noDead.pathname = obj.pathname; + noDead.search = obj.search; + noDead.hash = obj.hash; + } + bench.end(n); + return noDead; +} + +function main(conf) { + const type = conf.type; + const n = conf.n | 0; + const method = conf.method; + + const input = inputs[type]; + if (!input) { + throw new Error('Unknown input type'); + } + + var noDead; // Avoid dead code elimination. + switch (method) { + case 'legacy': + noDead = useLegacy(n, input); + break; + case 'whatwg': + noDead = useWHATWG(n, input); + break; + default: + throw new Error('Unknown method'); + } + + assert.ok(noDead); +} diff --git a/benchmark/url/legacy-vs-whatwg-url-parse.js b/benchmark/url/legacy-vs-whatwg-url-parse.js new file mode 100644 index 00000000000000..ec386b7b85597d --- /dev/null +++ b/benchmark/url/legacy-vs-whatwg-url-parse.js @@ -0,0 +1,57 @@ +'use strict'; +const common = require('../common.js'); +const url = require('url'); +const URL = url.URL; +const assert = require('assert'); +const inputs = require('../fixtures/url-inputs.js').urls; + +const bench = common.createBenchmark(main, { + type: Object.keys(inputs), + method: ['legacy', 'whatwg'], + n: [1e5] +}); + +function useLegacy(n, input) { + var noDead = url.parse(input); + bench.start(); + for (var i = 0; i < n; i += 1) { + noDead = url.parse(input); + } + bench.end(n); + return noDead; +} + +function useWHATWG(n, input) { + var noDead = new URL(input); + bench.start(); + for (var i = 0; i < n; i += 1) { + noDead = new URL(input); + } + bench.end(n); + return noDead; +} + +function main(conf) { + const type = conf.type; + const n = conf.n | 0; + const method = conf.method; + + const input = inputs[type]; + if (!input) { + throw new Error('Unknown input type'); + } + + var noDead; // Avoid dead code elimination. + switch (method) { + case 'legacy': + noDead = useLegacy(n, input); + break; + case 'whatwg': + noDead = useWHATWG(n, input); + break; + default: + throw new Error('Unknown method'); + } + + assert.ok(noDead); +} diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js new file mode 100644 index 00000000000000..b4a80af4e5eabd --- /dev/null +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js @@ -0,0 +1,51 @@ +'use strict'; +const common = require('../common.js'); +const { URLSearchParams } = require('url'); +const querystring = require('querystring'); +const inputs = require('../fixtures/url-inputs.js').searchParams; + +const bench = common.createBenchmark(main, { + type: Object.keys(inputs), + method: ['legacy', 'whatwg'], + n: [1e6] +}); + +function useLegacy(n, input) { + querystring.parse(input); + bench.start(); + for (var i = 0; i < n; i += 1) { + querystring.parse(input); + } + bench.end(n); +} + +function useWHATWG(n, input) { + new URLSearchParams(input); + bench.start(); + for (var i = 0; i < n; i += 1) { + new URLSearchParams(input); + } + bench.end(n); +} + +function main(conf) { + const type = conf.type; + const n = conf.n | 0; + const method = conf.method; + + const input = inputs[type]; + if (!input) { + throw new Error('Unknown input type'); + } + + switch (method) { + case 'legacy': + useLegacy(n, input); + break; + case 'whatwg': + useWHATWG(n, input); + break; + default: + throw new Error('Unknown method'); + } +} diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js new file mode 100644 index 00000000000000..2b8d2c36a810b3 --- /dev/null +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js @@ -0,0 +1,53 @@ +'use strict'; +const common = require('../common.js'); +const { URLSearchParams } = require('url'); +const querystring = require('querystring'); +const inputs = require('../fixtures/url-inputs.js').searchParams; + +const bench = common.createBenchmark(main, { + type: Object.keys(inputs), + method: ['legacy', 'whatwg'], + n: [1e6] +}); + +function useLegacy(n, input, prop) { + const obj = querystring.parse(input); + querystring.stringify(obj); + bench.start(); + for (var i = 0; i < n; i += 1) { + querystring.stringify(obj); + } + bench.end(n); +} + +function useWHATWG(n, input, prop) { + const obj = new URLSearchParams(input); + obj.toString(); + bench.start(); + for (var i = 0; i < n; i += 1) { + obj.toString(); + } + bench.end(n); +} + +function main(conf) { + const type = conf.type; + const n = conf.n | 0; + const method = conf.method; + + const input = inputs[type]; + if (!input) { + throw new Error('Unknown input type'); + } + + switch (method) { + case 'legacy': + useLegacy(n, input); + break; + case 'whatwg': + useWHATWG(n, input); + break; + default: + throw new Error('Unknown method'); + } +} diff --git a/benchmark/url/legacy-vs-whatwg-url-serialize.js b/benchmark/url/legacy-vs-whatwg-url-serialize.js new file mode 100644 index 00000000000000..35b459a10c0e0b --- /dev/null +++ b/benchmark/url/legacy-vs-whatwg-url-serialize.js @@ -0,0 +1,59 @@ +'use strict'; +const common = require('../common.js'); +const url = require('url'); +const URL = url.URL; +const assert = require('assert'); +const inputs = require('../fixtures/url-inputs.js').urls; + +const bench = common.createBenchmark(main, { + type: Object.keys(inputs), + method: ['legacy', 'whatwg'], + n: [1e5] +}); + +function useLegacy(n, input, prop) { + const obj = url.parse(input); + var noDead = url.format(obj); + bench.start(); + for (var i = 0; i < n; i += 1) { + noDead = url.format(obj); + } + bench.end(n); + return noDead; +} + +function useWHATWG(n, input, prop) { + const obj = new URL(input); + var noDead = obj.toString(); + bench.start(); + for (var i = 0; i < n; i += 1) { + noDead = obj.toString(); + } + bench.end(n); + return noDead; +} + +function main(conf) { + const type = conf.type; + const n = conf.n | 0; + const method = conf.method; + + const input = inputs[type]; + if (!input) { + throw new Error('Unknown input type'); + } + + var noDead; // Avoid dead code elimination. + switch (method) { + case 'legacy': + noDead = useLegacy(n, input); + break; + case 'whatwg': + noDead = useWHATWG(n, input); + break; + default: + throw new Error('Unknown method'); + } + + assert.ok(noDead); +} diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js new file mode 100644 index 00000000000000..0f4b71a0a183dd --- /dev/null +++ b/benchmark/url/url-searchparams-iteration.js @@ -0,0 +1,61 @@ +'use strict'; +const common = require('../common.js'); +const assert = require('assert'); +const { URLSearchParams } = require('url'); + +const bench = common.createBenchmark(main, { + method: ['forEach', 'iterator'], + n: [1e6] +}); + +const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd'; + +function forEach(n) { + const params = new URLSearchParams(str); + const noDead = []; + const cb = (val, key) => { + noDead[0] = key; + noDead[1] = val; + }; + + bench.start(); + for (var i = 0; i < n; i += 1) + params.forEach(cb); + bench.end(n); + + assert.strictEqual(noDead[0], 'three'); + assert.strictEqual(noDead[1], '3rd'); +} + +function iterator(n) { + const params = new URLSearchParams(str); + const noDead = []; + + bench.start(); + for (var i = 0; i < n; i += 1) { + for (const pair of params) { + noDead[0] = pair[0]; + noDead[1] = pair[1]; + } + } + bench.end(n); + + assert.strictEqual(noDead[0], 'three'); + assert.strictEqual(noDead[1], '3rd'); +} + +function main(conf) { + const method = conf.method; + const n = conf.n | 0; + + switch (method) { + case 'forEach': + forEach(n); + break; + case 'iterator': + iterator(n); + break; + default: + throw new Error('Unknown method'); + } +} diff --git a/benchmark/url/url-searchparams-read.js b/benchmark/url/url-searchparams-read.js new file mode 100644 index 00000000000000..762ffcca03d69d --- /dev/null +++ b/benchmark/url/url-searchparams-read.js @@ -0,0 +1,58 @@ +'use strict'; +const common = require('../common.js'); +const { URLSearchParams } = require('url'); + +const bench = common.createBenchmark(main, { + method: ['get', 'getAll', 'has'], + param: ['one', 'two', 'three', 'nonexistent'], + n: [2e7] +}); + +const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd'; + +function get(n, param) { + const params = new URLSearchParams(str); + + bench.start(); + for (var i = 0; i < n; i += 1) + params.get(param); + bench.end(n); +} + +function getAll(n, param) { + const params = new URLSearchParams(str); + + bench.start(); + for (var i = 0; i < n; i += 1) + params.getAll(param); + bench.end(n); +} + +function has(n, param) { + const params = new URLSearchParams(str); + + bench.start(); + for (var i = 0; i < n; i += 1) + params.has(param); + bench.end(n); +} + +function main(conf) { + const method = conf.method; + const param = conf.param; + const n = conf.n | 0; + + switch (method) { + case 'get': + get(n, param); + break; + case 'getAll': + getAll(n, param); + break; + case 'has': + has(n, param); + break; + default: + throw new Error('Unknown method'); + } +} diff --git a/benchmark/url/url-searchparams-sort.js b/benchmark/url/url-searchparams-sort.js new file mode 100644 index 00000000000000..677ce511cf3ea2 --- /dev/null +++ b/benchmark/url/url-searchparams-sort.js @@ -0,0 +1,48 @@ +'use strict'; +const common = require('../common.js'); +const URLSearchParams = require('url').URLSearchParams; + +const inputs = { + empty: '', + sorted: 'a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z', + almostsorted: 'a&b&c&d&e&f&g&i&h&j&k&l&m&n&o&p&q&r&s&t&u&w&v&x&y&z', + reversed: 'z&y&x&w&v&u&t&s&r&q&p&o&n&m&l&k&j&i&h&g&f&e&d&c&b&a', + random: 'm&t&d&c&z&v&a&n&p&y&u&o&h&l&f&j&e&q&b&i&s&x&k&w&r&g', + // 8 parameters + short: 'm&t&d&c&z&v&a&n', + // 88 parameters + long: 'g&r&t&h&s&r&d&w&b&n&h&k&x&m&k&h&o&e&x&c&c&g&e&b&p&p&s&n&j&b&y&z&' + + 'u&l&o&r&w&a&u&l&m&f&j&q&p&f&e&y&e&n&e&l&m&w&u&w&t&n&t&q&v&y&c&o&' + + 'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r' +}; + +function getParams(str) { + const out = []; + for (const key of str.split('&')) { + out.push(key, ''); + } + return out; +} + +const bench = common.createBenchmark(main, { + type: Object.keys(inputs), + n: [1e6] +}, { + flags: ['--expose-internals'] +}); + +function main(conf) { + const searchParams = require('internal/url').searchParamsSymbol; + const input = inputs[conf.type]; + const n = conf.n | 0; + const params = new URLSearchParams(); + const array = getParams(input); + + var i; + bench.start(); + for (i = 0; i < n; i++) { + params[searchParams] = array.slice(); + params.sort(); + } + bench.end(n); +} diff --git a/benchmark/url/usvstring.js b/benchmark/url/usvstring.js new file mode 100644 index 00000000000000..40a945037385cf --- /dev/null +++ b/benchmark/url/usvstring.js @@ -0,0 +1,28 @@ +'use strict'; +const common = require('../common.js'); + +const inputs = { + valid: 'adsfadsfadsf', + validsurr: '\uda23\ude23\uda1f\udfaa\ud800\udfff\uda23\ude23\uda1f\udfaa' + + '\ud800\udfff', + someinvalid: 'asasfdfasd\uda23', + allinvalid: '\udc45\uda23 \udf00\udc00 \udfaa\uda12 \udc00\udfaa', + nonstring: { toString() { return 'asdf'; } } +}; +const bench = common.createBenchmark(main, { + input: Object.keys(inputs), + n: [5e7] +}, { + flags: ['--expose-internals'] +}); + +function main(conf) { + const { toUSVString } = require('internal/url'); + const str = inputs[conf.input]; + const n = conf.n | 0; + + bench.start(); + for (var i = 0; i < n; i++) + toUSVString(str); + bench.end(n); +} diff --git a/benchmark/url/whatwg-url-idna.js b/benchmark/url/whatwg-url-idna.js new file mode 100644 index 00000000000000..3d0ea3dc8fe516 --- /dev/null +++ b/benchmark/url/whatwg-url-idna.js @@ -0,0 +1,45 @@ +'use strict'; +const common = require('../common.js'); +const { domainToASCII, domainToUnicode } = require('url'); + +const inputs = { + empty: { + ascii: '', + unicode: '' + }, + none: { + ascii: 'passports', + unicode: 'passports' + }, + some: { + ascii: 'Paßstraße', + unicode: 'xn--Pastrae-1vae' + }, + all: { + ascii: '他们不说中文', + unicode: 'xn--ihqwczyycu19kkg2c' + }, + nonstring: { + ascii: { toString() { return ''; } }, + unicode: { toString() { return ''; } } + } +}; + +const bench = common.createBenchmark(main, { + input: Object.keys(inputs), + to: ['ascii', 'unicode'], + n: [5e6] +}); + +function main(conf) { + const n = conf.n | 0; + const to = conf.to; + const input = inputs[conf.input][to]; + const method = to === 'ascii' ? domainToASCII : domainToUnicode; + + bench.start(); + for (var i = 0; i < n; i++) { + method(input); + } + bench.end(n); +} diff --git a/benchmark/url/whatwg-url-properties.js b/benchmark/url/whatwg-url-properties.js new file mode 100644 index 00000000000000..3a865d2335ab3c --- /dev/null +++ b/benchmark/url/whatwg-url-properties.js @@ -0,0 +1,75 @@ +'use strict'; +const common = require('../common.js'); +const URL = require('url').URL; +const inputs = require('../fixtures/url-inputs.js').urls; + +const bench = common.createBenchmark(main, { + input: Object.keys(inputs), + prop: ['href', 'origin', 'protocol', + 'username', 'password', 'host', 'hostname', 'port', + 'pathname', 'search', 'searchParams', 'hash'], + n: [3e5] +}); + +function setAndGet(n, url, prop, alternative) { + const old = url[prop]; + bench.start(); + for (var i = 0; i < n; i += 1) { + url[prop] = n % 2 === 0 ? alternative : old; // set + url[prop]; // get + } + bench.end(n); +} + +function get(n, url, prop) { + bench.start(); + for (var i = 0; i < n; i += 1) { + url[prop]; // get + } + bench.end(n); +} + +const alternatives = { + href: 'http://user:pass@foo.bar.com:21/aaa/zzz?l=25#test', + protocol: 'https:', + username: 'user2', + password: 'pass2', + host: 'foo.bar.net:22', + hostname: 'foo.bar.org', + port: '23', + pathname: '/aaa/bbb', + search: '?k=99', + hash: '#abcd' +}; + +function getAlternative(prop) { + return alternatives[prop]; +} + +function main(conf) { + const n = conf.n | 0; + const input = inputs[conf.input]; + const url = new URL(input); + const prop = conf.prop; + + switch (prop) { + case 'protocol': + case 'username': + case 'password': + case 'host': + case 'hostname': + case 'port': + case 'pathname': + case 'search': + case 'hash': + case 'href': + setAndGet(n, url, prop, getAlternative(prop)); + break; + case 'origin': + case 'searchParams': + get(n, url, prop); + break; + default: + throw new Error('Unknown prop'); + } +} diff --git a/configure b/configure index 10d46159a83923..3864f88a88fd8b 100755 --- a/configure +++ b/configure @@ -172,6 +172,12 @@ parser.add_option('--openssl-use-def-ca-store', dest='use_openssl_ca_store', help='Use OpenSSL supplied CA store instead of compiled-in Mozilla CA copy.') +parser.add_option('--openssl-system-ca-path', + action='store', + dest='openssl_system_ca_path', + help='Use the specified path to system CA (PEM format) in addition to ' + 'the OpenSSL supplied CA store or compiled-in Mozilla CA copy.') + shared_optgroup.add_option('--shared-http-parser', action='store_true', dest='shared_http_parser', @@ -988,6 +994,8 @@ def configure_openssl(o): o['variables']['openssl_no_asm'] = 1 if options.openssl_no_asm else 0 if options.use_openssl_ca_store: o['defines'] += ['NODE_OPENSSL_CERT_STORE'] + if options.openssl_system_ca_path: + o['variables']['openssl_system_ca_path'] = options.openssl_system_ca_path o['variables']['node_without_node_options'] = b(options.without_node_options) if options.without_node_options: o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS'] @@ -1067,8 +1075,8 @@ def glob_to_var(dir_base, dir_sub, patch_dir): def configure_intl(o): icus = [ { - 'url': 'https://ssl.icu-project.org/files/icu4c/58.2/icu4c-58_2-src.zip', - 'md5': 'f4fca37508fc5d14390501cf17aef084', + 'url': 'https://ssl.icu-project.org/files/icu4c/60.2/icu4c-60_2-src.zip', + 'md5': '115908818fd0324530b2acb1b029738d', }, ] def icu_download(path): diff --git a/deps/icu-small/LICENSE b/deps/icu-small/LICENSE index 90be7cdf052615..c84076cd072b80 100644 --- a/deps/icu-small/LICENSE +++ b/deps/icu-small/LICENSE @@ -1,6 +1,6 @@ COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) -Copyright © 1991-2016 Unicode, Inc. All rights reserved. +Copyright © 1991-2017 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html Permission is hereby granted, free of charge, to any person obtaining @@ -131,7 +131,7 @@ property of their respective owners. # ---------COPYING.libtabe ---- BEGIN-------------------- # # /* - # * Copyrighy (c) 1999 TaBE Project. + # * Copyright (c) 1999 TaBE Project. # * Copyright (c) 1999 Pai-Hsiang Hsiao. # * All rights reserved. # * diff --git a/deps/icu-small/README-SMALL-ICU.txt b/deps/icu-small/README-SMALL-ICU.txt index 7b45134f658c39..c6dc0b30515162 100644 --- a/deps/icu-small/README-SMALL-ICU.txt +++ b/deps/icu-small/README-SMALL-ICU.txt @@ -1,8 +1,8 @@ Small ICU sources - auto generated by shrink-icu-src.py This directory contains the ICU subset used by --with-intl=small-icu (the default) -It is a strict subset of ICU 58 source files with the following exception(s): -* deps/icu-small/source/data/in/icudt58l.dat : Reduced-size data file +It is a strict subset of ICU 60 source files with the following exception(s): +* deps/icu-small/source/data/in/icudt60l.dat : Reduced-size data file To rebuild this directory, see ../../tools/icu/README.md diff --git a/deps/icu-small/source/common/appendable.cpp b/deps/icu-small/source/common/appendable.cpp index 1a597b5de52e58..fca3c1e4133b80 100644 --- a/deps/icu-small/source/common/appendable.cpp +++ b/deps/icu-small/source/common/appendable.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: appendable.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/bmpset.cpp b/deps/icu-small/source/common/bmpset.cpp index ebcd0d23bf9f59..f84bfd7f5bfcf1 100644 --- a/deps/icu-small/source/common/bmpset.cpp +++ b/deps/icu-small/source/common/bmpset.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: bmpset.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -28,7 +28,7 @@ U_NAMESPACE_BEGIN BMPSet::BMPSet(const int32_t *parentList, int32_t parentListLength) : list(parentList), listLength(parentListLength) { - uprv_memset(asciiBytes, 0, sizeof(asciiBytes)); + uprv_memset(latin1Contains, 0, sizeof(latin1Contains)); uprv_memset(table7FF, 0, sizeof(table7FF)); uprv_memset(bmpBlockBits, 0, sizeof(bmpBlockBits)); @@ -45,14 +45,16 @@ BMPSet::BMPSet(const int32_t *parentList, int32_t parentListLength) : list4kStarts[i]=findCodePoint(i<<12, list4kStarts[i-1], listLength-1); } list4kStarts[0x11]=listLength-1; + containsFFFD=containsSlow(0xfffd, list4kStarts[0xf], list4kStarts[0x10]); initBits(); overrideIllegal(); } BMPSet::BMPSet(const BMPSet &otherBMPSet, const int32_t *newParentList, int32_t newParentListLength) : + containsFFFD(otherBMPSet.containsFFFD), list(newParentList), listLength(newParentListLength) { - uprv_memcpy(asciiBytes, otherBMPSet.asciiBytes, sizeof(asciiBytes)); + uprv_memcpy(latin1Contains, otherBMPSet.latin1Contains, sizeof(latin1Contains)); uprv_memcpy(table7FF, otherBMPSet.table7FF, sizeof(table7FF)); uprv_memcpy(bmpBlockBits, otherBMPSet.bmpBlockBits, sizeof(bmpBlockBits)); uprv_memcpy(list4kStarts, otherBMPSet.list4kStarts, sizeof(list4kStarts)); @@ -120,7 +122,7 @@ void BMPSet::initBits() { UChar32 start, limit; int32_t listIndex=0; - // Set asciiBytes[]. + // Set latin1Contains[]. do { start=list[listIndex++]; if(listIndex=0x80) { + if(start>=0x100) { break; } do { - asciiBytes[start++]=1; - } while(start0x80) { + if(start<0x80) { + start=0x80; + } + break; + } + } // Set table7FF[]. while(start<0x800) { @@ -204,19 +223,14 @@ void BMPSet::initBits() { * for faster validity checking at runtime. * No need to set 0 values where they were reset to 0 in the constructor * and not modified by initBits(). - * (asciiBytes[] trail bytes, table7FF[] 0..7F, bmpBlockBits[] 0..7FF) + * (table7FF[] 0..7F, bmpBlockBits[] 0..7FF) * Need to set 0 values for surrogates D800..DFFF. */ void BMPSet::overrideIllegal() { uint32_t bits, mask; int32_t i; - if(containsSlow(0xfffd, list4kStarts[0xf], list4kStarts[0x10])) { - // contains(FFFD)==TRUE - for(i=0x80; i<0xc0; ++i) { - asciiBytes[i]=1; - } - + if(containsFFFD) { bits=3; // Lead bytes 0xC0 and 0xC1. for(i=0; i<64; ++i) { table7FF[i]|=bits; @@ -233,7 +247,6 @@ void BMPSet::overrideIllegal() { bmpBlockBits[i]=(bmpBlockBits[i]&mask)|bits; } } else { - // contains(FFFD)==FALSE mask=~(0x10001<<0xd); // Lead byte 0xED. for(i=32; i<64; ++i) { // Second half of 4k block. bmpBlockBits[i]&=mask; @@ -277,8 +290,8 @@ int32_t BMPSet::findCodePoint(UChar32 c, int32_t lo, int32_t hi) const { UBool BMPSet::contains(UChar32 c) const { - if((uint32_t)c<=0x7f) { - return (UBool)asciiBytes[c]; + if((uint32_t)c<=0xff) { + return (UBool)latin1Contains[c]; } else if((uint32_t)c<=0x7ff) { return (UBool)((table7FF[c&0x3f]&((uint32_t)1<<(c>>6)))!=0); } else if((uint32_t)c<0xd800 || (c>=0xe000 && c<=0xffff)) { @@ -314,8 +327,8 @@ BMPSet::span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition // span do { c=*s; - if(c<=0x7f) { - if(!asciiBytes[c]) { + if(c<=0xff) { + if(!latin1Contains[c]) { break; } } else if(c<=0x7ff) { @@ -354,8 +367,8 @@ BMPSet::span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition // span not do { c=*s; - if(c<=0x7f) { - if(asciiBytes[c]) { + if(c<=0xff) { + if(latin1Contains[c]) { break; } } else if(c<=0x7ff) { @@ -403,8 +416,8 @@ BMPSet::spanBack(const UChar *s, const UChar *limit, USetSpanCondition spanCondi // span for(;;) { c=*(--limit); - if(c<=0x7f) { - if(!asciiBytes[c]) { + if(c<=0xff) { + if(!latin1Contains[c]) { break; } } else if(c<=0x7ff) { @@ -446,8 +459,8 @@ BMPSet::spanBack(const UChar *s, const UChar *limit, USetSpanCondition spanCondi // span not for(;;) { c=*(--limit); - if(c<=0x7f) { - if(asciiBytes[c]) { + if(c<=0xff) { + if(latin1Contains[c]) { break; } } else if(c<=0x7ff) { @@ -497,22 +510,22 @@ const uint8_t * BMPSet::spanUTF8(const uint8_t *s, int32_t length, USetSpanCondition spanCondition) const { const uint8_t *limit=s+length; uint8_t b=*s; - if((int8_t)b>=0) { + if(U8_IS_SINGLE(b)) { // Initial all-ASCII span. if(spanCondition) { do { - if(!asciiBytes[b] || ++s==limit) { + if(!latin1Contains[b] || ++s==limit) { return s; } b=*s; - } while((int8_t)b>=0); + } while(U8_IS_SINGLE(b)); } else { do { - if(asciiBytes[b] || ++s==limit) { + if(latin1Contains[b] || ++s==limit) { return s; } b=*s; - } while((int8_t)b>=0); + } while(U8_IS_SINGLE(b)); } length=(int32_t)(limit-s); } @@ -540,20 +553,20 @@ BMPSet::spanUTF8(const uint8_t *s, int32_t length, USetSpanCondition spanConditi // single trail byte, check for preceding 3- or 4-byte lead byte if(length>=2 && (b=*(limit-2))>=0xe0) { limit-=2; - if(asciiBytes[0x80]!=spanCondition) { + if(containsFFFD!=spanCondition) { limit0=limit; } } else if(b<0xc0 && b>=0x80 && length>=3 && (b=*(limit-3))>=0xf0) { // 4-byte lead byte with only two trail bytes limit-=3; - if(asciiBytes[0x80]!=spanCondition) { + if(containsFFFD!=spanCondition) { limit0=limit; } } } else { // lead byte with no trail bytes --limit; - if(asciiBytes[0x80]!=spanCondition) { + if(containsFFFD!=spanCondition) { limit0=limit; } } @@ -563,26 +576,26 @@ BMPSet::spanUTF8(const uint8_t *s, int32_t length, USetSpanCondition spanConditi while(s=0xc0 && (t1=(uint8_t)(*s-0x80)) <= 0x3f ) { if((USetSpanCondition)((table7FF[t1]&((uint32_t)1<<(b&0x1f)))!=0) != spanCondition) { @@ -642,7 +656,7 @@ BMPSet::spanUTF8(const uint8_t *s, int32_t length, USetSpanCondition spanConditi // Give an illegal sequence the same value as the result of contains(FFFD). // Handle each byte of an illegal sequence separately to simplify the code; // no need to optimize error handling. - if(asciiBytes[0x80]!=spanCondition) { + if(containsFFFD!=spanCondition) { return s-1; } } @@ -667,26 +681,26 @@ BMPSet::spanBackUTF8(const uint8_t *s, int32_t length, USetSpanCondition spanCon do { b=s[--length]; - if((int8_t)b>=0) { + if(U8_IS_SINGLE(b)) { // ASCII sub-span if(spanCondition) { do { - if(!asciiBytes[b]) { + if(!latin1Contains[b]) { return length+1; } else if(length==0) { return 0; } b=s[--length]; - } while((int8_t)b>=0); + } while(U8_IS_SINGLE(b)); } else { do { - if(asciiBytes[b]) { + if(latin1Contains[b]) { return length+1; } else if(length==0) { return 0; } b=s[--length]; - } while((int8_t)b>=0); + } while(U8_IS_SINGLE(b)); } } diff --git a/deps/icu-small/source/common/bmpset.h b/deps/icu-small/source/common/bmpset.h index 8975cd61d5cc21..018aeb7f95b078 100644 --- a/deps/icu-small/source/common/bmpset.h +++ b/deps/icu-small/source/common/bmpset.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: bmpset.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -28,11 +28,12 @@ U_NAMESPACE_BEGIN * Helper class for frozen UnicodeSets, implements contains() and span() * optimized for BMP code points. Structured to be UTF-8-friendly. * - * ASCII: Look up bytes. + * Latin-1: Look up bytes. * 2-byte characters: Bits organized vertically. * 3-byte characters: Use zero/one/mixed data per 64-block in U+0000..U+FFFF, * with mixed for illegal ranges. - * Supplementary characters: Call contains() on the parent set. + * Supplementary characters: Binary search over + * the supplementary part of the parent set's inversion list. */ class BMPSet : public UMemory { public: @@ -96,12 +97,12 @@ class BMPSet : public UMemory { inline UBool containsSlow(UChar32 c, int32_t lo, int32_t hi) const; /* - * One byte per ASCII character, or trail byte in lead position. - * 0 or 1 for ASCII characters. - * The value for trail bytes is the result of contains(FFFD) - * for faster validity checking at runtime. + * One byte 0 or 1 per Latin-1 character. */ - UBool asciiBytes[0xc0]; + UBool latin1Contains[0x100]; + + /* TRUE if contains(U+FFFD). */ + UBool containsFFFD; /* * One bit per code point from U+0000..U+07FF. diff --git a/deps/icu-small/source/common/brkeng.cpp b/deps/icu-small/source/common/brkeng.cpp index 96a7dc9348d810..da64b3bdef9bbc 100644 --- a/deps/icu-small/source/common/brkeng.cpp +++ b/deps/icu-small/source/common/brkeng.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ************************************************************************************ @@ -11,9 +11,6 @@ #if !UCONFIG_NO_BREAK_ITERATION -#include "brkeng.h" -#include "cmemory.h" -#include "dictbe.h" #include "unicode/uchar.h" #include "unicode/uniset.h" #include "unicode/chariter.h" @@ -24,6 +21,10 @@ #include "unicode/uscript.h" #include "unicode/ucharstrie.h" #include "unicode/bytestrie.h" + +#include "brkeng.h" +#include "cmemory.h" +#include "dictbe.h" #include "charstr.h" #include "dictionarydata.h" #include "mutex.h" @@ -80,23 +81,15 @@ UnhandledEngine::handles(UChar32 c, int32_t breakType) const { int32_t UnhandledEngine::findBreaks( UText *text, - int32_t startPos, - int32_t endPos, - UBool reverse, - int32_t breakType, - UStack &/*foundBreaks*/ ) const { + int32_t /* startPos */, + int32_t endPos, + int32_t breakType, + UVector32 &/*foundBreaks*/ ) const { if (breakType >= 0 && breakType < UPRV_LENGTHOF(fHandled)) { UChar32 c = utext_current32(text); - if (reverse) { - while((int32_t)utext_getNativeIndex(text) > startPos && fHandled[breakType]->contains(c)) { - c = utext_previous32(text); - } - } - else { - while((int32_t)utext_getNativeIndex(text) < endPos && fHandled[breakType]->contains(c)) { - utext_next32(text); // TODO: recast loop to work with post-increment operations. - c = utext_current32(text); - } + while((int32_t)utext_getNativeIndex(text) < endPos && fHandled[breakType]->contains(c)) { + utext_next32(text); // TODO: recast loop to work with post-increment operations. + c = utext_current32(text); } } return 0; diff --git a/deps/icu-small/source/common/brkeng.h b/deps/icu-small/source/common/brkeng.h index 73fdb81dffaaaa..5c61d2ed5d5d70 100644 --- a/deps/icu-small/source/common/brkeng.h +++ b/deps/icu-small/source/common/brkeng.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ************************************************************************************ @@ -19,6 +19,7 @@ U_NAMESPACE_BEGIN class UnicodeSet; class UStack; +class UVector32; class DictionaryMatcher; /******************************************************************* @@ -67,18 +68,15 @@ class LanguageBreakEngine : public UMemory { * is capable of handling. * @param startPos The start of the run within the supplied text. * @param endPos The end of the run within the supplied text. - * @param reverse Whether the caller is looking for breaks in a reverse - * direction. * @param breakType The type of break desired, or -1. - * @param foundBreaks An allocated C array of the breaks found, if any + * @param foundBreaks A Vector of int32_t to receive the breaks. * @return The number of breaks found. */ virtual int32_t findBreaks( UText *text, int32_t startPos, int32_t endPos, - UBool reverse, int32_t breakType, - UStack &foundBreaks ) const = 0; + UVector32 &foundBreaks ) const = 0; }; @@ -192,8 +190,6 @@ class UnhandledEngine : public LanguageBreakEngine { * is capable of handling. * @param startPos The start of the run within the supplied text. * @param endPos The end of the run within the supplied text. - * @param reverse Whether the caller is looking for breaks in a reverse - * direction. * @param breakType The type of break desired, or -1. * @param foundBreaks An allocated C array of the breaks found, if any * @return The number of breaks found. @@ -201,9 +197,8 @@ class UnhandledEngine : public LanguageBreakEngine { virtual int32_t findBreaks( UText *text, int32_t startPos, int32_t endPos, - UBool reverse, int32_t breakType, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; /** *

Tell the engine to handle a particular character and break type.

diff --git a/deps/icu-small/source/common/brkiter.cpp b/deps/icu-small/source/common/brkiter.cpp index b768c20f0bac10..a509ff10c946ec 100644 --- a/deps/icu-small/source/common/brkiter.cpp +++ b/deps/icu-small/source/common/brkiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -195,7 +195,7 @@ BreakIterator::getAvailableLocales(int32_t& count) // ------------------------------------------ // -// Default constructor and destructor +// Constructors, destructor and assignment operator // //------------------------------------------- @@ -204,6 +204,19 @@ BreakIterator::BreakIterator() *validLocale = *actualLocale = 0; } +BreakIterator::BreakIterator(const BreakIterator &other) : UObject(other) { + uprv_strncpy(actualLocale, other.actualLocale, sizeof(actualLocale)); + uprv_strncpy(validLocale, other.validLocale, sizeof(validLocale)); +} + +BreakIterator &BreakIterator::operator =(const BreakIterator &other) { + if (this != &other) { + uprv_strncpy(actualLocale, other.actualLocale, sizeof(actualLocale)); + uprv_strncpy(validLocale, other.validLocale, sizeof(validLocale)); + } + return *this; +} + BreakIterator::~BreakIterator() { } @@ -265,7 +278,7 @@ ICUBreakIteratorService::~ICUBreakIteratorService() {} // defined in ucln_cmn.h U_NAMESPACE_END -static icu::UInitOnce gInitOnce; +static icu::UInitOnce gInitOnceBrkiter; static icu::ICULocaleService* gService = NULL; @@ -280,7 +293,7 @@ static UBool U_CALLCONV breakiterator_cleanup(void) { delete gService; gService = NULL; } - gInitOnce.reset(); + gInitOnceBrkiter.reset(); #endif return TRUE; } @@ -296,7 +309,7 @@ initService(void) { static ICULocaleService* getService(void) { - umtx_initOnce(gInitOnce, &initService); + umtx_initOnce(gInitOnceBrkiter, &initService); return gService; } @@ -306,7 +319,7 @@ getService(void) static inline UBool hasService(void) { - return !gInitOnce.isReset() && getService() != NULL; + return !gInitOnceBrkiter.isReset() && getService() != NULL; } // ------------------------------------- diff --git a/deps/icu-small/source/common/bytesinkutil.cpp b/deps/icu-small/source/common/bytesinkutil.cpp new file mode 100644 index 00000000000000..bf1a2d45f8ae5a --- /dev/null +++ b/deps/icu-small/source/common/bytesinkutil.cpp @@ -0,0 +1,123 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// bytesinkutil.cpp +// created: 2017sep14 Markus W. Scherer + +#include "unicode/utypes.h" +#include "unicode/bytestream.h" +#include "unicode/edits.h" +#include "unicode/stringoptions.h" +#include "unicode/utf8.h" +#include "unicode/utf16.h" +#include "bytesinkutil.h" +#include "cmemory.h" +#include "uassert.h" + +U_NAMESPACE_BEGIN + +UBool +ByteSinkUtil::appendChange(int32_t length, const char16_t *s16, int32_t s16Length, + ByteSink &sink, Edits *edits, UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { return FALSE; } + char scratch[200]; + int32_t s8Length = 0; + for (int32_t i = 0; i < s16Length;) { + int32_t capacity; + int32_t desiredCapacity = s16Length - i; + if (desiredCapacity < (INT32_MAX / 3)) { + desiredCapacity *= 3; // max 3 UTF-8 bytes per UTF-16 code unit + } else if (desiredCapacity < (INT32_MAX / 2)) { + desiredCapacity *= 2; + } else { + desiredCapacity = INT32_MAX; + } + char *buffer = sink.GetAppendBuffer(U8_MAX_LENGTH, desiredCapacity, + scratch, UPRV_LENGTHOF(scratch), &capacity); + capacity -= U8_MAX_LENGTH - 1; + int32_t j = 0; + for (; i < s16Length && j < capacity;) { + UChar32 c; + U16_NEXT_UNSAFE(s16, i, c); + U8_APPEND_UNSAFE(buffer, j, c); + } + if (j > (INT32_MAX - s8Length)) { + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return FALSE; + } + sink.Append(buffer, j); + s8Length += j; + } + if (edits != nullptr) { + edits->addReplace(length, s8Length); + } + return TRUE; +} + +UBool +ByteSinkUtil::appendChange(const uint8_t *s, const uint8_t *limit, + const char16_t *s16, int32_t s16Length, + ByteSink &sink, Edits *edits, UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { return FALSE; } + if ((limit - s) > INT32_MAX) { + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return FALSE; + } + return appendChange((int32_t)(limit - s), s16, s16Length, sink, edits, errorCode); +} + +void +ByteSinkUtil::appendCodePoint(int32_t length, UChar32 c, ByteSink &sink, Edits *edits) { + char s8[U8_MAX_LENGTH]; + int32_t s8Length = 0; + U8_APPEND_UNSAFE(s8, s8Length, c); + if (edits != nullptr) { + edits->addReplace(length, s8Length); + } + sink.Append(s8, s8Length); +} + +namespace { + +// See unicode/utf8.h U8_APPEND_UNSAFE(). +inline uint8_t getTwoByteLead(UChar32 c) { return (uint8_t)((c >> 6) | 0xc0); } +inline uint8_t getTwoByteTrail(UChar32 c) { return (uint8_t)((c & 0x3f) | 0x80); } + +} // namespace + +void +ByteSinkUtil::appendTwoBytes(UChar32 c, ByteSink &sink) { + U_ASSERT(0x80 <= c && c <= 0x7ff); // 2-byte UTF-8 + char s8[2] = { (char)getTwoByteLead(c), (char)getTwoByteTrail(c) }; + sink.Append(s8, 2); +} + +UBool +ByteSinkUtil::appendUnchanged(const uint8_t *s, int32_t length, + ByteSink &sink, uint32_t options, Edits *edits, + UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { return FALSE; } + if (length > 0) { + if (edits != nullptr) { + edits->addUnchanged(length); + } + if ((options & U_OMIT_UNCHANGED_TEXT) == 0) { + sink.Append(reinterpret_cast(s), length); + } + } + return TRUE; +} + +UBool +ByteSinkUtil::appendUnchanged(const uint8_t *s, const uint8_t *limit, + ByteSink &sink, uint32_t options, Edits *edits, + UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { return FALSE; } + if ((limit - s) > INT32_MAX) { + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return FALSE; + } + return appendUnchanged(s, (int32_t)(limit - s), sink, options, edits, errorCode); +} + +U_NAMESPACE_END diff --git a/deps/icu-small/source/common/bytesinkutil.h b/deps/icu-small/source/common/bytesinkutil.h new file mode 100644 index 00000000000000..004b49c4ce62ea --- /dev/null +++ b/deps/icu-small/source/common/bytesinkutil.h @@ -0,0 +1,53 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// bytesinkutil.h +// created: 2017sep14 Markus W. Scherer + +#include "unicode/utypes.h" +#include "unicode/bytestream.h" +#include "unicode/edits.h" +#include "cmemory.h" +#include "uassert.h" + +U_NAMESPACE_BEGIN + +class ByteSink; +class Edits; + +class U_COMMON_API ByteSinkUtil { +public: + ByteSinkUtil() = delete; // all static + + /** (length) bytes were mapped to valid (s16, s16Length). */ + static UBool appendChange(int32_t length, + const char16_t *s16, int32_t s16Length, + ByteSink &sink, Edits *edits, UErrorCode &errorCode); + + /** The bytes at [s, limit[ were mapped to valid (s16, s16Length). */ + static UBool appendChange(const uint8_t *s, const uint8_t *limit, + const char16_t *s16, int32_t s16Length, + ByteSink &sink, Edits *edits, UErrorCode &errorCode); + + /** (length) bytes were mapped/changed to valid code point c. */ + static void appendCodePoint(int32_t length, UChar32 c, ByteSink &sink, Edits *edits = nullptr); + + /** The few bytes at [src, nextSrc[ were mapped/changed to valid code point c. */ + static inline void appendCodePoint(const uint8_t *src, const uint8_t *nextSrc, UChar32 c, + ByteSink &sink, Edits *edits = nullptr) { + appendCodePoint((int32_t)(nextSrc - src), c, sink, edits); + } + + /** Append the two-byte character (U+0080..U+07FF). */ + static void appendTwoBytes(UChar32 c, ByteSink &sink); + + static UBool appendUnchanged(const uint8_t *s, int32_t length, + ByteSink &sink, uint32_t options, Edits *edits, + UErrorCode &errorCode); + + static UBool appendUnchanged(const uint8_t *s, const uint8_t *limit, + ByteSink &sink, uint32_t options, Edits *edits, + UErrorCode &errorCode); +}; + +U_NAMESPACE_END diff --git a/deps/icu-small/source/common/bytestream.cpp b/deps/icu-small/source/common/bytestream.cpp index 5a5c2e4410e936..0d0e4dda39b088 100644 --- a/deps/icu-small/source/common/bytestream.cpp +++ b/deps/icu-small/source/common/bytestream.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // Copyright (C) 2009-2011, International Business Machines // Corporation and others. All Rights Reserved. @@ -45,6 +45,12 @@ void CheckedArrayByteSink::Append(const char* bytes, int32_t n) { if (n <= 0) { return; } + if (n > (INT32_MAX - appended_)) { + // TODO: Report as integer overflow, not merely buffer overflow. + appended_ = INT32_MAX; + overflowed_ = TRUE; + return; + } appended_ += n; int32_t available = capacity_ - size_; if (n > available) { diff --git a/deps/icu-small/source/common/bytestrie.cpp b/deps/icu-small/source/common/bytestrie.cpp index 093cd8ddb12106..c4d498c4bfad32 100644 --- a/deps/icu-small/source/common/bytestrie.cpp +++ b/deps/icu-small/source/common/bytestrie.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bytestrie.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/bytestriebuilder.cpp b/deps/icu-small/source/common/bytestriebuilder.cpp index 913d85a21217be..581505e0092b15 100644 --- a/deps/icu-small/source/common/bytestriebuilder.cpp +++ b/deps/icu-small/source/common/bytestriebuilder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bytestriebuilder.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/bytestrieiterator.cpp b/deps/icu-small/source/common/bytestrieiterator.cpp index 4d04247c4933d0..e64961a1f1365a 100644 --- a/deps/icu-small/source/common/bytestrieiterator.cpp +++ b/deps/icu-small/source/common/bytestrieiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bytestrieiterator.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/caniter.cpp b/deps/icu-small/source/common/caniter.cpp index c3af281b82f420..d57c64247fc591 100644 --- a/deps/icu-small/source/common/caniter.cpp +++ b/deps/icu-small/source/common/caniter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** @@ -311,12 +311,12 @@ void U_EXPORT2 CanonicalIterator::permute(UnicodeString &source, UBool skipZeros // see what the permutations of the characters before and after this one are //Hashtable *subpermute = permute(source.substring(0,i) + source.substring(i + UTF16.getCharCount(cp))); - permute(subPermuteString.replace(i, U16_LENGTH(cp), NULL, 0), skipZeros, &subpermute, status); + permute(subPermuteString.remove(i, U16_LENGTH(cp)), skipZeros, &subpermute, status); /* Test for buffer overflows */ if(U_FAILURE(status)) { return; } - // The upper replace is destructive. The question is do we have to make a copy, or we don't care about the contents + // The upper remove is destructive. The question is do we have to make a copy, or we don't care about the contents // of source at this point. // prefix this character to all of them @@ -405,7 +405,7 @@ UnicodeString* CanonicalIterator::getEquivalents(const UnicodeString &segment, i //String[] finalResult = new String[result.size()]; UnicodeString *finalResult = NULL; int32_t resultCount; - if((resultCount = result.count())) { + if((resultCount = result.count()) != 0) { finalResult = new UnicodeString[resultCount]; if (finalResult == 0) { status = U_MEMORY_ALLOCATION_ERROR; diff --git a/deps/icu-small/source/common/chariter.cpp b/deps/icu-small/source/common/chariter.cpp index 625ac49eaccdb9..887119a0ebaa15 100644 --- a/deps/icu-small/source/common/chariter.cpp +++ b/deps/icu-small/source/common/chariter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/charstr.cpp b/deps/icu-small/source/common/charstr.cpp index c792181378ec0b..8bacd20ddc7a68 100644 --- a/deps/icu-small/source/common/charstr.cpp +++ b/deps/icu-small/source/common/charstr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: charstr.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -15,6 +15,7 @@ */ #include "unicode/utypes.h" +#include "unicode/putil.h" #include "charstr.h" #include "cmemory.h" #include "cstring.h" diff --git a/deps/icu-small/source/common/charstr.h b/deps/icu-small/source/common/charstr.h index 9758c5c542b3f0..3cfdf6a897a497 100644 --- a/deps/icu-small/source/common/charstr.h +++ b/deps/icu-small/source/common/charstr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/cmemory.c b/deps/icu-small/source/common/cmemory.cpp similarity index 98% rename from deps/icu-small/source/common/cmemory.c rename to deps/icu-small/source/common/cmemory.cpp index 0054e3de8b2466..300279c2430d10 100644 --- a/deps/icu-small/source/common/cmemory.c +++ b/deps/icu-small/source/common/cmemory.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/cmemory.h b/deps/icu-small/source/common/cmemory.h index d2e48e5f305fd9..83a0129651e468 100644 --- a/deps/icu-small/source/common/cmemory.h +++ b/deps/icu-small/source/common/cmemory.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -162,7 +162,6 @@ class LocalMemory : public LocalPointerBase { * @param p simple pointer to an array of T items that is adopted */ explicit LocalMemory(T *p=NULL) : LocalPointerBase(p) {} -#if U_HAVE_RVALUE_REFERENCES /** * Move constructor, leaves src with isNull(). * @param src source smart pointer @@ -170,14 +169,12 @@ class LocalMemory : public LocalPointerBase { LocalMemory(LocalMemory &&src) U_NOEXCEPT : LocalPointerBase(src.ptr) { src.ptr=NULL; } -#endif /** * Destructor deletes the memory it owns. */ ~LocalMemory() { uprv_free(LocalPointerBase::ptr); } -#if U_HAVE_RVALUE_REFERENCES /** * Move assignment operator, leaves src with isNull(). * The behavior is undefined if *this and src are the same object. @@ -187,7 +184,6 @@ class LocalMemory : public LocalPointerBase { LocalMemory &operator=(LocalMemory &&src) U_NOEXCEPT { return moveFrom(src); } -#endif /** * Move assignment, leaves src with isNull(). * The behavior is undefined if *this and src are the same object. @@ -312,6 +308,14 @@ class MaybeStackArray { * Default constructor initializes with internal T[stackCapacity] buffer. */ MaybeStackArray() : ptr(stackArray), capacity(stackCapacity), needToRelease(FALSE) {} + /** + * Automatically allocates the heap array if the argument is larger than the stack capacity. + * Intended for use when an approximate capacity is known at compile time but the true + * capacity is not known until runtime. + */ + MaybeStackArray(int32_t newCapacity) : MaybeStackArray() { + if (capacity < newCapacity) { resize(newCapacity); } + }; /** * Destructor deletes the array (if owned). */ diff --git a/deps/icu-small/source/common/cpputils.h b/deps/icu-small/source/common/cpputils.h index 57af69a7129483..307e570486439f 100644 --- a/deps/icu-small/source/common/cpputils.h +++ b/deps/icu-small/source/common/cpputils.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: cpputils.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 */ diff --git a/deps/icu-small/source/common/cstr.cpp b/deps/icu-small/source/common/cstr.cpp index 356367e0bcaea3..0114434329ad7e 100644 --- a/deps/icu-small/source/common/cstr.cpp +++ b/deps/icu-small/source/common/cstr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/cstr.h b/deps/icu-small/source/common/cstr.h index 25a8a5fc254baa..e310f131ac6eba 100644 --- a/deps/icu-small/source/common/cstr.h +++ b/deps/icu-small/source/common/cstr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/cstring.c b/deps/icu-small/source/common/cstring.cpp similarity index 99% rename from deps/icu-small/source/common/cstring.c rename to deps/icu-small/source/common/cstring.cpp index fbc0320d4ad1ec..a06bd3c79edb58 100644 --- a/deps/icu-small/source/common/cstring.c +++ b/deps/icu-small/source/common/cstring.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/cstring.h b/deps/icu-small/source/common/cstring.h index 238cb3138f2568..2232efcda5c0ef 100644 --- a/deps/icu-small/source/common/cstring.h +++ b/deps/icu-small/source/common/cstring.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/cwchar.c b/deps/icu-small/source/common/cwchar.cpp similarity index 92% rename from deps/icu-small/source/common/cwchar.c rename to deps/icu-small/source/common/cwchar.cpp index 0a9cd7b136f01d..4fd531114e8df8 100644 --- a/deps/icu-small/source/common/cwchar.c +++ b/deps/icu-small/source/common/cwchar.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: cwchar.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/cwchar.h b/deps/icu-small/source/common/cwchar.h index 1365abe4bcdd96..939eb599d69f8f 100644 --- a/deps/icu-small/source/common/cwchar.h +++ b/deps/icu-small/source/common/cwchar.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: cwchar.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/dictbe.cpp b/deps/icu-small/source/common/dictbe.cpp index 26635fa3d31cfd..02fc8a4726cf21 100644 --- a/deps/icu-small/source/common/dictbe.cpp +++ b/deps/icu-small/source/common/dictbe.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* @@ -46,9 +46,9 @@ int32_t DictionaryBreakEngine::findBreaks( UText *text, int32_t startPos, int32_t endPos, - UBool reverse, int32_t breakType, - UStack &foundBreaks ) const { + UVector32 &foundBreaks ) const { + (void)startPos; // TODO: remove this param? int32_t result = 0; // Find the span of characters included in the set. @@ -60,34 +60,12 @@ DictionaryBreakEngine::findBreaks( UText *text, int32_t rangeStart; int32_t rangeEnd; UChar32 c = utext_current32(text); - if (reverse) { - UBool isDict = fSet.contains(c); - while((current = (int32_t)utext_getNativeIndex(text)) > startPos && isDict) { - c = utext_previous32(text); - isDict = fSet.contains(c); - } - if (current < startPos) { - rangeStart = startPos; - } else { - rangeStart = current; - if (!isDict) { - utext_next32(text); - rangeStart = (int32_t)utext_getNativeIndex(text); - } - } - // rangeEnd = start + 1; - utext_setNativeIndex(text, start); - utext_next32(text); - rangeEnd = (int32_t)utext_getNativeIndex(text); - } - else { - while((current = (int32_t)utext_getNativeIndex(text)) < endPos && fSet.contains(c)) { - utext_next32(text); // TODO: recast loop for postincrement - c = utext_current32(text); - } - rangeStart = start; - rangeEnd = current; + while((current = (int32_t)utext_getNativeIndex(text)) < endPos && fSet.contains(c)) { + utext_next32(text); // TODO: recast loop for postincrement + c = utext_current32(text); } + rangeStart = start; + rangeEnd = current; if (breakType >= 0 && breakType < 32 && (((uint32_t)1 << breakType) & fTypes)) { result = divideUpDictionaryRange(text, rangeStart, rangeEnd, foundBreaks); utext_setNativeIndex(text, current); @@ -248,7 +226,7 @@ int32_t ThaiBreakEngine::divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const { + UVector32 &foundBreaks ) const { utext_setNativeIndex(text, rangeStart); utext_moveIndex32(text, THAI_MIN_WORD_SPAN); if (utext_getNativeIndex(text) >= rangeEnd) { @@ -487,7 +465,7 @@ int32_t LaoBreakEngine::divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const { + UVector32 &foundBreaks ) const { if ((rangeEnd - rangeStart) < LAO_MIN_WORD_SPAN) { return 0; // Not enough characters for two words } @@ -680,7 +658,7 @@ int32_t BurmeseBreakEngine::divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const { + UVector32 &foundBreaks ) const { if ((rangeEnd - rangeStart) < BURMESE_MIN_WORD_SPAN) { return 0; // Not enough characters for two words } @@ -885,7 +863,7 @@ int32_t KhmerBreakEngine::divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const { + UVector32 &foundBreaks ) const { if ((rangeEnd - rangeStart) < KHMER_MIN_WORD_SPAN) { return 0; // Not enough characters for two words } @@ -1110,9 +1088,9 @@ static inline uint32_t getKatakanaCost(int32_t wordLength){ return (wordLength > kMaxKatakanaLength) ? 8192 : katakanaCost[wordLength]; } -static inline bool isKatakana(uint16_t value) { - return (value >= 0x30A1u && value <= 0x30FEu && value != 0x30FBu) || - (value >= 0xFF66u && value <= 0xFF9fu); +static inline bool isKatakana(UChar32 value) { + return (value >= 0x30A1 && value <= 0x30FE && value != 0x30FB) || + (value >= 0xFF66 && value <= 0xFF9f); } @@ -1128,14 +1106,14 @@ static inline int32_t utext_i32_flag(int32_t bitIndex) { * @param text A UText representing the text * @param rangeStart The start of the range of dictionary characters * @param rangeEnd The end of the range of dictionary characters - * @param foundBreaks Output of C array of int32_t break positions, or 0 + * @param foundBreaks vector to receive the break positions * @return The number of breaks found */ int32_t CjkBreakEngine::divideUpDictionaryRange( UText *inText, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const { + UVector32 &foundBreaks ) const { if (rangeStart >= rangeEnd) { return 0; } @@ -1385,13 +1363,27 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText, // Now that we're done, convert positions in t_boundary[] (indices in // the normalized input string) back to indices in the original input UText // while reversing t_boundary and pushing values to foundBreaks. + int32_t prevCPPos = -1; + int32_t prevUTextPos = -1; for (int32_t i = numBreaks-1; i >= 0; i--) { int32_t cpPos = t_boundary.elementAti(i); + U_ASSERT(cpPos > prevCPPos); int32_t utextPos = inputMap.isValid() ? inputMap->elementAti(cpPos) : cpPos + rangeStart; - // Boundaries are added to foundBreaks output in ascending order. - U_ASSERT(foundBreaks.size() == 0 ||foundBreaks.peeki() < utextPos); - foundBreaks.push(utextPos, status); + U_ASSERT(utextPos >= prevUTextPos); + if (utextPos > prevUTextPos) { + // Boundaries are added to foundBreaks output in ascending order. + U_ASSERT(foundBreaks.size() == 0 || foundBreaks.peeki() < utextPos); + foundBreaks.push(utextPos, status); + } else { + // Normalization expanded the input text, the dictionary found a boundary + // within the expansion, giving two boundaries with the same index in the + // original text. Ignore the second. See ticket #12918. + --numBreaks; + } + prevCPPos = cpPos; + prevUTextPos = utextPos; } + (void)prevCPPos; // suppress compiler warnings about unused variable // inString goes out of scope // inputMap goes out of scope diff --git a/deps/icu-small/source/common/dictbe.h b/deps/icu-small/source/common/dictbe.h index 6e9f3d5020f188..ffc1ae9f269236 100644 --- a/deps/icu-small/source/common/dictbe.h +++ b/deps/icu-small/source/common/dictbe.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* @@ -15,6 +15,7 @@ #include "unicode/utext.h" #include "brkeng.h" +#include "uvectr32.h" U_NAMESPACE_BEGIN @@ -84,21 +85,18 @@ class DictionaryBreakEngine : public LanguageBreakEngine { * * @param text A UText representing the text. The iterator is left at * the end of the run of characters which the engine is capable of handling - * that starts from the first (or last) character in the range. + * that starts from the first character in the range. * @param startPos The start of the run within the supplied text. * @param endPos The end of the run within the supplied text. - * @param reverse Whether the caller is looking for breaks in a reverse - * direction. * @param breakType The type of break desired, or -1. - * @param foundBreaks An allocated C array of the breaks found, if any + * @param foundBreaks vector of int32_t to receive the break positions * @return The number of breaks found. */ virtual int32_t findBreaks( UText *text, int32_t startPos, int32_t endPos, - UBool reverse, int32_t breakType, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; protected: @@ -128,7 +126,7 @@ class DictionaryBreakEngine : public LanguageBreakEngine { virtual int32_t divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const = 0; + UVector32 &foundBreaks ) const = 0; }; @@ -185,7 +183,7 @@ class ThaiBreakEngine : public DictionaryBreakEngine { virtual int32_t divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; }; @@ -241,7 +239,7 @@ class LaoBreakEngine : public DictionaryBreakEngine { virtual int32_t divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; }; @@ -297,7 +295,7 @@ class BurmeseBreakEngine : public DictionaryBreakEngine { virtual int32_t divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; }; @@ -353,7 +351,7 @@ class KhmerBreakEngine : public DictionaryBreakEngine { virtual int32_t divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; }; @@ -417,7 +415,7 @@ class CjkBreakEngine : public DictionaryBreakEngine { virtual int32_t divideUpDictionaryRange( UText *text, int32_t rangeStart, int32_t rangeEnd, - UStack &foundBreaks ) const; + UVector32 &foundBreaks ) const; }; diff --git a/deps/icu-small/source/common/dictionarydata.cpp b/deps/icu-small/source/common/dictionarydata.cpp index 4a62f0bfc60b63..0efa5874931a07 100644 --- a/deps/icu-small/source/common/dictionarydata.cpp +++ b/deps/icu-small/source/common/dictionarydata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/dictionarydata.h b/deps/icu-small/source/common/dictionarydata.h index ef4277a440a192..5aec8fe0283630 100644 --- a/deps/icu-small/source/common/dictionarydata.h +++ b/deps/icu-small/source/common/dictionarydata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/dtintrv.cpp b/deps/icu-small/source/common/dtintrv.cpp index b7c3b48af34c07..dee637e62c07d4 100644 --- a/deps/icu-small/source/common/dtintrv.cpp +++ b/deps/icu-small/source/common/dtintrv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************************* * Copyright (C) 2008, International Business Machines Corporation and diff --git a/deps/icu-small/source/common/edits.cpp b/deps/icu-small/source/common/edits.cpp new file mode 100644 index 00000000000000..9ec005624fef0c --- /dev/null +++ b/deps/icu-small/source/common/edits.cpp @@ -0,0 +1,776 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// edits.cpp +// created: 2017feb08 Markus W. Scherer + +#include "unicode/utypes.h" +#include "unicode/edits.h" +#include "cmemory.h" +#include "uassert.h" + +U_NAMESPACE_BEGIN + +namespace { + +// 0000uuuuuuuuuuuu records u+1 unchanged text units. +const int32_t MAX_UNCHANGED_LENGTH = 0x1000; +const int32_t MAX_UNCHANGED = MAX_UNCHANGED_LENGTH - 1; + +// 0mmmnnnccccccccc with m=1..6 records ccc+1 replacements of m:n text units. +const int32_t MAX_SHORT_CHANGE_OLD_LENGTH = 6; +const int32_t MAX_SHORT_CHANGE_NEW_LENGTH = 7; +const int32_t SHORT_CHANGE_NUM_MASK = 0x1ff; +const int32_t MAX_SHORT_CHANGE = 0x6fff; + +// 0111mmmmmmnnnnnn records a replacement of m text units with n. +// m or n = 61: actual length follows in the next edits array unit. +// m or n = 62..63: actual length follows in the next two edits array units. +// Bit 30 of the actual length is in the head unit. +// Trailing units have bit 15 set. +const int32_t LENGTH_IN_1TRAIL = 61; +const int32_t LENGTH_IN_2TRAIL = 62; + +} // namespace + +void Edits::releaseArray() U_NOEXCEPT { + if (array != stackArray) { + uprv_free(array); + } +} + +Edits &Edits::copyArray(const Edits &other) { + if (U_FAILURE(errorCode_)) { + length = delta = numChanges = 0; + return *this; + } + if (length > capacity) { + uint16_t *newArray = (uint16_t *)uprv_malloc((size_t)length * 2); + if (newArray == nullptr) { + length = delta = numChanges = 0; + errorCode_ = U_MEMORY_ALLOCATION_ERROR; + return *this; + } + releaseArray(); + array = newArray; + capacity = length; + } + if (length > 0) { + uprv_memcpy(array, other.array, (size_t)length * 2); + } + return *this; +} + +Edits &Edits::moveArray(Edits &src) U_NOEXCEPT { + if (U_FAILURE(errorCode_)) { + length = delta = numChanges = 0; + return *this; + } + releaseArray(); + if (length > STACK_CAPACITY) { + array = src.array; + capacity = src.capacity; + src.array = src.stackArray; + src.capacity = STACK_CAPACITY; + src.reset(); + return *this; + } + array = stackArray; + capacity = STACK_CAPACITY; + if (length > 0) { + uprv_memcpy(array, src.array, (size_t)length * 2); + } + return *this; +} + +Edits &Edits::operator=(const Edits &other) { + length = other.length; + delta = other.delta; + numChanges = other.numChanges; + errorCode_ = other.errorCode_; + return copyArray(other); +} + +Edits &Edits::operator=(Edits &&src) U_NOEXCEPT { + length = src.length; + delta = src.delta; + numChanges = src.numChanges; + errorCode_ = src.errorCode_; + return moveArray(src); +} + +Edits::~Edits() { + releaseArray(); +} + +void Edits::reset() U_NOEXCEPT { + length = delta = numChanges = 0; + errorCode_ = U_ZERO_ERROR; +} + +void Edits::addUnchanged(int32_t unchangedLength) { + if(U_FAILURE(errorCode_) || unchangedLength == 0) { return; } + if(unchangedLength < 0) { + errorCode_ = U_ILLEGAL_ARGUMENT_ERROR; + return; + } + // Merge into previous unchanged-text record, if any. + int32_t last = lastUnit(); + if(last < MAX_UNCHANGED) { + int32_t remaining = MAX_UNCHANGED - last; + if (remaining >= unchangedLength) { + setLastUnit(last + unchangedLength); + return; + } + setLastUnit(MAX_UNCHANGED); + unchangedLength -= remaining; + } + // Split large lengths into multiple units. + while(unchangedLength >= MAX_UNCHANGED_LENGTH) { + append(MAX_UNCHANGED); + unchangedLength -= MAX_UNCHANGED_LENGTH; + } + // Write a small (remaining) length. + if(unchangedLength > 0) { + append(unchangedLength - 1); + } +} + +void Edits::addReplace(int32_t oldLength, int32_t newLength) { + if(U_FAILURE(errorCode_)) { return; } + if(oldLength < 0 || newLength < 0) { + errorCode_ = U_ILLEGAL_ARGUMENT_ERROR; + return; + } + if (oldLength == 0 && newLength == 0) { + return; + } + ++numChanges; + int32_t newDelta = newLength - oldLength; + if (newDelta != 0) { + if ((newDelta > 0 && delta >= 0 && newDelta > (INT32_MAX - delta)) || + (newDelta < 0 && delta < 0 && newDelta < (INT32_MIN - delta))) { + // Integer overflow or underflow. + errorCode_ = U_INDEX_OUTOFBOUNDS_ERROR; + return; + } + delta += newDelta; + } + + if(0 < oldLength && oldLength <= MAX_SHORT_CHANGE_OLD_LENGTH && + newLength <= MAX_SHORT_CHANGE_NEW_LENGTH) { + // Merge into previous same-lengths short-replacement record, if any. + int32_t u = (oldLength << 12) | (newLength << 9); + int32_t last = lastUnit(); + if(MAX_UNCHANGED < last && last < MAX_SHORT_CHANGE && + (last & ~SHORT_CHANGE_NUM_MASK) == u && + (last & SHORT_CHANGE_NUM_MASK) < SHORT_CHANGE_NUM_MASK) { + setLastUnit(last + 1); + return; + } + append(u); + return; + } + + int32_t head = 0x7000; + if (oldLength < LENGTH_IN_1TRAIL && newLength < LENGTH_IN_1TRAIL) { + head |= oldLength << 6; + head |= newLength; + append(head); + } else if ((capacity - length) >= 5 || growArray()) { + int32_t limit = length + 1; + if(oldLength < LENGTH_IN_1TRAIL) { + head |= oldLength << 6; + } else if(oldLength <= 0x7fff) { + head |= LENGTH_IN_1TRAIL << 6; + array[limit++] = (uint16_t)(0x8000 | oldLength); + } else { + head |= (LENGTH_IN_2TRAIL + (oldLength >> 30)) << 6; + array[limit++] = (uint16_t)(0x8000 | (oldLength >> 15)); + array[limit++] = (uint16_t)(0x8000 | oldLength); + } + if(newLength < LENGTH_IN_1TRAIL) { + head |= newLength; + } else if(newLength <= 0x7fff) { + head |= LENGTH_IN_1TRAIL; + array[limit++] = (uint16_t)(0x8000 | newLength); + } else { + head |= LENGTH_IN_2TRAIL + (newLength >> 30); + array[limit++] = (uint16_t)(0x8000 | (newLength >> 15)); + array[limit++] = (uint16_t)(0x8000 | newLength); + } + array[length] = (uint16_t)head; + length = limit; + } +} + +void Edits::append(int32_t r) { + if(length < capacity || growArray()) { + array[length++] = (uint16_t)r; + } +} + +UBool Edits::growArray() { + int32_t newCapacity; + if (array == stackArray) { + newCapacity = 2000; + } else if (capacity == INT32_MAX) { + // Not U_BUFFER_OVERFLOW_ERROR because that could be confused on a string transform API + // with a result-string-buffer overflow. + errorCode_ = U_INDEX_OUTOFBOUNDS_ERROR; + return FALSE; + } else if (capacity >= (INT32_MAX / 2)) { + newCapacity = INT32_MAX; + } else { + newCapacity = 2 * capacity; + } + // Grow by at least 5 units so that a maximal change record will fit. + if ((newCapacity - capacity) < 5) { + errorCode_ = U_INDEX_OUTOFBOUNDS_ERROR; + return FALSE; + } + uint16_t *newArray = (uint16_t *)uprv_malloc((size_t)newCapacity * 2); + if (newArray == NULL) { + errorCode_ = U_MEMORY_ALLOCATION_ERROR; + return FALSE; + } + uprv_memcpy(newArray, array, (size_t)length * 2); + releaseArray(); + array = newArray; + capacity = newCapacity; + return TRUE; +} + +UBool Edits::copyErrorTo(UErrorCode &outErrorCode) { + if (U_FAILURE(outErrorCode)) { return TRUE; } + if (U_SUCCESS(errorCode_)) { return FALSE; } + outErrorCode = errorCode_; + return TRUE; +} + +Edits &Edits::mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &errorCode) { + if (copyErrorTo(errorCode)) { return *this; } + // Picture string a --(Edits ab)--> string b --(Edits bc)--> string c. + // Parallel iteration over both Edits. + Iterator abIter = ab.getFineIterator(); + Iterator bcIter = bc.getFineIterator(); + UBool abHasNext = TRUE, bcHasNext = TRUE; + // Copy iterator state into local variables, so that we can modify and subdivide spans. + // ab old & new length, bc old & new length + int32_t aLength = 0, ab_bLength = 0, bc_bLength = 0, cLength = 0; + // When we have different-intermediate-length changes, we accumulate a larger change. + int32_t pending_aLength = 0, pending_cLength = 0; + for (;;) { + // At this point, for each of the two iterators: + // Either we are done with the locally cached current edit, + // and its intermediate-string length has been reset, + // or we will continue to work with a truncated remainder of this edit. + // + // If the current edit is done, and the iterator has not yet reached the end, + // then we fetch the next edit. This is true for at least one of the iterators. + // + // Normally it does not matter whether we fetch from ab and then bc or vice versa. + // However, the result is observably different when + // ab deletions meet bc insertions at the same intermediate-string index. + // Some users expect the bc insertions to come first, so we fetch from bc first. + if (bc_bLength == 0) { + if (bcHasNext && (bcHasNext = bcIter.next(errorCode))) { + bc_bLength = bcIter.oldLength(); + cLength = bcIter.newLength(); + if (bc_bLength == 0) { + // insertion + if (ab_bLength == 0 || !abIter.hasChange()) { + addReplace(pending_aLength, pending_cLength + cLength); + pending_aLength = pending_cLength = 0; + } else { + pending_cLength += cLength; + } + continue; + } + } + // else see if the other iterator is done, too. + } + if (ab_bLength == 0) { + if (abHasNext && (abHasNext = abIter.next(errorCode))) { + aLength = abIter.oldLength(); + ab_bLength = abIter.newLength(); + if (ab_bLength == 0) { + // deletion + if (bc_bLength == bcIter.oldLength() || !bcIter.hasChange()) { + addReplace(pending_aLength + aLength, pending_cLength); + pending_aLength = pending_cLength = 0; + } else { + pending_aLength += aLength; + } + continue; + } + } else if (bc_bLength == 0) { + // Both iterators are done at the same time: + // The intermediate-string lengths match. + break; + } else { + // The ab output string is shorter than the bc input string. + if (!copyErrorTo(errorCode)) { + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + } + return *this; + } + } + if (bc_bLength == 0) { + // The bc input string is shorter than the ab output string. + if (!copyErrorTo(errorCode)) { + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + } + return *this; + } + // Done fetching: ab_bLength > 0 && bc_bLength > 0 + + // The current state has two parts: + // - Past: We accumulate a longer ac edit in the "pending" variables. + // - Current: We have copies of the current ab/bc edits in local variables. + // At least one side is newly fetched. + // One side might be a truncated remainder of an edit we fetched earlier. + + if (!abIter.hasChange() && !bcIter.hasChange()) { + // An unchanged span all the way from string a to string c. + if (pending_aLength != 0 || pending_cLength != 0) { + addReplace(pending_aLength, pending_cLength); + pending_aLength = pending_cLength = 0; + } + int32_t unchangedLength = aLength <= cLength ? aLength : cLength; + addUnchanged(unchangedLength); + ab_bLength = aLength -= unchangedLength; + bc_bLength = cLength -= unchangedLength; + // At least one of the unchanged spans is now empty. + continue; + } + if (!abIter.hasChange() && bcIter.hasChange()) { + // Unchanged a->b but changed b->c. + if (ab_bLength >= bc_bLength) { + // Split the longer unchanged span into change + remainder. + addReplace(pending_aLength + bc_bLength, pending_cLength + cLength); + pending_aLength = pending_cLength = 0; + aLength = ab_bLength -= bc_bLength; + bc_bLength = 0; + continue; + } + // Handle the shorter unchanged span below like a change. + } else if (abIter.hasChange() && !bcIter.hasChange()) { + // Changed a->b and then unchanged b->c. + if (ab_bLength <= bc_bLength) { + // Split the longer unchanged span into change + remainder. + addReplace(pending_aLength + aLength, pending_cLength + ab_bLength); + pending_aLength = pending_cLength = 0; + cLength = bc_bLength -= ab_bLength; + ab_bLength = 0; + continue; + } + // Handle the shorter unchanged span below like a change. + } else { // both abIter.hasChange() && bcIter.hasChange() + if (ab_bLength == bc_bLength) { + // Changes on both sides up to the same position. Emit & reset. + addReplace(pending_aLength + aLength, pending_cLength + cLength); + pending_aLength = pending_cLength = 0; + ab_bLength = bc_bLength = 0; + continue; + } + } + // Accumulate the a->c change, reset the shorter side, + // keep a remainder of the longer one. + pending_aLength += aLength; + pending_cLength += cLength; + if (ab_bLength < bc_bLength) { + bc_bLength -= ab_bLength; + cLength = ab_bLength = 0; + } else { // ab_bLength > bc_bLength + ab_bLength -= bc_bLength; + aLength = bc_bLength = 0; + } + } + if (pending_aLength != 0 || pending_cLength != 0) { + addReplace(pending_aLength, pending_cLength); + } + copyErrorTo(errorCode); + return *this; +} + +Edits::Iterator::Iterator(const uint16_t *a, int32_t len, UBool oc, UBool crs) : + array(a), index(0), length(len), remaining(0), + onlyChanges_(oc), coarse(crs), + dir(0), changed(FALSE), oldLength_(0), newLength_(0), + srcIndex(0), replIndex(0), destIndex(0) {} + +int32_t Edits::Iterator::readLength(int32_t head) { + if (head < LENGTH_IN_1TRAIL) { + return head; + } else if (head < LENGTH_IN_2TRAIL) { + U_ASSERT(index < length); + U_ASSERT(array[index] >= 0x8000); + return array[index++] & 0x7fff; + } else { + U_ASSERT((index + 2) <= length); + U_ASSERT(array[index] >= 0x8000); + U_ASSERT(array[index + 1] >= 0x8000); + int32_t len = ((head & 1) << 30) | + ((int32_t)(array[index] & 0x7fff) << 15) | + (array[index + 1] & 0x7fff); + index += 2; + return len; + } +} + +void Edits::Iterator::updateNextIndexes() { + srcIndex += oldLength_; + if (changed) { + replIndex += newLength_; + } + destIndex += newLength_; +} + +void Edits::Iterator::updatePreviousIndexes() { + srcIndex -= oldLength_; + if (changed) { + replIndex -= newLength_; + } + destIndex -= newLength_; +} + +UBool Edits::Iterator::noNext() { + // No change before or beyond the string. + dir = 0; + changed = FALSE; + oldLength_ = newLength_ = 0; + return FALSE; +} + +UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) { + // Forward iteration: Update the string indexes to the limit of the current span, + // and post-increment-read array units to assemble a new span. + // Leaves the array index one after the last unit of that span. + if (U_FAILURE(errorCode)) { return FALSE; } + // We have an errorCode in case we need to start guarding against integer overflows. + // It is also convenient for caller loops if we bail out when an error was set elsewhere. + if (dir > 0) { + updateNextIndexes(); + } else { + if (dir < 0) { + // Turn around from previous() to next(). + // Post-increment-read the same span again. + if (remaining > 0) { + // Fine-grained iterator: + // Stay on the current one of a sequence of compressed changes. + ++index; // next() rests on the index after the sequence unit. + dir = 1; + return TRUE; + } + } + dir = 1; + } + if (remaining >= 1) { + // Fine-grained iterator: Continue a sequence of compressed changes. + if (remaining > 1) { + --remaining; + return TRUE; + } + remaining = 0; + } + if (index >= length) { + return noNext(); + } + int32_t u = array[index++]; + if (u <= MAX_UNCHANGED) { + // Combine adjacent unchanged ranges. + changed = FALSE; + oldLength_ = u + 1; + while (index < length && (u = array[index]) <= MAX_UNCHANGED) { + ++index; + oldLength_ += u + 1; + } + newLength_ = oldLength_; + if (onlyChanges) { + updateNextIndexes(); + if (index >= length) { + return noNext(); + } + // already fetched u > MAX_UNCHANGED at index + ++index; + } else { + return TRUE; + } + } + changed = TRUE; + if (u <= MAX_SHORT_CHANGE) { + int32_t oldLen = u >> 12; + int32_t newLen = (u >> 9) & MAX_SHORT_CHANGE_NEW_LENGTH; + int32_t num = (u & SHORT_CHANGE_NUM_MASK) + 1; + if (coarse) { + oldLength_ = num * oldLen; + newLength_ = num * newLen; + } else { + // Split a sequence of changes that was compressed into one unit. + oldLength_ = oldLen; + newLength_ = newLen; + if (num > 1) { + remaining = num; // This is the first of two or more changes. + } + return TRUE; + } + } else { + U_ASSERT(u <= 0x7fff); + oldLength_ = readLength((u >> 6) & 0x3f); + newLength_ = readLength(u & 0x3f); + if (!coarse) { + return TRUE; + } + } + // Combine adjacent changes. + while (index < length && (u = array[index]) > MAX_UNCHANGED) { + ++index; + if (u <= MAX_SHORT_CHANGE) { + int32_t num = (u & SHORT_CHANGE_NUM_MASK) + 1; + oldLength_ += (u >> 12) * num; + newLength_ += ((u >> 9) & MAX_SHORT_CHANGE_NEW_LENGTH) * num; + } else { + U_ASSERT(u <= 0x7fff); + oldLength_ += readLength((u >> 6) & 0x3f); + newLength_ += readLength(u & 0x3f); + } + } + return TRUE; +} + +UBool Edits::Iterator::previous(UErrorCode &errorCode) { + // Backward iteration: Pre-decrement-read array units to assemble a new span, + // then update the string indexes to the start of that span. + // Leaves the array index on the head unit of that span. + if (U_FAILURE(errorCode)) { return FALSE; } + // We have an errorCode in case we need to start guarding against integer overflows. + // It is also convenient for caller loops if we bail out when an error was set elsewhere. + if (dir >= 0) { + if (dir > 0) { + // Turn around from next() to previous(). + // Set the string indexes to the span limit and + // pre-decrement-read the same span again. + if (remaining > 0) { + // Fine-grained iterator: + // Stay on the current one of a sequence of compressed changes. + --index; // previous() rests on the sequence unit. + dir = -1; + return TRUE; + } + updateNextIndexes(); + } + dir = -1; + } + if (remaining > 0) { + // Fine-grained iterator: Continue a sequence of compressed changes. + int32_t u = array[index]; + U_ASSERT(MAX_UNCHANGED < u && u <= MAX_SHORT_CHANGE); + if (remaining <= (u & SHORT_CHANGE_NUM_MASK)) { + ++remaining; + updatePreviousIndexes(); + return TRUE; + } + remaining = 0; + } + if (index <= 0) { + return noNext(); + } + int32_t u = array[--index]; + if (u <= MAX_UNCHANGED) { + // Combine adjacent unchanged ranges. + changed = FALSE; + oldLength_ = u + 1; + while (index > 0 && (u = array[index - 1]) <= MAX_UNCHANGED) { + --index; + oldLength_ += u + 1; + } + newLength_ = oldLength_; + // No need to handle onlyChanges as long as previous() is called only from findIndex(). + updatePreviousIndexes(); + return TRUE; + } + changed = TRUE; + if (u <= MAX_SHORT_CHANGE) { + int32_t oldLen = u >> 12; + int32_t newLen = (u >> 9) & MAX_SHORT_CHANGE_NEW_LENGTH; + int32_t num = (u & SHORT_CHANGE_NUM_MASK) + 1; + if (coarse) { + oldLength_ = num * oldLen; + newLength_ = num * newLen; + } else { + // Split a sequence of changes that was compressed into one unit. + oldLength_ = oldLen; + newLength_ = newLen; + if (num > 1) { + remaining = 1; // This is the last of two or more changes. + } + updatePreviousIndexes(); + return TRUE; + } + } else { + if (u <= 0x7fff) { + // The change is encoded in u alone. + oldLength_ = readLength((u >> 6) & 0x3f); + newLength_ = readLength(u & 0x3f); + } else { + // Back up to the head of the change, read the lengths, + // and reset the index to the head again. + U_ASSERT(index > 0); + while ((u = array[--index]) > 0x7fff) {} + U_ASSERT(u > MAX_SHORT_CHANGE); + int32_t headIndex = index++; + oldLength_ = readLength((u >> 6) & 0x3f); + newLength_ = readLength(u & 0x3f); + index = headIndex; + } + if (!coarse) { + updatePreviousIndexes(); + return TRUE; + } + } + // Combine adjacent changes. + while (index > 0 && (u = array[index - 1]) > MAX_UNCHANGED) { + --index; + if (u <= MAX_SHORT_CHANGE) { + int32_t num = (u & SHORT_CHANGE_NUM_MASK) + 1; + oldLength_ += (u >> 12) * num; + newLength_ += ((u >> 9) & MAX_SHORT_CHANGE_NEW_LENGTH) * num; + } else if (u <= 0x7fff) { + // Read the lengths, and reset the index to the head again. + int32_t headIndex = index++; + oldLength_ += readLength((u >> 6) & 0x3f); + newLength_ += readLength(u & 0x3f); + index = headIndex; + } + } + updatePreviousIndexes(); + return TRUE; +} + +int32_t Edits::Iterator::findIndex(int32_t i, UBool findSource, UErrorCode &errorCode) { + if (U_FAILURE(errorCode) || i < 0) { return -1; } + int32_t spanStart, spanLength; + if (findSource) { // find source index + spanStart = srcIndex; + spanLength = oldLength_; + } else { // find destination index + spanStart = destIndex; + spanLength = newLength_; + } + if (i < spanStart) { + if (i >= (spanStart / 2)) { + // Search backwards. + for (;;) { + UBool hasPrevious = previous(errorCode); + U_ASSERT(hasPrevious); // because i>=0 and the first span starts at 0 + (void)hasPrevious; // avoid unused-variable warning + spanStart = findSource ? srcIndex : destIndex; + if (i >= spanStart) { + // The index is in the current span. + return 0; + } + if (remaining > 0) { + // Is the index in one of the remaining compressed edits? + // spanStart is the start of the current span, first of the remaining ones. + spanLength = findSource ? oldLength_ : newLength_; + int32_t u = array[index]; + U_ASSERT(MAX_UNCHANGED < u && u <= MAX_SHORT_CHANGE); + int32_t num = (u & SHORT_CHANGE_NUM_MASK) + 1 - remaining; + int32_t len = num * spanLength; + if (i >= (spanStart - len)) { + int32_t n = ((spanStart - i - 1) / spanLength) + 1; + // 1 <= n <= num + srcIndex -= n * oldLength_; + replIndex -= n * newLength_; + destIndex -= n * newLength_; + remaining += n; + return 0; + } + // Skip all of these edits at once. + srcIndex -= num * oldLength_; + replIndex -= num * newLength_; + destIndex -= num * newLength_; + remaining = 0; + } + } + } + // Reset the iterator to the start. + dir = 0; + index = remaining = oldLength_ = newLength_ = srcIndex = replIndex = destIndex = 0; + } else if (i < (spanStart + spanLength)) { + // The index is in the current span. + return 0; + } + while (next(FALSE, errorCode)) { + if (findSource) { + spanStart = srcIndex; + spanLength = oldLength_; + } else { + spanStart = destIndex; + spanLength = newLength_; + } + if (i < (spanStart + spanLength)) { + // The index is in the current span. + return 0; + } + if (remaining > 1) { + // Is the index in one of the remaining compressed edits? + // spanStart is the start of the current span, first of the remaining ones. + int32_t len = remaining * spanLength; + if (i < (spanStart + len)) { + int32_t n = (i - spanStart) / spanLength; // 1 <= n <= remaining - 1 + srcIndex += n * oldLength_; + replIndex += n * newLength_; + destIndex += n * newLength_; + remaining -= n; + return 0; + } + // Make next() skip all of these edits at once. + oldLength_ *= remaining; + newLength_ *= remaining; + remaining = 0; + } + } + return 1; +} + +int32_t Edits::Iterator::destinationIndexFromSourceIndex(int32_t i, UErrorCode &errorCode) { + int32_t where = findIndex(i, TRUE, errorCode); + if (where < 0) { + // Error or before the string. + return 0; + } + if (where > 0 || i == srcIndex) { + // At or after string length, or at start of the found span. + return destIndex; + } + if (changed) { + // In a change span, map to its end. + return destIndex + newLength_; + } else { + // In an unchanged span, offset 1:1 within it. + return destIndex + (i - srcIndex); + } +} + +int32_t Edits::Iterator::sourceIndexFromDestinationIndex(int32_t i, UErrorCode &errorCode) { + int32_t where = findIndex(i, FALSE, errorCode); + if (where < 0) { + // Error or before the string. + return 0; + } + if (where > 0 || i == destIndex) { + // At or after string length, or at start of the found span. + return srcIndex; + } + if (changed) { + // In a change span, map to its end. + return srcIndex + oldLength_; + } else { + // In an unchanged span, offset within it. + return srcIndex + (i - destIndex); + } +} + +U_NAMESPACE_END diff --git a/deps/icu-small/source/common/errorcode.cpp b/deps/icu-small/source/common/errorcode.cpp index bc7807d6010037..e7ac43b52739ae 100644 --- a/deps/icu-small/source/common/errorcode.cpp +++ b/deps/icu-small/source/common/errorcode.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: errorcode.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/filteredbrk.cpp b/deps/icu-small/source/common/filteredbrk.cpp index 610ab9e66407d9..6a38b1bf3baf40 100644 --- a/deps/icu-small/source/common/filteredbrk.cpp +++ b/deps/icu-small/source/common/filteredbrk.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -694,7 +694,7 @@ FilteredBreakIteratorBuilder::createInstance(const Locale& where, UErrorCode& st } FilteredBreakIteratorBuilder * -FilteredBreakIteratorBuilder::createInstance(UErrorCode& status) { +FilteredBreakIteratorBuilder::createEmptyInstance(UErrorCode& status) { if(U_FAILURE(status)) return NULL; LocalPointer ret(new SimpleFilteredBreakIteratorBuilder(status), status); return (U_SUCCESS(status))? ret.orphan(): NULL; @@ -702,4 +702,4 @@ FilteredBreakIteratorBuilder::createInstance(UErrorCode& status) { U_NAMESPACE_END -#endif //#if !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING && !UCONFIG_NO_FILTERED_BREAK_ITERATION +#endif //#if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION diff --git a/deps/icu-small/source/common/filterednormalizer2.cpp b/deps/icu-small/source/common/filterednormalizer2.cpp index fb6e831af7a4c5..1a0914d3f7b34c 100644 --- a/deps/icu-small/source/common/filterednormalizer2.cpp +++ b/deps/icu-small/source/common/filterednormalizer2.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: filterednormalizer2.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -20,7 +20,9 @@ #if !UCONFIG_NO_NORMALIZATION +#include "unicode/edits.h" #include "unicode/normalizer2.h" +#include "unicode/stringoptions.h" #include "unicode/uniset.h" #include "unicode/unistr.h" #include "unicode/unorm.h" @@ -85,6 +87,52 @@ FilteredNormalizer2::normalize(const UnicodeString &src, return dest; } +void +FilteredNormalizer2::normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink, + Edits *edits, UErrorCode &errorCode) const { + if (U_FAILURE(errorCode)) { + return; + } + if (edits != nullptr && (options & U_EDITS_NO_RESET) == 0) { + edits->reset(); + } + options |= U_EDITS_NO_RESET; // Do not reset for each span. + normalizeUTF8(options, src.data(), src.length(), sink, edits, USET_SPAN_SIMPLE, errorCode); +} + +void +FilteredNormalizer2::normalizeUTF8(uint32_t options, const char *src, int32_t length, + ByteSink &sink, Edits *edits, + USetSpanCondition spanCondition, + UErrorCode &errorCode) const { + while (length > 0) { + int32_t spanLength = set.spanUTF8(src, length, spanCondition); + if (spanCondition == USET_SPAN_NOT_CONTAINED) { + if (spanLength != 0) { + if (edits != nullptr) { + edits->addUnchanged(spanLength); + } + if ((options & U_OMIT_UNCHANGED_TEXT) == 0) { + sink.Append(src, spanLength); + } + } + spanCondition = USET_SPAN_SIMPLE; + } else { + if (spanLength != 0) { + // Not norm2.normalizeSecondAndAppend() because we do not want + // to modify the non-filter part of dest. + norm2.normalizeUTF8(options, StringPiece(src, spanLength), sink, edits, errorCode); + if (U_FAILURE(errorCode)) { + break; + } + } + spanCondition = USET_SPAN_NOT_CONTAINED; + } + src += spanLength; + length -= spanLength; + } +} + UnicodeString & FilteredNormalizer2::normalizeSecondAndAppend(UnicodeString &first, const UnicodeString &second, @@ -196,6 +244,31 @@ FilteredNormalizer2::isNormalized(const UnicodeString &s, UErrorCode &errorCode) return TRUE; } +UBool +FilteredNormalizer2::isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return FALSE; + } + const char *s = sp.data(); + int32_t length = sp.length(); + USetSpanCondition spanCondition = USET_SPAN_SIMPLE; + while (length > 0) { + int32_t spanLength = set.spanUTF8(s, length, spanCondition); + if (spanCondition == USET_SPAN_NOT_CONTAINED) { + spanCondition = USET_SPAN_SIMPLE; + } else { + if (!norm2.isNormalizedUTF8(StringPiece(s, spanLength), errorCode) || + U_FAILURE(errorCode)) { + return FALSE; + } + spanCondition = USET_SPAN_NOT_CONTAINED; + } + s += spanLength; + length -= spanLength; + } + return TRUE; +} + UNormalizationCheckResult FilteredNormalizer2::quickCheck(const UnicodeString &s, UErrorCode &errorCode) const { uprv_checkCanGetBuffer(s, errorCode); diff --git a/deps/icu-small/source/common/hash.h b/deps/icu-small/source/common/hash.h index a03fcae9548ab1..cc82ad2454b440 100644 --- a/deps/icu-small/source/common/hash.h +++ b/deps/icu-small/source/common/hash.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -33,6 +33,8 @@ class U_COMMON_API Hashtable : public UMemory { inline void init(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status); + inline void initSize(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, int32_t size, UErrorCode& status); + public: /** * Construct a hashtable @@ -41,6 +43,14 @@ class U_COMMON_API Hashtable : public UMemory { */ Hashtable(UBool ignoreKeyCase, UErrorCode& status); + /** + * Construct a hashtable + * @param ignoreKeyCase If true, keys are case insensitive. + * @param size initial size allocation + * @param status Error code + */ + Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status); + /** * Construct a hashtable * @param keyComp Comparator for comparing the keys @@ -119,10 +129,23 @@ inline void Hashtable::init(UHashFunction *keyHash, UKeyComparator *keyComp, } } +inline void Hashtable::initSize(UHashFunction *keyHash, UKeyComparator *keyComp, + UValueComparator *valueComp, int32_t size, UErrorCode& status) { + if (U_FAILURE(status)) { + return; + } + uhash_initSize(&hashObj, keyHash, keyComp, valueComp, size, &status); + if (U_SUCCESS(status)) { + hash = &hashObj; + uhash_setKeyDeleter(hash, uprv_deleteUObject); + } +} + inline Hashtable::Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status) : hash(0) { init( uhash_hashUnicodeString, keyComp, valueComp, status); } + inline Hashtable::Hashtable(UBool ignoreKeyCase, UErrorCode& status) : hash(0) { @@ -134,6 +157,17 @@ inline Hashtable::Hashtable(UBool ignoreKeyCase, UErrorCode& status) status); } +inline Hashtable::Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status) + : hash(0) +{ + initSize(ignoreKeyCase ? uhash_hashCaselessUnicodeString + : uhash_hashUnicodeString, + ignoreKeyCase ? uhash_compareCaselessUnicodeString + : uhash_compareUnicodeString, + NULL, size, + status); +} + inline Hashtable::Hashtable(UErrorCode& status) : hash(0) { diff --git a/deps/icu-small/source/common/icudataver.c b/deps/icu-small/source/common/icudataver.cpp similarity index 94% rename from deps/icu-small/source/common/icudataver.c rename to deps/icu-small/source/common/icudataver.cpp index 367e58f59b6910..6dd3ea1baee607 100644 --- a/deps/icu-small/source/common/icudataver.c +++ b/deps/icu-small/source/common/icudataver.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/icuplug.cpp b/deps/icu-small/source/common/icuplug.cpp index a0ec46b1f99bea..c3c8231b77d572 100644 --- a/deps/icu-small/source/common/icuplug.cpp +++ b/deps/icu-small/source/common/icuplug.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/icuplugimp.h b/deps/icu-small/source/common/icuplugimp.h index 895b35357b0e4c..282c639b40e271 100644 --- a/deps/icu-small/source/common/icuplugimp.h +++ b/deps/icu-small/source/common/icuplugimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/listformatter.cpp b/deps/icu-small/source/common/listformatter.cpp index 9225c22f163eb7..33a8ac28671fc6 100644 --- a/deps/icu-small/source/common/listformatter.cpp +++ b/deps/icu-small/source/common/listformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: listformatter.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -25,6 +25,7 @@ #include "charstr.h" #include "ucln_cmn.h" #include "uresimp.h" +#include "resource.h" U_NAMESPACE_BEGIN @@ -62,7 +63,7 @@ ListFormatInternal(const ListFormatInternal &other) : static Hashtable* listPatternHash = NULL; static UMutex listFormatterMutex = U_MUTEX_INITIALIZER; -static const char *STANDARD_STYLE = "standard"; +static const char STANDARD_STYLE[] = "standard"; U_CDECL_BEGIN static UBool U_CALLCONV uprv_listformatter_cleanup() { @@ -78,17 +79,6 @@ uprv_deleteListFormatInternal(void *obj) { U_CDECL_END -static ListFormatInternal* loadListFormatInternal( - const Locale& locale, - const char* style, - UErrorCode& errorCode); - -static void getStringByKey( - const UResourceBundle* rb, - const char* key, - UnicodeString& result, - UErrorCode& errorCode); - ListFormatter::ListFormatter(const ListFormatter& other) : owned(other.owned), data(other.data) { if (other.owned != NULL) { @@ -171,30 +161,107 @@ const ListFormatInternal* ListFormatter::getListFormatInternal( return result; } -static ListFormatInternal* loadListFormatInternal( +static const UChar solidus = 0x2F; +static const UChar 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 +}; + +struct ListFormatter::ListPatternsSink : public ResourceSink { + UnicodeString two, start, middle, end; +#if ((U_PLATFORM == U_PF_AIX) || (U_PLATFORM == U_PF_OS390)) && (U_CPLUSPLUS_VERSION < 11) + char aliasedStyle[kStyleLenMax+1]; + ListPatternsSink() { + uprv_memset(aliasedStyle, 0, kStyleLenMax+1); + } +#else + char aliasedStyle[kStyleLenMax+1] = {0}; + + ListPatternsSink() {} +#endif + virtual ~ListPatternsSink(); + + void setAliasedStyle(UnicodeString alias) { + int32_t startIndex = alias.indexOf(aliasPrefix, kAliasPrefixLen, 0); + if (startIndex < 0) { + return; + } + startIndex += kAliasPrefixLen; + int32_t endIndex = alias.indexOf(solidus, startIndex); + if (endIndex < 0) { + endIndex = alias.length(); + } + alias.extract(startIndex, endIndex-startIndex, aliasedStyle, kStyleLenMax+1, US_INV); + aliasedStyle[kStyleLenMax] = 0; + } + + void handleValueForPattern(ResourceValue &value, UnicodeString &pattern, UErrorCode &errorCode) { + if (pattern.isEmpty()) { + if (value.getType() == URES_ALIAS) { + if (aliasedStyle[0] == 0) { + setAliasedStyle(value.getAliasUnicodeString(errorCode)); + } + } else { + pattern = value.getUnicodeString(errorCode); + } + } + } + + virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, + UErrorCode &errorCode) { + aliasedStyle[0] = 0; + if (value.getType() == URES_ALIAS) { + setAliasedStyle(value.getAliasUnicodeString(errorCode)); + return; + } + ResourceTable listPatterns = value.getTable(errorCode); + for (int i = 0; U_SUCCESS(errorCode) && listPatterns.getKeyAndValue(i, key, value); ++i) { + if (uprv_strcmp(key, "2") == 0) { + handleValueForPattern(value, two, errorCode); + } else if (uprv_strcmp(key, "end") == 0) { + handleValueForPattern(value, end, errorCode); + } else if (uprv_strcmp(key, "middle") == 0) { + handleValueForPattern(value, middle, errorCode); + } else if (uprv_strcmp(key, "start") == 0) { + handleValueForPattern(value, start, errorCode); + } + } + } +}; + +// Virtual destructors must be defined out of line. +ListFormatter::ListPatternsSink::~ListPatternsSink() {} + +ListFormatInternal* ListFormatter::loadListFormatInternal( const Locale& locale, const char * style, UErrorCode& errorCode) { UResourceBundle* rb = ures_open(NULL, locale.getName(), &errorCode); - if (U_FAILURE(errorCode)) { - ures_close(rb); - return NULL; - } rb = ures_getByKeyWithFallback(rb, "listPattern", rb, &errorCode); - rb = ures_getByKeyWithFallback(rb, style, rb, &errorCode); - if (U_FAILURE(errorCode)) { ures_close(rb); return NULL; } - UnicodeString two, start, middle, end; - getStringByKey(rb, "2", two, errorCode); - getStringByKey(rb, "start", start, errorCode); - getStringByKey(rb, "middle", middle, errorCode); - getStringByKey(rb, "end", end, errorCode); + ListFormatter::ListPatternsSink sink; + char currentStyle[kStyleLenMax+1]; + uprv_strncpy(currentStyle, style, kStyleLenMax); + currentStyle[kStyleLenMax] = 0; + + for (;;) { + ures_getAllItemsWithFallback(rb, currentStyle, sink, errorCode); + if (U_FAILURE(errorCode) || sink.aliasedStyle[0] == 0 || uprv_strcmp(currentStyle, sink.aliasedStyle) == 0) { + break; + } + uprv_strcpy(currentStyle, sink.aliasedStyle); + } ures_close(rb); if (U_FAILURE(errorCode)) { return NULL; } - ListFormatInternal* result = new ListFormatInternal(two, start, middle, end, errorCode); + if (sink.two.isEmpty() || sink.start.isEmpty() || sink.middle.isEmpty() || sink.end.isEmpty()) { + errorCode = U_MISSING_RESOURCE_ERROR; + return NULL; + } + ListFormatInternal* result = new ListFormatInternal(sink.two, sink.start, sink.middle, sink.end, errorCode); if (result == NULL) { errorCode = U_MEMORY_ALLOCATION_ERROR; return NULL; @@ -206,15 +273,6 @@ static ListFormatInternal* loadListFormatInternal( return result; } -static void getStringByKey(const UResourceBundle* rb, const char* key, UnicodeString& result, UErrorCode& errorCode) { - int32_t len; - const UChar* ustr = ures_getStringByKeyWithFallback(rb, key, &len, &errorCode); - if (U_FAILURE(errorCode)) { - return; - } - result.setTo(ustr, len); -} - ListFormatter* ListFormatter::createInstance(UErrorCode& errorCode) { Locale locale; // The default locale. return createInstance(locale, errorCode); diff --git a/deps/icu-small/source/common/loadednormalizer2impl.cpp b/deps/icu-small/source/common/loadednormalizer2impl.cpp index b3b7b5d6212496..6fb9b816dc6591 100644 --- a/deps/icu-small/source/common/loadednormalizer2impl.cpp +++ b/deps/icu-small/source/common/loadednormalizer2impl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -62,7 +62,7 @@ LoadedNormalizer2Impl::isAcceptable(void * /*context*/, pInfo->dataFormat[1]==0x72 && pInfo->dataFormat[2]==0x6d && pInfo->dataFormat[3]==0x32 && - pInfo->formatVersion[0]==2 + pInfo->formatVersion[0]==3 ) { // Normalizer2Impl *me=(Normalizer2Impl *)context; // uprv_memcpy(me->dataVersion, pInfo->dataVersion, 4); @@ -84,7 +84,7 @@ LoadedNormalizer2Impl::load(const char *packageName, const char *name, UErrorCod const uint8_t *inBytes=(const uint8_t *)udata_getMemory(memory); const int32_t *inIndexes=(const int32_t *)inBytes; int32_t indexesLength=inIndexes[IX_NORM_TRIE_OFFSET]/4; - if(indexesLength<=IX_MIN_MAYBE_YES) { + if(indexesLength<=IX_MIN_LCCC_CP) { errorCode=U_INVALID_FORMAT_ERROR; // Not enough indexes. return; } @@ -232,6 +232,7 @@ Normalizer2::getInstance(const char *packageName, } } if(allModes==NULL) { + ucln_common_registerCleanup(UCLN_COMMON_LOADED_NORMALIZER2, uprv_loaded_normalizer2_cleanup); LocalPointer localAllModes( Norm2AllModes::createInstance(packageName, name, errorCode)); if(U_SUCCESS(errorCode)) { diff --git a/deps/icu-small/source/common/localsvc.h b/deps/icu-small/source/common/localsvc.h index 4c0686d4495ed9..724216aa64169e 100644 --- a/deps/icu-small/source/common/localsvc.h +++ b/deps/icu-small/source/common/localsvc.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** diff --git a/deps/icu-small/source/common/locavailable.cpp b/deps/icu-small/source/common/locavailable.cpp index 3a92c3c3eb65a3..b3a3346a195995 100644 --- a/deps/icu-small/source/common/locavailable.cpp +++ b/deps/icu-small/source/common/locavailable.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: locavailable.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -35,7 +35,7 @@ U_NAMESPACE_BEGIN static icu::Locale* availableLocaleList = NULL; static int32_t availableLocaleListCount; -static icu::UInitOnce gInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gInitOnceLocale = U_INITONCE_INITIALIZER; U_NAMESPACE_END @@ -50,7 +50,7 @@ static UBool U_CALLCONV locale_available_cleanup(void) availableLocaleList = NULL; } availableLocaleListCount = 0; - gInitOnce.reset(); + gInitOnceLocale.reset(); return TRUE; } @@ -81,7 +81,7 @@ void U_CALLCONV locale_available_init() { const Locale* U_EXPORT2 Locale::getAvailableLocales(int32_t& count) { - umtx_initOnce(gInitOnce, &locale_available_init); + umtx_initOnce(gInitOnceLocale, &locale_available_init); count = availableLocaleListCount; return availableLocaleList; } diff --git a/deps/icu-small/source/common/locbased.cpp b/deps/icu-small/source/common/locbased.cpp index f2f56adda170f0..ff378b4cc78f1d 100644 --- a/deps/icu-small/source/common/locbased.cpp +++ b/deps/icu-small/source/common/locbased.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/locbased.h b/deps/icu-small/source/common/locbased.h index 453d5a8a30299b..6db6a41dc416df 100644 --- a/deps/icu-small/source/common/locbased.h +++ b/deps/icu-small/source/common/locbased.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/locdispnames.cpp b/deps/icu-small/source/common/locdispnames.cpp index bb10b8946b3327..83c7bc30c02703 100644 --- a/deps/icu-small/source/common/locdispnames.cpp +++ b/deps/icu-small/source/common/locdispnames.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: locdispnames.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -542,7 +542,7 @@ uloc_getDisplayName(const char *locale, return 0; } separator = (const UChar *)p0 + subLen; - sepLen = p1 - separator; + sepLen = static_cast(p1 - separator); } if(patLen==0 || (patLen==defaultPatLen && !u_strncmp(pattern, defaultPattern, patLen))) { @@ -558,8 +558,8 @@ uloc_getDisplayName(const char *locale, *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; return 0; } - sub0Pos=p0-pattern; - sub1Pos=p1-pattern; + sub0Pos = static_cast(p0-pattern); + sub1Pos = static_cast(p1-pattern); if (sub1Pos < sub0Pos) { /* a very odd pattern */ int32_t t=sub0Pos; sub0Pos=sub1Pos; sub1Pos=t; langi=1; @@ -821,6 +821,8 @@ uloc_getDisplayKeywordValue( const char* locale, /* get the keyword value */ keywordValue[0]=0; keywordValueLen = uloc_getKeywordValue(locale, keyword, keywordValue, capacity, status); + if (*status == U_STRING_NOT_TERMINATED_WARNING) + *status = U_BUFFER_OVERFLOW_ERROR; /* * if the keyword is equal to currency .. then to get the display name diff --git a/deps/icu-small/source/common/locdspnm.cpp b/deps/icu-small/source/common/locdspnm.cpp index a17478ce6d8a61..6ceb6cfc8bc653 100644 --- a/deps/icu-small/source/common/locdspnm.cpp +++ b/deps/icu-small/source/common/locdspnm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -13,6 +13,7 @@ #include "unicode/locdspnm.h" #include "unicode/simpleformatter.h" +#include "unicode/ucasemap.h" #include "unicode/ures.h" #include "unicode/udisplaycontext.h" #include "unicode/brkiter.h" @@ -53,7 +54,7 @@ static int32_t ncat(char *buffer, uint32_t buflen, ...) { *p = 0; va_end(args); - return p - buffer; + return static_cast(p - buffer); } U_NAMESPACE_BEGIN @@ -635,8 +636,9 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& locale, char value[ULOC_KEYWORD_AND_VALUES_CAPACITY]; // sigh, no ULOC_VALUE_CAPACITY const char* key; while ((key = e->next((int32_t *)0, status)) != NULL) { + value[0] = 0; locale.getKeywordValue(key, value, ULOC_KEYWORD_AND_VALUES_CAPACITY, status); - if (U_FAILURE(status)) { + if (U_FAILURE(status) || status == U_STRING_NOT_TERMINATED_WARNING) { return result; } keyDisplayName(key, temp, TRUE); diff --git a/deps/icu-small/source/common/locid.cpp b/deps/icu-small/source/common/locid.cpp index d2781db95bdd8c..36508acaf5ca70 100644 --- a/deps/icu-small/source/common/locid.cpp +++ b/deps/icu-small/source/common/locid.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -33,6 +33,7 @@ #include "unicode/locid.h" +#include "unicode/strenum.h" #include "unicode/uloc.h" #include "putilimp.h" #include "mutex.h" diff --git a/deps/icu-small/source/common/loclikely.cpp b/deps/icu-small/source/common/loclikely.cpp index 9dcfc90cbd151c..e5876e2ea22773 100644 --- a/deps/icu-small/source/common/loclikely.cpp +++ b/deps/icu-small/source/common/loclikely.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: loclikely.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -22,6 +22,7 @@ #include "unicode/utypes.h" #include "unicode/locid.h" #include "unicode/putil.h" +#include "unicode/uchar.h" #include "unicode/uloc.h" #include "unicode/ures.h" #include "unicode/uscript.h" @@ -510,7 +511,7 @@ parseTagString( unknownLanguage); *langLength = (int32_t)uprv_strlen(lang); } - else if (_isIDSeparator(*position)) { + if (_isIDSeparator(*position)) { ++position; } @@ -1280,7 +1281,7 @@ uloc_minimizeSubtags(const char* localeID, // Pairs of (language subtag, + or -) for finding out fast if common languages // are LTR (minus) or RTL (plus). -static const char* LANG_DIR_STRING = +static const char LANG_DIR_STRING[] = "root-en-es-pt-zh-ja-ko-de-fr-it-ar+he+fa+ru-nl-pl-th-tr-"; // Implemented here because this calls uloc_addLikelySubtags(). @@ -1382,4 +1383,3 @@ ulocimp_getRegionForSupplementalData(const char *localeID, UBool inferRegion, uprv_strncpy(region, rgBuf, regionCapacity); return u_terminateChars(region, regionCapacity, rgLen, status); } - diff --git a/deps/icu-small/source/common/locmap.c b/deps/icu-small/source/common/locmap.cpp similarity index 81% rename from deps/icu-small/source/common/locmap.c rename to deps/icu-small/source/common/locmap.cpp index 1dba67a092a925..029c1edf032a00 100644 --- a/deps/icu-small/source/common/locmap.c +++ b/deps/icu-small/source/common/locmap.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -30,6 +30,7 @@ #include "locmap.h" #include "cstring.h" #include "cmemory.h" +#include "unicode/uloc.h" #if U_PLATFORM == U_PF_WINDOWS && defined(_MSC_VER) && (_MSC_VER >= 1500) /* @@ -40,10 +41,7 @@ * We might need to #include some Windows header and test for some version macro from there. * Or call some Windows function and see what it returns. */ -#define USE_WINDOWS_LOCALE_API -#endif - -#ifdef USE_WINDOWS_LOCALE_API +#define USE_WINDOWS_LCID_MAPPING_API #include #include #endif @@ -53,8 +51,8 @@ * The mapping from Win32 locale ID numbers to POSIX locale strings should * be the faster one. * - * Many LCID values come from winnt.h - * Some also come from http://www.microsoft.com/globaldev/reference/lcid-all.mspx + * Windows LCIDs are defined at https://msdn.microsoft.com/en-us/library/cc233965.aspx + * [MS-LCID] Windows Language Code Identifier (LCID) Reference */ /* @@ -126,7 +124,9 @@ static const ILcidPosixElement locmap_ ## id [] = // Keep static locale variables inside the function so that // it can be created properly during static init. // -// Note: This table should be updated periodically. Check the National Lanaguage Support API Reference Website. +// Note: This table should be updated periodically. Check the [MS-LCID] Windows Language Code Identifier +// (LCID) Reference defined at https://msdn.microsoft.com/en-us/library/cc233965.aspx +// // Microsoft is moving away from LCID in favor of locale name as of Vista. This table needs to be // maintained for support of older Windows version. // Update: Windows 7 (091130) @@ -138,6 +138,9 @@ static const ILcidPosixElement locmap_ ## id [] = //////////////////////////////////////////// */ +// TODO: For Windows ideally this table would be a list of exceptions rather than a complete list as +// LocaleNameToLCID and LCIDToLocaleName provide 90% of these. + ILCID_POSIX_ELEMENT_ARRAY(0x0436, af, af_ZA) ILCID_POSIX_SUBTABLE(ar) { @@ -187,7 +190,10 @@ ILCID_POSIX_ELEMENT_ARRAY(0x0423, be, be_BY) ILCID_POSIX_ELEMENT_ARRAY(0x0402, bg, bg_BG) -ILCID_POSIX_ELEMENT_ARRAY(0x0466, bin, bin_NG) +ILCID_POSIX_SUBTABLE(bin) { + {0x66, "bin"}, + {0x0466, "bin_NG"} +}; ILCID_POSIX_SUBTABLE(bn) { {0x45, "bn"}, @@ -211,8 +217,15 @@ ILCID_POSIX_SUBTABLE(ca) { }; ILCID_POSIX_ELEMENT_ARRAY(0x0483, co, co_FR) -ILCID_POSIX_ELEMENT_ARRAY(0x045c, chr,chr_US) +ILCID_POSIX_SUBTABLE(chr) { + {0x05c, "chr"}, + {0x7c5c, "chr_Cher"}, + {0x045c, "chr_Cher_US"}, + {0x045c, "chr_US"} +}; + +// ICU has chosen different names for these. ILCID_POSIX_SUBTABLE(ckb) { {0x92, "ckb"}, {0x7c92, "ckb_Arab"}, @@ -225,6 +238,7 @@ ILCID_POSIX_ELEMENT_ARRAY(0x0405, cs, cs_CZ) ILCID_POSIX_ELEMENT_ARRAY(0x0452, cy, cy_GB) ILCID_POSIX_ELEMENT_ARRAY(0x0406, da, da_DK) +// Windows doesn't know POSIX or BCP47 Unicode phonebook sort names ILCID_POSIX_SUBTABLE(de) { {0x07, "de"}, {0x0c07, "de_AT"}, @@ -239,6 +253,7 @@ ILCID_POSIX_SUBTABLE(de) { ILCID_POSIX_ELEMENT_ARRAY(0x0465, dv, dv_MV) ILCID_POSIX_ELEMENT_ARRAY(0x0408, el, el_GR) +// Windows uses an empty string for 'invariant' ILCID_POSIX_SUBTABLE(en) { {0x09, "en"}, {0x0c09, "en_AU"}, @@ -256,22 +271,23 @@ ILCID_POSIX_SUBTABLE(en) { {0x4809, "en_SG"}, {0x2C09, "en_TT"}, {0x0409, "en_US"}, - {0x007f, "en_US_POSIX"}, /* duplicate for roundtripping */ - {0x2409, "en_VI"}, /* Virgin Islands AKA Caribbean Islands (en_CB). */ + {0x007f, "en_US_POSIX"}, /* duplicate for round-tripping */ + {0x2409, "en_029"}, {0x1c09, "en_ZA"}, {0x3009, "en_ZW"}, - {0x2409, "en_029"}, - {0x0409, "en_AS"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_GU"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_MH"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_MP"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_UM"} /* Alias for en_US. Leave last. */ + {0x2409, "en_VI"}, /* Virgin Islands AKA Caribbean Islands (en_CB). On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_AS"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_GU"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_MH"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_MP"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_UM"} /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ }; ILCID_POSIX_SUBTABLE(en_US_POSIX) { {0x007f, "en_US_POSIX"} /* duplicate for roundtripping */ }; +// Windows doesn't know POSIX or BCP47 Unicode traditional sort names ILCID_POSIX_SUBTABLE(es) { {0x0a, "es"}, {0x2c0a, "es_AR"}, @@ -297,7 +313,7 @@ ILCID_POSIX_SUBTABLE(es) { {0x200a, "es_VE"}, {0x580a, "es_419"}, {0x040a, "es_ES@collation=traditional"}, - {0x040a, "es@collation=traditional"} + {0x040a, "es@collation=traditional"} // Windows will treat this as es-ES@collation=traditional }; ILCID_POSIX_ELEMENT_ARRAY(0x0425, et, et_EE) @@ -310,6 +326,7 @@ ILCID_POSIX_SUBTABLE(fa) { {0x048c, "fa_AF"} /* Persian/Dari (Afghanistan) */ }; + /* duplicate for roundtripping */ ILCID_POSIX_SUBTABLE(fa_AF) { {0x8c, "fa_AF"}, /* Persian/Dari (Afghanistan) */ @@ -411,7 +428,12 @@ ILCID_POSIX_SUBTABLE(hsb) { ILCID_POSIX_ELEMENT_ARRAY(0x040e, hu, hu_HU) ILCID_POSIX_ELEMENT_ARRAY(0x042b, hy, hy_AM) -ILCID_POSIX_ELEMENT_ARRAY(0x0469, ibb, ibb_NG) + +ILCID_POSIX_SUBTABLE(ibb) { + {0x69, "ibb"}, + {0x0469, "ibb_NG"} +}; + ILCID_POSIX_ELEMENT_ARRAY(0x0421, id, id_ID) ILCID_POSIX_ELEMENT_ARRAY(0x0470, ig, ig_NG) ILCID_POSIX_ELEMENT_ARRAY(0x0478, ii, ii_CN) @@ -450,13 +472,18 @@ ILCID_POSIX_ELEMENT_ARRAY(0x0471, kr, kr_NG) ILCID_POSIX_SUBTABLE(ks) { /* We could add PK and CN too */ {0x60, "ks"}, - {0x0860, "ks_IN"}, /* Documentation doesn't mention script */ {0x0460, "ks_Arab_IN"}, {0x0860, "ks_Deva_IN"} }; ILCID_POSIX_ELEMENT_ARRAY(0x0440, ky, ky_KG) /* Kyrgyz is spoken in Kyrgyzstan */ -ILCID_POSIX_ELEMENT_ARRAY(0x0476, la, la_IT) /* TODO: Verify the country */ + +ILCID_POSIX_SUBTABLE(la) { + {0x76, "la"}, + {0x0476, "la_001"}, + {0x0476, "la_IT"} /*Left in for compatibility*/ +}; + ILCID_POSIX_ELEMENT_ARRAY(0x046e, lb, lb_LU) ILCID_POSIX_ELEMENT_ARRAY(0x0454, lo, lo_LA) ILCID_POSIX_ELEMENT_ARRAY(0x0427, lt, lt_LT) @@ -501,8 +528,9 @@ ILCID_POSIX_SUBTABLE(nl) { }; /* The "no" locale split into nb and nn. By default in ICU, "no" is nb.*/ +// TODO: Not all of these are needed on Windows, but I don't know how ICU treats preferred ones here. ILCID_POSIX_SUBTABLE(no) { - {0x14, "no"}, /* really nb_NO */ + {0x14, "no"}, /* really nb_NO - actually Windows differentiates between neutral (no region) and specific (with region) */ {0x7c14, "nb"}, /* really nb */ {0x0414, "nb_NO"}, /* really nb_NO. Keep first in the 414 list. */ {0x0414, "no_NO"}, /* really nb_NO */ @@ -526,15 +554,19 @@ ILCID_POSIX_SUBTABLE(or_IN) { {0x0448, "or_IN"}, }; - ILCID_POSIX_SUBTABLE(pa) { {0x46, "pa"}, {0x0446, "pa_IN"}, - {0x0846, "pa_PK"}, - {0x0846, "pa_Arab_PK"} + {0x0846, "pa_Arab_PK"}, + {0x0846, "pa_PK"} +}; + +ILCID_POSIX_SUBTABLE(pap) { + {0x79, "pap"}, + {0x0479, "pap_029"}, + {0x0479, "pap_AN"} /*Left in for compatibility*/ }; -ILCID_POSIX_ELEMENT_ARRAY(0x0479, pap, pap_AN) ILCID_POSIX_ELEMENT_ARRAY(0x0415, pl, pl_PL) ILCID_POSIX_ELEMENT_ARRAY(0x0463, ps, ps_AF) @@ -591,6 +623,9 @@ ILCID_POSIX_SUBTABLE(ro) { {0x0818, "ro_MD"} }; +// TODO: This is almost certainly 'wrong'. 0 in Windows is a synonym for LOCALE_USER_DEFAULT. +// More likely this is a similar concept to the Windows 0x7f Invariant locale "" +// (Except that it's not invariant in ICU) ILCID_POSIX_SUBTABLE(root) { {0x00, "root"} }; @@ -607,9 +642,11 @@ ILCID_POSIX_ELEMENT_ARRAY(0x0485, sah,sah_RU) ILCID_POSIX_SUBTABLE(sd) { {0x59, "sd"}, - {0x0459, "sd_IN"}, {0x0459, "sd_Deva_IN"}, - {0x0859, "sd_PK"} + {0x0459, "sd_IN"}, + {0x0859, "sd_Arab_PK"}, + {0x0859, "sd_PK"}, + {0x7c59, "sd_Arab"} }; ILCID_POSIX_SUBTABLE(se) { @@ -633,9 +670,8 @@ ILCID_POSIX_ELEMENT_ARRAY(0x045b, si, si_LK) ILCID_POSIX_ELEMENT_ARRAY(0x041b, sk, sk_SK) ILCID_POSIX_ELEMENT_ARRAY(0x0424, sl, sl_SI) -ILCID_POSIX_SUBTABLE(so) { /* TODO: Verify the country */ +ILCID_POSIX_SUBTABLE(so) { {0x77, "so"}, - {0x0477, "so_ET"}, {0x0477, "so_SO"} }; @@ -727,9 +763,16 @@ ILCID_POSIX_SUBTABLE(ve) { /* TODO: Verify the country */ ILCID_POSIX_ELEMENT_ARRAY(0x042a, vi, vi_VN) ILCID_POSIX_ELEMENT_ARRAY(0x0488, wo, wo_SN) ILCID_POSIX_ELEMENT_ARRAY(0x0434, xh, xh_ZA) -ILCID_POSIX_ELEMENT_ARRAY(0x043d, yi, yi) + +ILCID_POSIX_SUBTABLE(yi) { + {0x003d, "yi"}, + {0x043d, "yi_001"} +}; + ILCID_POSIX_ELEMENT_ARRAY(0x046a, yo, yo_NG) +// Windows & ICU tend to different names for some of these +// TODO: Windows probably does not need all of these entries, but I don't know how the precedence works. ILCID_POSIX_SUBTABLE(zh) { {0x0004, "zh_Hans"}, {0x7804, "zh"}, @@ -753,6 +796,7 @@ ILCID_POSIX_SUBTABLE(zh) { {0x20804,"zh_Hans@collation=stroke"}, {0x20804,"zh_Hans_CN@collation=stroke"}, {0x20804,"zh_CN@collation=stroke"} + // TODO: Alternate collations for other LCIDs are missing, eg: 0x50804 }; ILCID_POSIX_ELEMENT_ARRAY(0x0435, zu, zu_ZA) @@ -991,7 +1035,7 @@ getPosixID(const ILcidPosixMap *this_0, uint32_t hostID) // ///////////////////////////////////// */ -#ifdef USE_WINDOWS_LOCALE_API +#ifdef USE_WINDOWS_LCID_MAPPING_API /* * Various language tags needs to be changed: * quz -> qu @@ -1017,43 +1061,57 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr UBool bLookup = TRUE; const char *pPosixID = NULL; -#ifdef USE_WINDOWS_LOCALE_API +#ifdef USE_WINDOWS_LCID_MAPPING_API + char locName[LOCALE_NAME_MAX_LENGTH] = {}; // ICU name can't be longer than Windows name + // Note: Windows primary lang ID 0x92 in LCID is used for Central Kurdish and // GetLocaleInfo() maps such LCID to "ku". However, CLDR uses "ku" for // Northern Kurdish and "ckb" for Central Kurdish. For this reason, we cannot // use the Windows API to resolve locale ID for this specific case. if ((hostid & 0x3FF) != 0x92) { int32_t tmpLen = 0; - char locName[157]; /* ULOC_FULLNAME_CAPACITY */ + UChar windowsLocaleName[LOCALE_NAME_MAX_LENGTH]; // ULOC_FULLNAME_CAPACITY > LOCALE_NAME_MAX_LENGTH - tmpLen = GetLocaleInfoA(hostid, LOCALE_SNAME, (LPSTR)locName, UPRV_LENGTHOF(locName)); + // Note: LOCALE_ALLOW_NEUTRAL_NAMES was enabled in Windows7+, prior versions did not handle neutral (no-region) locale names. + tmpLen = LCIDToLocaleName(hostid, (PWSTR)windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName), LOCALE_ALLOW_NEUTRAL_NAMES); if (tmpLen > 1) { - /* Windows locale name may contain sorting variant, such as "es-ES_tradnl". - In such case, we need special mapping data found in the hardcoded table - in this source file. */ - char *p = uprv_strchr(locName, '_'); - if (p) { - /* Keep the base locale, without variant */ - *p = 0; - tmpLen = uprv_strlen(locName); - } - else { - /* No hardcoded table lookup necessary */ - bLookup = FALSE; - } - /* Change the tag separator from '-' to '_' */ - p = locName; - while (*p) { - if (*p == '-') { - *p = '_'; + int32_t i = 0; + // Only need to look up in table if have _, eg for de-de_phoneb type alternate sort. + bLookup = FALSE; + for (i = 0; i < UPRV_LENGTHOF(locName); i++) + { + locName[i] = (char)(windowsLocaleName[i]); + + // Windows locale name may contain sorting variant, such as "es-ES_tradnl". + // In such cases, we need special mapping data found in the hardcoded table + // in this source file. + if (windowsLocaleName[i] == L'_') + { + // Keep the base locale, without variant + // TODO: Should these be mapped from _phoneb to @collation=phonebook, etc.? + locName[i] = '\0'; + tmpLen = i; + bLookup = TRUE; + break; + } + else if (windowsLocaleName[i] == L'-') + { + // Windows names use -, ICU uses _ + locName[i] = '_'; + } + else if (windowsLocaleName[i] == L'\0') + { + // No point in doing more work than necessary + break; } - p++; } + // TODO: Need to understand this better, why isn't it an alias? FIX_LANGUAGE_ID_TAG(locName, tmpLen); pPosixID = locName; } } -#endif +#endif // USE_WINDOWS_LCID_MAPPING_API + if (bLookup) { const char *pCandidate = NULL; langID = LANGUAGE_LCID(hostid); @@ -1074,7 +1132,7 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr } if (pPosixID) { - int32_t resLen = uprv_strlen(pPosixID); + int32_t resLen = static_cast(uprv_strlen(pPosixID)); int32_t copyLen = resLen <= posixIDCapacity ? resLen : posixIDCapacity; uprv_memcpy(posixID, pPosixID, copyLen); if (resLen < posixIDCapacity) { @@ -1101,15 +1159,103 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr // POSIX --> LCID // This should only be called from uloc_getLCID. // The locale ID must be in canonical form. -// langID is separate so that this file doesn't depend on the uloc_* API. // ///////////////////////////////////// */ +U_CAPI uint32_t +uprv_convertToLCIDPlatform(const char* localeID) +{ + // The purpose of this function is to leverage native platform name->lcid + // conversion functionality when available. +#ifdef USE_WINDOWS_LCID_MAPPING_API + DWORD nameLCIDFlags = 0; + UErrorCode myStatus = U_ZERO_ERROR; + + // First check for a Windows name->LCID match, fall through to catch + // ICU special cases, but Windows may know it already. +#if LOCALE_ALLOW_NEUTRAL_NAMES + nameLCIDFlags = LOCALE_ALLOW_NEUTRAL_NAMES; +#endif /* LOCALE_ALLOW_NEUTRAL_NAMES */ + + int32_t len; + char collVal[ULOC_KEYWORDS_CAPACITY] = {}; + char baseName[ULOC_FULLNAME_CAPACITY] = {}; + const char * mylocaleID = localeID; + + // Check any for keywords. + if (uprv_strchr(localeID, '@')) + { + len = uloc_getKeywordValue(localeID, "collation", collVal, UPRV_LENGTHOF(collVal) - 1, &myStatus); + if (U_SUCCESS(myStatus) && len > 0) + { + // If it contains the keyword collation, return 0 so that the LCID lookup table will be used. + return 0; + } + else + { + // If the locale ID contains keywords other than collation, just use the base name. + len = uloc_getBaseName(localeID, baseName, UPRV_LENGTHOF(baseName) - 1, &myStatus); + + if (U_SUCCESS(myStatus) && len > 0) + { + baseName[len] = 0; + mylocaleID = baseName; + } + } + } + + char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + // this will change it from de_DE@collation=phonebook to de-DE-u-co-phonebk form + (void)uloc_toLanguageTag(mylocaleID, asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &myStatus); + + if (U_SUCCESS(myStatus)) + { + // Need it to be UTF-16, not 8-bit + wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + int32_t i; + for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++) + { + if (asciiBCP47Tag[i] == '\0') + { + break; + } + else + { + // Copy the character + bcp47Tag[i] = static_cast(asciiBCP47Tag[i]); + } + } + + if (i < (UPRV_LENGTHOF(bcp47Tag) - 1)) + { + // Ensure it's null terminated + bcp47Tag[i] = L'\0'; + LCID lcid = LocaleNameToLCID(bcp47Tag, nameLCIDFlags); + if (lcid > 0) + { + // Found LCID from windows, return that one, unless its completely ambiguous + // LOCALE_USER_DEFAULT and transients are OK because they will round trip + // for this process. + if (lcid != LOCALE_CUSTOM_UNSPECIFIED) + { + return lcid; + } + } + } + } +#else + (void)localeID; // Suppress unused variable warning. +#endif /* USE_WINDOWS_LCID_MAPPING_API */ + + // No found, or not implemented on platforms without native name->lcid conversion + return 0; +} U_CAPI uint32_t uprv_convertToLCID(const char *langID, const char* posixID, UErrorCode* status) { - + // This function does the table lookup when native platform name->lcid conversion isn't available, + // or for locales that don't follow patterns the platform expects. uint32_t low = 0; uint32_t high = gLocaleCount; uint32_t mid; diff --git a/deps/icu-small/source/common/locmap.h b/deps/icu-small/source/common/locmap.h index a9b892ee426fc4..2d7a3d37a04495 100644 --- a/deps/icu-small/source/common/locmap.h +++ b/deps/icu-small/source/common/locmap.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -32,7 +32,8 @@ U_CAPI int32_t uprv_convertToPosix(uint32_t hostid, char* posixID, int32_t posixIDCapacity, UErrorCode* status); -/* Don't call this function directly. Use uloc_getLCID instead. */ +/* Don't call these functions directly. Use uloc_getLCID instead. */ +U_CAPI uint32_t uprv_convertToLCIDPlatform(const char *localeID); // Leverage platform conversion if possible U_CAPI uint32_t uprv_convertToLCID(const char *langID, const char* posixID, UErrorCode* status); #endif /* LOCMAP_H */ diff --git a/deps/icu-small/source/common/locresdata.cpp b/deps/icu-small/source/common/locresdata.cpp index 9ede0cac20bfce..f890411c9affd7 100644 --- a/deps/icu-small/source/common/locresdata.cpp +++ b/deps/icu-small/source/common/locresdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: loclikely.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/locutil.cpp b/deps/icu-small/source/common/locutil.cpp index 2f704953a2d0ca..02d2be50ca25e2 100644 --- a/deps/icu-small/source/common/locutil.cpp +++ b/deps/icu-small/source/common/locutil.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/locutil.h b/deps/icu-small/source/common/locutil.h index 64f7dcc2c052f7..31bfffd7a5920f 100644 --- a/deps/icu-small/source/common/locutil.h +++ b/deps/icu-small/source/common/locutil.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/messageimpl.h b/deps/icu-small/source/common/messageimpl.h index 980f777e8df7b4..dc7a6edd6c0e5f 100644 --- a/deps/icu-small/source/common/messageimpl.h +++ b/deps/icu-small/source/common/messageimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: messageimpl.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/messagepattern.cpp b/deps/icu-small/source/common/messagepattern.cpp index ddd2287e4cabd9..2f79780bd2c233 100644 --- a/deps/icu-small/source/common/messagepattern.cpp +++ b/deps/icu-small/source/common/messagepattern.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: messagepattern.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/msvcres.h b/deps/icu-small/source/common/msvcres.h index 0514ee440ef554..d6581b27ebce51 100644 --- a/deps/icu-small/source/common/msvcres.h +++ b/deps/icu-small/source/common/msvcres.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html //{{NO_DEPENDENCIES}} // Copyright (c) 2003-2010 International Business Machines diff --git a/deps/icu-small/source/common/mutex.h b/deps/icu-small/source/common/mutex.h index 78de718751f9f2..04c22b4a3767b1 100644 --- a/deps/icu-small/source/common/mutex.h +++ b/deps/icu-small/source/common/mutex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/norm2_nfc_data.h b/deps/icu-small/source/common/norm2_nfc_data.h index 4ddba0f8ba64c4..8f5c4346db5ffe 100644 --- a/deps/icu-small/source/common/norm2_nfc_data.h +++ b/deps/icu-small/source/common/norm2_nfc_data.h @@ -1,49 +1,50 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html -/* - * Copyright (C) 1999-2016, International Business Machines - * Corporation and others. All Rights Reserved. - * - * file name: norm2_nfc_data.h - * - * machine-generated by: icu/source/tools/gennorm2/n2builder.cpp - */ +// +// Copyright (C) 1999-2016, International Business Machines +// Corporation and others. All Rights Reserved. +// +// file name: norm2_nfc_data.h +// +// machine-generated by: icu/source/tools/gennorm2/n2builder.cpp + #ifdef INCLUDED_FROM_NORMALIZER2_CPP -static const UVersionInfo norm2_nfc_data_formatVersion={2,0,0,0}; -static const UVersionInfo norm2_nfc_data_dataVersion={9,0,0,0}; +static const UVersionInfo norm2_nfc_data_formatVersion={3,0,0,0}; +static const UVersionInfo norm2_nfc_data_dataVersion={0xa,0,0,0}; static const int32_t norm2_nfc_data_indexes[Normalizer2Impl::IX_COUNT]={ -0x40,0x4bb8,0x880c,0x890c,0x890c,0x890c,0x890c,0x890c,0xc0,0x300,0x56e,0x14e7,0x1e2a,0xfe00,0x941,0 +0x50,0x4cc0,0x8918,0x8a18,0x8a18,0x8a18,0x8a18,0x8a18,0xc0,0x300,0xadc,0x29d0,0x3c56,0xfc00,0x1282,0x3b8c, +0x3c24,0x3c56,0x300,0 }; -static const uint16_t norm2_nfc_data_trieIndex[9652]={ +static const uint16_t norm2_nfc_data_trieIndex[9776]={ 0x2a8,0x2b0,0x2b8,0x2c0,0x2ce,0x2d6,0x2de,0x2e6,0x2ee,0x2f6,0x2fe,0x306,0x30e,0x316,0x31c,0x324, 0x32c,0x334,0x2c7,0x2cf,0x339,0x341,0x2c7,0x2cf,0x349,0x351,0x359,0x361,0x369,0x371,0x379,0x381, 0x389,0x391,0x399,0x3a1,0x3a9,0x3b1,0x3b9,0x3c1,0x2c7,0x2cf,0x2c7,0x2cf,0x3c8,0x3d0,0x3d8,0x3e0, 0x3e4,0x3ec,0x3f2,0x3fa,0x2c7,0x2cf,0x402,0x40a,0x40e,0x416,0x41e,0x426,0x2c7,0x2cf,0x424,0x42c, 0x431,0x438,0x43c,0x2c7,0x2c7,0x2c7,0x443,0x44b,0x2c7,0x453,0x45b,0x2c7,0x2c7,0x463,0x46b,0x2c7, 0x2c7,0x473,0x47b,0x2c7,0x2c7,0x483,0x48b,0x2c7,0x2c7,0x463,0x492,0x2c7,0x49a,0x4a0,0x4a8,0x2c7, -0x2c7,0x2c7,0x4af,0x2c7,0x2c7,0x4b5,0x4bd,0x2c7,0x2c7,0x4a0,0x4c4,0x2c7,0x2c7,0x2c7,0x4ca,0x2c7, -0x2c7,0x4d2,0x4d9,0x2c7,0x2c7,0x4dc,0x4e3,0x2c7,0x4e6,0x4ed,0x4f5,0x4fd,0x505,0x50d,0x514,0x2c7, -0x2c7,0x51b,0x2c7,0x2c7,0x522,0x2c7,0x2c7,0x2c7,0x929,0x2c7,0x2c7,0x931,0x2c7,0x937,0x93f,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x526,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x4af,0x2c7,0x2c7,0x4b5,0x4bd,0x2c7,0x2c7,0x4c3,0x4cb,0x2c7,0x2c7,0x2c7,0x4d1,0x2c7, +0x2c7,0x4d9,0x4e0,0x2c7,0x2c7,0x4e3,0x4ea,0x2c7,0x4ed,0x4f4,0x4fc,0x504,0x50c,0x514,0x51b,0x2c7, +0x2c7,0x522,0x2c7,0x2c7,0x529,0x2c7,0x2c7,0x2c7,0x93b,0x2c7,0x2c7,0x943,0x2c7,0x949,0x951,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x52d,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x52e,0x52e,0x2c7,0x2c7,0x2c7,0x2c7,0x534,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x53c,0x2c7,0x2c7,0x2c7,0x53f,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x546,0x2c7,0x2c7,0x54e,0x2c7,0x556,0x2c7,0x2c7,0x55e,0x563,0x56b,0x571,0x2c7,0x577,0x2c7,0x57e, -0x2c7,0x583,0x2c7,0x2c7,0x2c7,0x2c7,0x589,0x591,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x599,0x59e, -0x5a6,0x5ae,0x5b6,0x5be,0x5c6,0x5ce,0x5d6,0x5de,0x5e6,0x5ee,0x5f6,0x5fe,0x606,0x60e,0x616,0x61e, -0x626,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x62a,0x632,0x2c7,0x639,0x2c7,0x2c7,0x63d,0x644,0x649,0x2c7, -0x651,0x659,0x661,0x669,0x671,0x679,0x2c7,0x681,0x2c7,0x687,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x535,0x535,0x2c7,0x2c7,0x2c7,0x2c7,0x53b,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x543,0x2c7,0x2c7,0x2c7,0x546,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x54d,0x2c7,0x2c7,0x555,0x2c7,0x55d,0x2c7,0x2c7,0x565,0x56a,0x572,0x578,0x2c7,0x57e,0x2c7,0x585, +0x2c7,0x58a,0x2c7,0x2c7,0x2c7,0x2c7,0x590,0x598,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x5a0,0x5a5, +0x5ad,0x5b5,0x5bd,0x5c5,0x5cd,0x5d5,0x5dd,0x5e5,0x5ed,0x5f5,0x5fd,0x605,0x60d,0x615,0x61d,0x625, +0x62d,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x631,0x639,0x2c7,0x640,0x2c7,0x2c7,0x644,0x64b,0x650,0x2c7, +0x658,0x660,0x668,0x670,0x678,0x680,0x2c7,0x688,0x2c7,0x68e,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x68a,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x692,0x2c7,0x2c7,0x2c7,0x697,0x2c7,0x2c7,0x2c7,0x69f, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x691,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x699,0x2c7,0x2c7,0x2c7,0x69e,0x2c7,0x2c7,0x2c7,0x6a6, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x6a7,0x6ae,0x6b6,0x6be,0x6c6,0x6ce,0x6d6,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x6ae,0x6b5,0x6bd,0x6c5,0x6cd,0x6d5,0x6dd,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, @@ -102,32 +103,32 @@ static const uint16_t norm2_nfc_data_trieIndex[9652]={ 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x6de,0x6e6,0x2c7,0x2c7,0x6ee,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x6f5,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x6fc,0x704,0x2c7,0x70a,0x70e,0x2c7,0x2c7,0x584,0x716,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x71a,0x722,0x725,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x48b, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947, -0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x947,0x94e,0x2c7,0x2c7, -0x956,0x95d,0x2a8,0x964,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8, +0x2c7,0x2c7,0x2c7,0x6e5,0x6ed,0x2c7,0x2c7,0x6f5,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x6fc,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x703,0x70b,0x2c7,0x711,0x715,0x2c7,0x2c7,0x58b,0x71d,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x721,0x729,0x72c,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x48b, +0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a, +0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c, +0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e, +0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959, +0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b, +0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d, +0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d, +0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a, +0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c, +0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e, +0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959, +0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b, +0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d, +0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d, +0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a, +0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c, +0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e, +0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959, +0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b, +0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d, +0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d, +0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x96d,0x959,0x95a,0x95b,0x95c,0x95d,0x95e,0x965,0x2c7,0x2c7, +0x975,0x97c,0x2a8,0x983,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8, 0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8,0x2a8, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, @@ -143,489 +144,496 @@ static const uint16_t norm2_nfc_data_trieIndex[9652]={ 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x72d,0x735,0x73d,0x745,0x74d,0x755,0x75d,0x765, -0x76d,0x775,0x77d,0x785,0x78d,0x795,0x79d,0x2c7,0x7a4,0x7ac,0x7b4,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x734,0x73c,0x744,0x74c,0x754,0x75c,0x764,0x76c, +0x774,0x77c,0x784,0x78c,0x794,0x79c,0x7a4,0x2c7,0x7ab,0x7b3,0x7bb,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x7bc,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x7c3,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, 0xb20,0xb20,0xb38,0xb78,0xbb8,0xbf8,0xc38,0xc70,0xcb0,0xb1c,0xce4,0xb1c,0xd24,0xd64,0xda4,0xde4, 0xe24,0xe64,0xea4,0xee4,0xb1c,0xb1c,0xf20,0xf60,0xf90,0xfc8,0xb1c,0x1008,0x1038,0x1078,0xb1c,0x1090, -0x880,0x8b0,0x8ee,0x928,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x951,0x188,0x188, -0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x96d,0x188,0x188,0x9a3,0x188,0x9e3,0xa1d,0x188,0x188, +0x880,0x8b0,0x8ee,0x928,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x953,0x188,0x188, +0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x96f,0x188,0x188,0x9a5,0x188,0x9e5,0xa1f,0x188,0x188, 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, -0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xa5d, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x7c0, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x7c8,0x2c7,0x2c7,0x2c7,0x7cb,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x7d2,0x7d6,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x7de,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x6f5,0x697,0x7e0,0x7e8,0x2c7,0x2c7,0x7f0,0x7f7,0x2c7,0x584,0x2c7,0x2c7,0x7ff,0x2c7,0x2c7,0x802, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x808,0x2c7,0x463,0x80f,0x816,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x81e,0x2c7,0x2c7,0x822,0x82a,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x82f,0x837,0x2c7,0x2c7,0x697, -0x2c7,0x2c7,0x2c7,0x83a,0x2c7,0x2c7,0x2c7,0x840,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x697,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x844,0x2c7,0x84a,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x850,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x858,0x860,0x868, -0x86e,0x876,0x2c7,0x2c7,0x2c7,0x87e,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x886,0x88e,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x892,0x2c7,0x2c7,0x2c7,0x899,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x8a1,0x8a9,0x8b1, -0x8b9,0x8c1,0x8c9,0x8d1,0x8d9,0x8e1,0x8e9,0x8f1,0x8f9,0x901,0x909,0x911,0x919,0x921,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, -0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2a7,0x2a7,0x2a7, -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,2,4,6,0, -0,8,0x28,0x2e,0x38,0x44,0x66,0x68,0x76,0x84,0xa2,0xa4,0xae,0xba,0xc0,0xd2, -0xf2,0,0xf6,0x106,0x114,0x122,0x148,0x14c,0x158,0x15c,0x16e,0,0,0,0,0, -0,0x17a,0x19a,0x1a0,0x1aa,0x1b6,0x1d8,0x1da,0x1e8,0x1f8,0x214,0x218,0x222,0x22e,0x234,0x246, -0x266,0,0x26a,0x27a,0x288,0x298,0x2be,0x2c2,0x2d0,0x2d4,0x2e8,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,0,0,0,0,0, -0x2f4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x941,0x944,0x56f,0x947,0x57a,0x57f,0x2fa,0x584, -0x94a,0x94d,0x589,0x950,0x953,0x956,0x959,0x594,0,0x95c,0x95f,0x962,0x599,0x5a4,0x5ad,0, -0x2fe,0x965,0x968,0x96b,0x5b2,0x96e,0,0,0x971,0x974,0x5bd,0x977,0x5c8,0x5cd,0x300,0x5d2, -0x97a,0x97d,0x5d7,0x980,0x983,0x986,0x989,0x5e2,0,0x98c,0x98f,0x992,0x5e7,0x5f2,0x5fb,0, -0x304,0x995,0x998,0x99b,0x600,0x99e,0,0x9a1,0x9a4,0x9a7,0x60b,0x616,0x9aa,0x9ad,0x9b0,0x9b3, -0x9b6,0x9b9,0x9bc,0x9bf,0x9c2,0x9c5,0x9c8,0x9cb,0,0,0x621,0x628,0x9ce,0x9d1,0x9d4,0x9d7, -0x9da,0x9dd,0x9e0,0x9e3,0x9e6,0x9e9,0x9ec,0x9ef,0x9f2,0x9f5,0x9f8,0x9fb,0x9fe,0xa01,0,0, -0xa04,0xa07,0xa0a,0xa0d,0xa10,0xa13,0xa16,0xa19,0xa1c,0,0,0,0xa1f,0xa22,0xa25,0xa28, -0,0xa2b,0xa2e,0xa31,0xa34,0xa37,0xa3a,0,0,0,0,0xa3d,0xa40,0xa43,0xa46,0xa49, -0xa4c,0,0,0,0x62f,0x636,0xa4f,0xa52,0xa55,0xa58,0,0,0xa5b,0xa5e,0xa61,0xa64, -0xa67,0xa6a,0x63d,0x642,0xa6d,0xa70,0xa73,0xa76,0x647,0x64c,0xa79,0xa7c,0xa7f,0xa82,0,0, -0x651,0x656,0x65b,0x660,0xa85,0xa88,0xa8b,0xa8e,0xa91,0xa94,0xa97,0xa9a,0xa9d,0xaa0,0xaa3,0xaa6, -0xaa9,0xaac,0xaaf,0xab2,0xab5,0xab8,0xabb,0x306,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,0x665,0x672,0,0,0,0,0,0, -0,0,0,0,0,0,0,0x67f,0x68c,0,0,0,0,0,0,0x308, -0,0,0,0,0,0,0,0,0,0,0,0,0,0xabe,0xac1,0xac4, -0xac7,0xaca,0xacd,0xad0,0xad3,0xad7,0xadc,0xae1,0xae6,0xaeb,0xaf0,0xaf5,0xafa,0,0xaff,0xb04, -0xb09,0xb0e,0xb12,0xb15,0,0,0xb18,0xb1b,0xb1e,0xb21,0x699,0x69e,0xb25,0xb2a,0xb2e,0xb31, -0xb34,0,0,0,0xb37,0xb3a,0,0,0xb3d,0xb40,0xb44,0xb49,0xb4d,0xb50,0xb53,0xb56, -0xb59,0xb5c,0xb5f,0xb62,0xb65,0xb68,0xb6b,0xb6e,0xb71,0xb74,0xb77,0xb7a,0xb7d,0xb80,0xb83,0xb86, -0xb89,0xb8c,0xb8f,0xb92,0xb95,0xb98,0xb9b,0xb9e,0xba1,0xba4,0xba7,0xbaa,0,0,0xbad,0xbb0, -0,0,0,0,0,0,0x6a3,0x6a8,0x6ad,0x6b2,0xbb4,0xbb9,0xbbe,0xbc3,0x6b7,0x6bc, -0xbc8,0xbcd,0xbd1,0xbd4,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0x30a,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,0xfee6,0xfee6,0xfee6,0xfee6,0xfee6,0xffe6,0xfee6,0xfee6,0xfee6,0xfee6,0xfee6,0xfee6, -0xfee6,0xffe6,0xffe6,0xfee6,0xffe6,0xfee6,0xffe6,0xfee6,0xfee6,0xffe8,0xffdc,0xffdc,0xffdc,0xffdc,0xffe8,0xfed8, -0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffca,0xffca,0xfedc,0xfedc,0xfedc,0xfedc,0xfeca,0xfeca,0xffdc,0xffdc,0xffdc, -0xffdc,0xfedc,0xfedc,0xffdc,0xfedc,0xfedc,0xffdc,0xffdc,0xff01,0xff01,0xff01,0xff01,0xfe01,0xffdc,0xffdc,0xffdc, -0xffdc,0xffe6,0xffe6,0xffe6,0x14e8,0x14eb,0xfee6,0x14ee,0x14f1,0xfef0,0xffe6,0xffdc,0xffdc,0xffdc,0xffe6,0xffe6, -0xffe6,0xffdc,0xffdc,0,0xffe6,0xffe6,0xffe6,0xffdc,0xffdc,0xffdc,0xffdc,0xffe6,0xffe8,0xffdc,0xffdc,0xffe6, -0xffe9,0xffea,0xffea,0xffe9,0xffea,0xffea,0xffe9,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0,0x14f4,0,0,0,0,0,0,0, -0,0,0x14f6,0,0,0,0,0,0,0xbd7,0xbda,0x14f8,0xbdd,0xbe0,0xbe3,0, -0xbe6,0,0xbe9,0xbec,0xbf0,0x30c,0,0,0,0x31a,0,0x322,0,0x32c,0,0, -0,0,0,0x33a,0,0x342,0,0,0,0x344,0,0,0,0x350,0xbf4,0xbf7, -0x6c1,0xbfa,0x6c6,0xbfd,0xc01,0x35a,0,0,0,0x36a,0,0x372,0,0x37e,0,0, -0,0,0,0x38e,0,0x396,0,0,0,0x39a,0,0,0,0x3aa,0x6cb,0x6d4, -0xc05,0xc08,0x6dd,0,0,0,0x3b6,0xc0b,0xc0e,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,0xc11,0xc14,0,0xc17,0,0,0x3ba,0xc1a,0,0,0,0, -0xc1d,0xc20,0xc23,0,0x3bc,0,0,0x3c0,0,0x3c2,0x3c8,0x3cc,0x3ce,0xc26,0x3d6,0, -0,0,0x3d8,0,0,0,0,0x3da,0,0,0,0x3e2,0,0,0,0x3e4, -0,0x3e6,0,0,0x3e8,0,0,0x3ec,0,0x3ee,0x3f4,0x3f8,0x3fa,0xc29,0x402,0, -0,0,0x404,0,0,0,0,0x406,0,0,0,0x40e,0,0,0,0x410, -0,0x412,0,0,0xc2c,0xc2f,0,0xc32,0,0,0x414,0xc35,0,0,0,0, -0xc38,0xc3b,0xc3e,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x416,0x418,0xc41,0xc44,0,0,0,0, -0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,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,0xc47,0xc4a,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xc4d,0xc50,0xc53,0xc56,0,0,0xc59,0xc5c,0x41a,0x41c,0xc5f,0xc62, -0xc65,0xc68,0xc6b,0xc6e,0,0,0xc71,0xc74,0xc77,0xc7a,0xc7d,0xc80,0x41e,0x420,0xc83,0xc86, -0xc89,0xc8c,0xc8f,0xc92,0xc95,0xc98,0xc9b,0xc9e,0xca1,0xca4,0,0,0xca7,0xcaa,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0xffdc,0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffe6,0xffde,0xffdc,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffde,0xffe4,0xffe6, -0xff0a,0xff0b,0xff0c,0xff0d,0xff0e,0xff0f,0xff10,0xff11,0xff12,0xff13,0xff13,0xff14,0xff15,0xff16,0,0xff17, -0,0xff18,0xff19,0,0xffe6,0xffdc,0,0xff12,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, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xff1e,0xff1f,0xff20,0,0,0,0,0, -0,0,0xcad,0xcb0,0xcb3,0xcb6,0xcb9,0x422,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x428,0,0x42a,0xff1b,0xff1c,0xff1d,0xff1e,0xff1f,0xff20,0xff21,0xff22,0xfee6,0xfee6,0xfedc,0xffdc,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffdc,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xff23,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xcbc,0x42c,0xcbf,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x42e,0xcc2,0,0x430,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffe6,0,0,0xffe6, -0xffe6,0,0xffdc,0xffe6,0xffe6,0xffdc,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xff24,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,0xffe6,0xffdc,0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffdc, -0xffdc,0xffdc,0xffe6,0xffdc,0xffdc,0xffe6,0xffdc,0xffe6,0xffe6,0xffe6,0xffdc,0xffe6,0xffdc,0xffe6,0xffdc,0xffe6, -0xffdc,0xffe6,0xffe6,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,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffdc,0xffe6,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0,0xffe6,0xffe6,0xffe6,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,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,0xffdc,0xffdc,0xffdc,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0xffdc, -0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffe6,0xffdc,0xffdc,0xffdc,0xff1b,0xff1c,0xff1d,0xffe6, -0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffdc,0xffdc,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0, -0,0,0,0,0x432,0xcc5,0,0,0,0,0,0,0x434,0xcc8,0,0x436, -0xccb,0,0,0,0,0,0,0,0xfe07,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xff09,0,0,0,0xffe6,0xffdc,0xffe6, -0xffe6,0,0,0,0x14fa,0x14fd,0x1500,0x1503,0x1506,0x1509,0x150c,0x150f,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,0xff07,0,0xfe00,0,0,0,0,0, -0,0,0,0x438,0,0,0,0xcce,0xcd1,0xff09,0,0,0,0,0,0, -0,0,0,0xfe00,0,0,0,0,0x1512,0x1515,0,0x1518,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x151b, -0,0,0x151e,0,0,0,0,0,0xff07,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xff09,0,0,0,0,0,0, -0,0,0,0,0,0x1521,0x1524,0x1527,0,0,0x152a,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,0xff07,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xff09,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x43c, -0xcd4,0,0,0xcd7,0xcda,0xff09,0,0,0,0,0,0,0,0,0xfe00,0xfe00, -0,0,0,0,0x152d,0x1530,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x442,0,0xcdd,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,0xfe00,0, -0,0,0,0,0,0,0x444,0x448,0,0,0xce0,0xce3,0xce6,0xff09,0,0, -0,0,0,0,0,0,0,0xfe00,0,0,0,0,0,0,0,0, -0,0,0x44a,0,0xce9,0,0,0,0,0xff09,0,0,0,0,0,0, -0,0xff54,0xfe5b,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, -0xff07,0,0,0x44c,0xcec,0,0xfe00,0,0,0,0x44e,0xcef,0xcf2,0,0x6e2,0xcf6, -0,0xff09,0,0,0,0,0,0,0,0xfe00,0xfe00,0,0,0,0,0, -0,0,0,0,0,0,0x454,0x458,0,0,0xcfa,0xcfd,0xd00,0xff09,0,0, -0,0,0,0,0,0,0,0xfe00,0,0,0,0,0,0,0,0, -0,0,0xfe09,0,0,0,0,0xfe00,0,0,0,0,0,0,0,0, -0,0x45a,0xd03,0,0x6e7,0xd07,0xd0b,0xfe00,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xff67,0xff67,0xff09,0,0,0,0,0,0,0,0,0,0xff6b,0xff6b,0xff6b,0xff6b, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xff76,0xff76,0,0,0,0,0,0, -0,0,0,0,0xff7a,0xff7a,0xff7a,0xff7a,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xffdc,0xffdc,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xffdc,0,0xffdc,0,0xffd8,0,0, -0,0,0,0,0,0,0,0x1533,0,0,0,0,0,0,0,0, -0,0x1536,0,0,0,0,0x1539,0,0,0,0,0x153c,0,0,0,0, -0x153f,0,0,0,0,0,0,0,0,0,0,0,0,0x1542,0,0, -0,0,0,0,0,0xff81,0xff82,0x1546,0xff84,0x154a,0x154d,0,0x1550,0,0xff82,0xff82, -0xff82,0xff82,0,0,0xff82,0x1554,0xffe6,0xffe6,0xff09,0,0xffe6,0xffe6,0,0,0,0, -0,0,0,0,0,0,0,0x1557,0,0,0,0,0,0,0,0, -0,0x155a,0,0,0,0,0x155d,0,0,0,0,0x1560,0,0,0,0, -0x1563,0,0,0,0,0,0,0,0,0,0,0,0,0x1566,0,0, -0,0,0,0,0,0,0xffdc,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,0x460,0xd0e,0,0,0,0,0,0,0,0xfe00,0,0,0,0,0, -0,0,0,0xff07,0,0xff09,0xff09,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xffdc,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,0xffe6,0xffe6,0xffe6,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xff09,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0xff09,0,0,0,0,0,0,0,0,0,0,0xffe6,0,0, -0,0,0,0,0,0,0,0,0,0xffe4,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,0xffde,0xffe6,0xffdc,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xffe6, -0xffdc,0,0,0,0,0,0,0,0xff09,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0xffdc,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffdc,0xffdc, -0xffdc,0xffdc,0xffdc,0xffe6,0xffe6,0xffdc,0,0,0,0,0,0,0,0x462,0xd11,0x464, -0xd14,0x466,0xd17,0x468,0xd1a,0x46a,0xd1d,0,0,0x46c,0xd20,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xff07,0xfe00,0,0,0,0,0x46e,0xd23,0x470,0xd26,0x472,0x474,0xd29,0xd2c,0x476,0xd2f, -0xff09,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,0xffe6, -0xffdc,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0xff09,0xff09,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xff07,0, -0,0,0,0,0,0,0,0,0,0,0xff09,0xff09,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0xff07,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xffe6,0xffe6,0xffe6,0,0xff01,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffe6,0xffe6, -0xffdc,0xffdc,0xffdc,0xffdc,0xffe6,0,0xff01,0xff01,0xff01,0xff01,0xff01,0xff01,0xff01,0,0,0, -0,0xffdc,0,0,0,0,0,0,0xffe6,0,0,0,0xffe6,0xffe6,0,0, -0,0,0,0,0xffe6,0xffe6,0xffdc,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffe6, -0xffe6,0xffea,0xffd6,0xffdc,0xffca,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0, -0,0,0,0xffe6,0xffe9,0xffdc,0xffe6,0xffdc,0xd32,0xd35,0xd38,0xd3b,0xd3e,0xd41,0xd44,0xd47, -0xd4b,0xd50,0xd54,0xd57,0xd5a,0xd5d,0xd60,0xd63,0xd66,0xd69,0xd6c,0xd6f,0xd73,0xd78,0xd7d,0xd82, -0xd86,0xd89,0xd8c,0xd8f,0xd93,0xd98,0xd9c,0xd9f,0xda2,0xda5,0xda8,0xdab,0xdae,0xdb1,0xdb4,0xdb7, -0xdba,0xdbd,0xdc0,0xdc3,0xdc6,0xdc9,0xdcd,0xdd2,0xdd6,0xdd9,0xddc,0xddf,0xde2,0xde5,0x6ec,0x6f1, -0xde9,0xdee,0xdf2,0xdf5,0xdf8,0xdfb,0xdfe,0xe01,0xe04,0xe07,0xe0a,0xe0d,0xe10,0xe13,0xe16,0xe19, -0xe1c,0xe1f,0xe22,0xe25,0xe29,0xe2e,0xe33,0xe38,0xe3d,0xe42,0xe47,0xe4c,0xe50,0xe53,0xe56,0xe59, -0xe5c,0xe5f,0x6f6,0x6fb,0xe63,0xe68,0xe6c,0xe6f,0xe72,0xe75,0x700,0x705,0xe79,0xe7e,0xe83,0xe88, -0xe8d,0xe92,0xe96,0xe99,0xe9c,0xe9f,0xea2,0xea5,0xea8,0xeab,0xeae,0xeb1,0xeb4,0xeb7,0xeba,0xebd, -0xec1,0xec6,0xecb,0xed0,0xed4,0xed7,0xeda,0xedd,0xee0,0xee3,0xee6,0xee9,0xeec,0xeef,0xef2,0xef5, -0xef8,0xefb,0xefe,0xf01,0xf04,0xf07,0xf0a,0xf0d,0xf10,0xf13,0xf16,0xf19,0xf1c,0xf1f,0xf22,0xf25, -0xf28,0xf2b,0,0xf2e,0,0,0,0,0x70a,0x711,0xf31,0xf34,0xf38,0xf3d,0xf42,0xf47, -0xf4c,0xf51,0xf56,0xf5b,0xf60,0xf65,0xf6a,0xf6f,0xf74,0xf79,0xf7e,0xf83,0xf88,0xf8d,0xf92,0xf97, -0x718,0x71d,0xf9b,0xf9e,0xfa1,0xfa4,0xfa8,0xfad,0xfb2,0xfb7,0xfbc,0xfc1,0xfc6,0xfcb,0xfd0,0xfd5, -0xfd9,0xfdc,0xfdf,0xfe2,0x722,0x727,0xfe5,0xfe8,0xfec,0xff1,0xff6,0xffb,0x1000,0x1005,0x100a,0x100f, -0x1014,0x1019,0x101e,0x1023,0x1028,0x102d,0x1032,0x1037,0x103c,0x1041,0x1046,0x104b,0x104f,0x1052,0x1055,0x1058, -0x105c,0x1061,0x1066,0x106b,0x1070,0x1075,0x107a,0x107f,0x1084,0x1089,0x108d,0x1090,0x1093,0x1096,0x1099,0x109c, -0x109f,0x10a2,0,0,0,0,0,0,0x72c,0x737,0x743,0x74a,0x751,0x758,0x75f,0x766, -0x76c,0x777,0x783,0x78a,0x791,0x798,0x79f,0x7a6,0x7ac,0x7b3,0x10a6,0x10ab,0x10b0,0x10b5,0,0, -0x7ba,0x7c1,0x10ba,0x10bf,0x10c4,0x10c9,0,0,0x7c8,0x7d3,0x7df,0x7e6,0x7ed,0x7f4,0x7fb,0x802, -0x808,0x813,0x81f,0x826,0x82d,0x834,0x83b,0x842,0x848,0x851,0x10ce,0x10d3,0x10d8,0x10dd,0x10e2,0x10e7, -0x85a,0x863,0x10ec,0x10f1,0x10f6,0x10fb,0x1100,0x1105,0x86c,0x873,0x110a,0x110f,0x1114,0x1119,0,0, -0x87a,0x881,0x111e,0x1123,0x1128,0x112d,0,0,0x888,0x891,0x1132,0x1137,0x113c,0x1141,0x1146,0x114b, -0,0x89a,0,0x1150,0,0x1155,0,0x115a,0x8a3,0x8ae,0x8ba,0x8c1,0x8c8,0x8cf,0x8d6,0x8dd, -0x8e3,0x8ee,0x8fa,0x901,0x908,0x90f,0x916,0x91d,0x923,0x156a,0x115e,0x156e,0x928,0x1572,0x1161,0x1576, -0x1164,0x157a,0x1167,0x157e,0x92d,0x1582,0,0,0x116b,0x1170,0x1177,0x117f,0x1187,0x118f,0x1197,0x119f, -0x11a5,0x11aa,0x11b1,0x11b9,0x11c1,0x11c9,0x11d1,0x11d9,0x11df,0x11e4,0x11eb,0x11f3,0x11fb,0x1203,0x120b,0x1213, -0x1219,0x121e,0x1225,0x122d,0x1235,0x123d,0x1245,0x124d,0x1253,0x1258,0x125f,0x1267,0x126f,0x1277,0x127f,0x1287, -0x128d,0x1292,0x1299,0x12a1,0x12a9,0x12b1,0x12b9,0x12c1,0x12c6,0x12c9,0x12cd,0x12d1,0x12d5,0,0x932,0x12da, -0x12de,0x12e1,0x12e4,0x1586,0x12e7,0,0x1589,0x478,0,0x12ea,0x12ee,0x12f2,0x12f6,0,0x937,0x12fb, -0x12ff,0x158c,0x1302,0x1590,0x1305,0x1308,0x130b,0x130e,0x1311,0x1314,0x1318,0x1595,0,0,0x131c,0x1320, -0x1324,0x1327,0x132a,0x159a,0,0x132d,0x1330,0x1333,0x1336,0x1339,0x133d,0x159f,0x1341,0x1344,0x1347,0x134b, -0x134f,0x1352,0x1355,0x15a4,0x1358,0x135b,0x15a8,0x15ab,0,0,0x135f,0x1363,0x1367,0,0x93c,0x136c, -0x1370,0x15ae,0x1373,0x15b2,0x1376,0x15b5,0x47e,0,0xfdc1,0xfdc1,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,0xffe6,0xffe6,0xff01,0xff01,0xffe6,0xffe6,0xffe6,0xffe6, -0xff01,0xff01,0xff01,0xffe6,0xffe6,0,0,0,0,0xffe6,0,0,0,0xff01,0xff01,0xffe6, -0xffdc,0xffe6,0xff01,0xff01,0xffdc,0xffdc,0xffdc,0xffdc,0xffe6,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x15b7,0,0,0,0x15b9,0x15bc, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x484,0,0x486,0,0x488,0,0,0,0,0,0x1379,0x137c, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x137f,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0x1382,0x1385,0x1388,0x48a,0,0x48c,0,0x48e,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0x490,0x138b,0,0,0,0x492,0x138e,0,0x494, -0x1391,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0x496,0x1394,0x498,0x1397,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x49a,0,0,0,0,0x139a,0,0x49c,0x139d,0x49e,0,0x13a0,0x4a0,0x13a3,0,0, -0,0x4a2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x13a6,0x4a4,0x13a9,0,0x4a6,0x4a8,0,0,0,0,0,0, -0,0x13ac,0x13af,0x13b2,0x13b5,0x13b8,0x4aa,0x4ac,0x13bb,0x13be,0x4ae,0x4b0,0x13c1,0x13c4,0x4b2,0x4b4, -0x4b6,0x4b8,0,0,0x13c7,0x13ca,0x4ba,0x4bc,0x13cd,0x13d0,0x4be,0x4c0,0x13d3,0x13d6,0,0, -0,0,0,0,0,0x4c2,0x4c4,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0x4c6,0,0,0,0,0,0x4c8,0x4ca,0,0x4cc, -0x13d9,0x13dc,0x13df,0x13e2,0,0,0x4ce,0x4d0,0x4d2,0x4d4,0,0,0,0,0,0, -0,0,0,0,0x13e5,0x13e8,0x13eb,0x13ee,0,0,0,0,0,0,0x13f1,0x13f4, -0x13f7,0x13fa,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0x15bf,0x15c1,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,0x15c3,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6,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,0xff09,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0, -0,0,0,0,0,0,0xffda,0xffe4,0xffe8,0xffde,0xffe0,0xffe0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x4d6,0, -0,0,0,0x4d8,0x13fd,0x4da,0x1400,0x4dc,0x1403,0x4de,0x1406,0x4e0,0x1409,0x4e2,0x140c,0x4e4, -0x140f,0x4e6,0x1412,0x4e8,0x1415,0x4ea,0x1418,0x4ec,0x141b,0x4ee,0x141e,0,0x4f0,0x1421,0x4f2,0x1424, -0x4f4,0x1427,0,0,0,0,0,0x4f6,0x142a,0x142d,0x4fa,0x1430,0x1433,0x4fe,0x1436,0x1439, -0x502,0x143c,0x143f,0x506,0x1442,0x1445,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1448,0,0,0, -0,0xfe08,0xfe08,0,0,0x50a,0x144b,0,0,0,0,0,0,0,0x50c,0, -0,0,0,0x50e,0x144e,0x510,0x1451,0x512,0x1454,0x514,0x1457,0x516,0x145a,0x518,0x145d,0x51a, -0x1460,0x51c,0x1463,0x51e,0x1466,0x520,0x1469,0x522,0x146c,0x524,0x146f,0,0x526,0x1472,0x528,0x1475, -0x52a,0x1478,0,0,0,0,0,0x52c,0x147b,0x147e,0x530,0x1481,0x1484,0x534,0x1487,0x148a, -0x538,0x148d,0x1490,0x53c,0x1493,0x1496,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0x540,0x542,0x544,0x546,0,0x1499,0,0,0x149c, -0x149f,0x14a2,0x14a5,0,0,0x548,0x14a8,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0xffe6,0,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,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,0xffe6,0xffe6,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xffe6,0xffe6,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0xff09,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,0xff09,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, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0xffe6,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0xffdc,0xffdc,0xffdc,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xff09,0,0,0,0, -0,0,0,0,0,0,0,0,0xff09,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,0xffe6,0,0xffe6,0xffe6,0xffdc,0,0,0xffe6, -0xffe6,0,0,0,0,0,0xffe6,0xffe6,0,0xffe6,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,0xff09,0,0,0,0,0, -0,0,0,0,0x15c6,0x15c8,0x15ca,0x15cc,0x15ce,0x15d0,0x15d2,0x15d4,0x15d4,0x15d6,0x15d8,0x15da, -0x15dc,0x15de,0x15e0,0x15e2,0x15e4,0x15e6,0x15e8,0x15ea,0x15ec,0x15ee,0x15f0,0x15f2,0x15f4,0x15f6,0x15f8,0x15fa, -0x15fc,0x15fe,0x1600,0x1602,0x1604,0x1606,0x1608,0x160a,0x160c,0x160e,0x1610,0x1612,0x1614,0x1616,0x1618,0x161a, -0x161c,0x161e,0x1620,0x1622,0x1624,0x1626,0x1628,0x162a,0x162c,0x162e,0x1630,0x1632,0x1634,0x1636,0x1638,0x163a, -0x163c,0x163e,0x1640,0x1642,0x1644,0x1646,0x1648,0x164a,0x164c,0x164e,0x1650,0x1652,0x1654,0x1656,0x1658,0x165a, -0x165c,0x165e,0x1660,0x1662,0x1664,0x1666,0x1668,0x166a,0x166c,0x166e,0x1670,0x1672,0x1674,0x1676,0x1678,0x167a, -0x15ec,0x167c,0x167e,0x1680,0x1682,0x1684,0x1686,0x1688,0x168a,0x168c,0x168e,0x1690,0x1692,0x1694,0x1696,0x1698, -0x169a,0x169c,0x169e,0x16a0,0x16a2,0x16a4,0x16a6,0x16a8,0x16aa,0x16ac,0x16ae,0x16b0,0x16b2,0x16b4,0x16b6,0x16b8, -0x16ba,0x16bc,0x16be,0x16c0,0x16c2,0x16c4,0x16c6,0x16c8,0x16ca,0x16cc,0x16ce,0x16d0,0x16d2,0x16d4,0x16d6,0x16d8, -0x16da,0x16dc,0x16de,0x16e0,0x16e2,0x16e4,0x16e6,0x16e8,0x16ea,0x16ec,0x16ee,0x16f0,0x16f2,0x16f4,0x16f6,0x16f8, -0x16fa,0x16fc,0x16fe,0x1700,0x1702,0x16a0,0x1704,0x1706,0x1708,0x170a,0x170c,0x170e,0x1710,0x1712,0x1680,0x1714, -0x1716,0x1718,0x171a,0x171c,0x171e,0x1720,0x1722,0x1724,0x1726,0x1728,0x172a,0x172c,0x172e,0x1730,0x1732,0x1734, -0x1736,0x1738,0x173a,0x15ec,0x173c,0x173e,0x1740,0x1742,0x1744,0x1746,0x1748,0x174a,0x174c,0x174e,0x1750,0x1752, -0x1754,0x1756,0x1758,0x175a,0x175c,0x175e,0x1760,0x1762,0x1764,0x1766,0x1768,0x176a,0x176c,0x176e,0x1770,0x1684, -0x1772,0x1774,0x1776,0x1778,0x177a,0x177c,0x177e,0x1780,0x1782,0x1784,0x1786,0x1788,0x178a,0x178c,0x178e,0x1790, -0x1792,0x1794,0x1796,0x1798,0x179a,0x179c,0x179e,0x17a0,0x17a2,0x17a4,0x17a6,0x17a8,0x17aa,0x17ac,0x17ae,0x17b0, -0x17b2,0x17b4,0x17b6,0x17b8,0x17ba,0x17bc,0x17be,0x17c0,0x17c2,0x17c4,0x17c6,0x17c8,0x17ca,0x17cc,0x17ce,0x17d0, -0x17d2,0x17d4,0,0,0x17d6,0,0x17d8,0,0,0x17da,0x17dc,0x17de,0x17e0,0x17e2,0x17e4,0x17e6, -0x17e8,0x17ea,0x17ec,0,0x17ee,0,0x17f0,0,0,0x17f2,0x17f4,0,0,0,0x17f6,0x17f8, -0x17fa,0x17fc,0x17fe,0x1800,0x1802,0x1804,0x1806,0x1808,0x180a,0x180c,0x180e,0x1810,0x1812,0x1814,0x1816,0x1818, -0x181a,0x181c,0x181e,0x1820,0x1822,0x1824,0x1826,0x1828,0x182a,0x182c,0x182e,0x1830,0x1832,0x1834,0x1836,0x1838, -0x183a,0x183c,0x183e,0x1840,0x1842,0x1844,0x1846,0x1848,0x184a,0x184c,0x184e,0x16ee,0x1850,0x1852,0x1854,0x1856, -0x1858,0x185a,0x185a,0x185c,0x185e,0x1860,0x1862,0x1864,0x1866,0x1868,0x186a,0x17f2,0x186c,0x186e,0x1870,0x1872, -0x1874,0x1877,0,0,0x1879,0x187b,0x187d,0x187f,0x1881,0x1883,0x1885,0x1887,0x180e,0x1889,0x188b,0x188d, -0x17d6,0x188f,0x1891,0x1893,0x1895,0x1897,0x1899,0x189b,0x189d,0x189f,0x18a1,0x18a3,0x18a5,0x1820,0x18a7,0x1822, -0x18a9,0x18ab,0x18ad,0x18af,0x18b1,0x17d8,0x1616,0x18b3,0x18b5,0x18b7,0x16a2,0x1750,0x18b9,0x18bb,0x1830,0x18bd, -0x1832,0x18bf,0x18c1,0x18c3,0x17dc,0x18c5,0x18c7,0x18c9,0x18cb,0x18cd,0x17de,0x18cf,0x18d1,0x18d3,0x18d5,0x18d7, -0x18d9,0x184e,0x18db,0x18dd,0x16ee,0x18df,0x1856,0x18e1,0x18e3,0x18e5,0x18e7,0x18e9,0x1860,0x18eb,0x17f0,0x18ed, -0x1862,0x167c,0x18ef,0x1864,0x18f1,0x1868,0x18f3,0x18f5,0x18f7,0x18f9,0x18fb,0x186c,0x17e8,0x18fd,0x186e,0x18ff, -0x1870,0x1901,0x15d4,0x1903,0x1906,0x1909,0x190c,0x190e,0x1910,0x1912,0x1915,0x1918,0x191b,0x191d,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,0x191f,0xff1a,0x1922, -0,0,0,0,0,0,0,0,0,0,0x1925,0x1928,0x192c,0x1931,0x1935,0x1938, -0x193b,0x193e,0x1941,0x1944,0x1947,0x194a,0x194d,0,0x1950,0x1953,0x1956,0x1959,0x195c,0,0x195f,0, -0x1962,0x1965,0,0x1968,0x196b,0,0x196e,0x1971,0x1974,0x1977,0x197a,0x197d,0x1980,0x1983,0x1986,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffe6,0xffe6, -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,0xffdc,0,0, -0xffdc,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,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xffdc,0,0xffe6,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xffe6,0xff01,0xffdc,0,0,0,0,0xff09,0,0,0,0,0,0xffe6,0xffdc,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,0x54a,0x14ab,0x54d,0x14b0,0,0,0, -0,0,0,0,0,0x550,0,0,0,0,0,0x14b5,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xff09,0xfe07,0,0,0,0,0, -0xffe6,0xffe6,0xffe6,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,0xfe00,0,0,0,0,0,0,0x14ba,0x14bf,0,0x553,0x556,0xff09, -0xff09,0,0,0,0,0,0,0,0,0,0,0,0xff09,0,0,0, -0,0,0,0,0,0,0xff07,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0xff09,0xff07,0, -0,0,0,0,0,0,0,0,0,0xff07,0xff09,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0x559,0,0,0,0x14c4,0x14c9,0xff09,0,0,0,0,0,0, -0,0,0,0xfe00,0,0,0,0,0,0,0,0,0,0,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0, -0,0,0,0,0,0,0,0,0,0,0xff09,0,0,0,0xff07,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,0xfe00,0,0,0,0,0,0,0, -0,0x55f,0xfe00,0x14ce,0x14d3,0xfe00,0x14d8,0,0,0,0xff09,0xff07,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,0xfe00,0,0,0,0, -0,0,0,0,0x568,0x56b,0x14dd,0x14e2,0,0,0,0xff09,0xff07,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,0xff09,0xff07, -0,0,0,0,0,0,0,0,0,0,0,0xff09,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xff01,0xff01,0xff01,0xff01,0xff01,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,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,0xff01,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,0x1989,0x198e, -0x1998,0x19a4,0x19b0,0x19bc,0x19c8,0xffd8,0xffd8,0xff01,0xff01,0xff01,0,0,0,0xffe2,0xffd8,0xffd8, -0xffd8,0xffd8,0xffd8,0,0,0,0,0,0,0,0,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc, -0xffdc,0xffdc,0xffdc,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffdc,0xffdc,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0xffe6,0xffe6,0xffe6,0xffe6,0,0,0,0,0,0,0,0,0,0, -0,0,0,0x19cf,0x19d4,0x19de,0x19ea,0x19f6,0x1a02,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,0xffe6,0xffe6,0xffe6,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,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0, -0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6, -0xffe6,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0,0xffe6,0xffe6,0,0xffe6,0xffe6, -0xffe6,0xffe6,0xffe6,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0, -0,0,0,0,0,0,0,0,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xffe6,0xff07,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x1a09,0x1a0b,0x1a0d,0x1a0f,0x1a12,0x1802,0x1a14,0x1a16,0x1a18,0x1a1a,0x1804,0x1a1c, -0x1a1e,0x1a20,0x1806,0x1a23,0x1a25,0x1a27,0x1a29,0x1a2c,0x1a2e,0x1a30,0x1a32,0x1a35,0x1a37,0x1a39,0x1a3b,0x187b, -0x1a3d,0x1a40,0x1a42,0x1a44,0x1a46,0x1a48,0x1a4a,0x1a4c,0x1a4e,0x1885,0x1808,0x180a,0x1887,0x1a50,0x1a52,0x1688, -0x1a54,0x180c,0x1a56,0x1a58,0x1a5a,0x1a5c,0x1a5c,0x1a5c,0x1a5e,0x1a61,0x1a63,0x1a65,0x1a67,0x1a6a,0x1a6c,0x1a6e, -0x1a70,0x1a72,0x1a74,0x1a76,0x1a78,0x1a7a,0x1a7c,0x1a7e,0x1a80,0x1a82,0x1a82,0x188b,0x1a84,0x1a86,0x1a88,0x1a8a, -0x1810,0x1a8c,0x1a8e,0x1a90,0x17ba,0x1a92,0x1a94,0x1a96,0x1a98,0x1a9a,0x1a9c,0x1a9e,0x1aa0,0x1aa2,0x1aa5,0x1aa7, -0x1aa9,0x1aab,0x1aad,0x1aaf,0x1ab1,0x1ab4,0x1ab7,0x1ab9,0x1abb,0x1abd,0x1abf,0x1ac1,0x1ac3,0x1ac5,0x1ac7,0x1ac7, -0x1ac9,0x1acc,0x1ace,0x1680,0x1ad0,0x1ad2,0x1ad5,0x1ad7,0x1ad9,0x1adb,0x1add,0x1adf,0x181a,0x1ae1,0x1ae3,0x1ae5, -0x1ae8,0x1aea,0x1aed,0x1aef,0x1af1,0x1af3,0x1af5,0x1af7,0x1af9,0x1afb,0x1afd,0x1aff,0x1b01,0x1b03,0x1b06,0x1b08, -0x1b0a,0x1b0c,0x1614,0x1b0e,0x1b11,0x1b13,0x1b13,0x1b16,0x1b18,0x1b18,0x1b1a,0x1b1c,0x1b1f,0x1b22,0x1b24,0x1b26, -0x1b28,0x1b2a,0x1b2c,0x1b2e,0x1b30,0x1b32,0x1b34,0x181c,0x1b36,0x1b39,0x1b3b,0x1b3d,0x18a3,0x1b3d,0x1b3f,0x1820, -0x1b41,0x1b43,0x1b45,0x1b47,0x1822,0x15de,0x1b49,0x1b4b,0x1b4d,0x1b4f,0x1b51,0x1b53,0x1b55,0x1b58,0x1b5a,0x1b5c, -0x1b5e,0x1b60,0x1b62,0x1b65,0x1b67,0x1b69,0x1b6b,0x1b6d,0x1b6f,0x1b71,0x1b73,0x1b75,0x1824,0x1b77,0x1b79,0x1b7c, -0x1b7e,0x1b80,0x1b82,0x1828,0x1b84,0x1b86,0x1b88,0x1b8a,0x1b8c,0x1b8e,0x1b90,0x1b92,0x1616,0x18b3,0x1b94,0x1b96, -0x1b98,0x1b9a,0x1b9d,0x1b9f,0x1ba1,0x1ba3,0x182a,0x1ba5,0x1ba8,0x1baa,0x1bac,0x190c,0x1bae,0x1bb0,0x1bb2,0x1bb4, -0x1bb6,0x1bb9,0x1bbb,0x1bbd,0x1bbf,0x1bc2,0x1bc4,0x1bc6,0x1bc8,0x16a2,0x1bca,0x1bcc,0x1bcf,0x1bd2,0x1bd5,0x1bd7, -0x1bda,0x1bdc,0x1bde,0x1be0,0x1be2,0x182c,0x1750,0x1be4,0x1be6,0x1be8,0x1bea,0x1bed,0x1bef,0x1bf1,0x1bf3,0x18bb, -0x1bf5,0x1bf7,0x1bfa,0x1bfc,0x1bfe,0x1c01,0x1c04,0x1c06,0x18bd,0x1c08,0x1c0a,0x1c0c,0x1c0e,0x1c10,0x1c12,0x1c14, -0x1c17,0x1c19,0x1c1c,0x1c1e,0x1c21,0x18c1,0x1c23,0x1c25,0x1c28,0x1c2a,0x1c2c,0x1c2f,0x1c32,0x1c34,0x1c36,0x1c38, -0x1c3a,0x1c3a,0x1c3c,0x1c3e,0x18c5,0x1c40,0x1c42,0x1c44,0x1c46,0x1c48,0x1c4b,0x1c4d,0x1686,0x1c50,0x1c53,0x1c55, -0x1c58,0x1c5b,0x1c5e,0x1c60,0x18d1,0x1c62,0x1c65,0x1c68,0x1c6b,0x1c6e,0x1c70,0x1c70,0x18d3,0x1910,0x1c72,0x1c74, -0x1c76,0x1c78,0x1c7b,0x163a,0x18d7,0x1c7d,0x1c7f,0x1842,0x1c82,0x1c85,0x17e6,0x1c88,0x1c8a,0x184a,0x1c8c,0x1c8e, -0x1c90,0x1c93,0x1c93,0x1c96,0x1c98,0x1c9a,0x1c9d,0x1c9f,0x1ca1,0x1ca3,0x1ca6,0x1ca8,0x1caa,0x1cac,0x1cae,0x1cb0, -0x1cb3,0x1cb5,0x1cb7,0x1cb9,0x1cbb,0x1cbd,0x1cbf,0x1cc2,0x1cc5,0x1cc7,0x1cca,0x1ccc,0x1ccf,0x1cd1,0x1856,0x1cd3, -0x1cd6,0x1cd9,0x1cdb,0x1cde,0x1ce0,0x1ce3,0x1ce5,0x1ce7,0x1ce9,0x1ceb,0x1ced,0x1cef,0x1cf2,0x1cf5,0x1cf8,0x1b16, -0x1cfb,0x1cfd,0x1cff,0x1d01,0x1d03,0x1d05,0x1d07,0x1d09,0x1d0b,0x1d0d,0x1d0f,0x1d11,0x16aa,0x1d14,0x1d16,0x1d18, -0x1d1a,0x1d1c,0x1d1e,0x185c,0x1d20,0x1d22,0x1d24,0x1d26,0x1d28,0x1d2b,0x1d2e,0x1d31,0x1d33,0x1d35,0x1d37,0x1d39, -0x1d3c,0x1d3e,0x1d41,0x1d43,0x1d45,0x1d48,0x1d4b,0x1d4d,0x1630,0x1d4f,0x1d51,0x1d53,0x1d55,0x1d57,0x1d59,0x18e5, -0x1d5b,0x1d5d,0x1d5f,0x1d61,0x1d63,0x1d65,0x1d67,0x1d69,0x1d6b,0x1d6d,0x1d70,0x1d72,0x1d74,0x1d76,0x1d78,0x1d7a, -0x1d7d,0x1d80,0x1d82,0x1d84,0x18ef,0x18f1,0x1d86,0x1d88,0x1d8b,0x1d8d,0x1d8f,0x1d91,0x1d93,0x1d96,0x1d99,0x1d9b, -0x1d9d,0x1d9f,0x1da2,0x18f3,0x1da4,0x1da7,0x1daa,0x1dac,0x1dae,0x1db0,0x1db3,0x1db5,0x1db7,0x1db9,0x1dbb,0x1dbd, -0x1dbf,0x1dc1,0x1dc4,0x1dc6,0x1dc8,0x1dca,0x1dcd,0x1dcf,0x1dd1,0x1dd3,0x1dd5,0x1dd8,0x1ddb,0x1ddd,0x1ddf,0x1de1, -0x1de4,0x1de6,0x18ff,0x18ff,0x1de9,0x1deb,0x1dee,0x1df0,0x1df2,0x1df4,0x1df6,0x1df8,0x1dfa,0x1dfc,0x1901,0x1dff, -0x1e01,0x1e03,0x1e05,0x1e07,0x1e09,0x1e0c,0x1e0e,0x1e11,0x1e14,0x1e17,0x1e19,0x1e1b,0x1e1d,0x1e1f,0x1e21,0x1e23, -0x1e25,0x1e27,0,0,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00, -0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0,0,0,0,0,0, -0,0,0,0,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00, -0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,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,0x56e,0x56e,0x56e,0x56e, -0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e, -0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,0x56e,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,0x1e29,0,0x1e29,0,0x1e29,0x1e29,0,0x1e29, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0x1e29,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0x1e29,0,0,0,0,0x1e29,0,0,0,0x1e29,0,0x1e29,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,0x1e27,0, -0,0,0,0 +0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xa5f, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x7c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x7cf,0x2c7,0x2c7,0x2c7,0x7d2,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x7d9,0x7dd,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x7e5,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x6fc,0x69e,0x7e7,0x7ef,0x2c7,0x2c7,0x7f7,0x7fe,0x2c7,0x58b,0x2c7,0x2c7,0x806,0x2c7,0x2c7,0x809, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x80f,0x2c7,0x463,0x816,0x81d,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x825,0x2c7,0x2c7,0x829,0x831,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x836,0x83e,0x2c7,0x2c7,0x69e, +0x2c7,0x2c7,0x2c7,0x841,0x2c7,0x2c7,0x2c7,0x847,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x535,0x848,0x2c7,0x84a,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x69e,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x852,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x856,0x2c7,0x85c,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x862,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x86a, +0x872,0x87a,0x880,0x888,0x2c7,0x2c7,0x2c7,0x890,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x898,0x8a0,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x8a4,0x2c7,0x2c7,0x2c7,0x8ab,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x8b3, +0x8bb,0x8c3,0x8cb,0x8d3,0x8db,0x8e3,0x8eb,0x8f3,0x8fb,0x903,0x90b,0x913,0x91b,0x923,0x92b,0x933, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7, +0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2c7,0x2a7, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,4,8,0xc,1, +1,0x10,0x50,0x5c,0x70,0x88,0xcc,0xd0,0xec,0x108,0x144,0x148,0x15c,0x174,0x180,0x1a4, +0x1e4,1,0x1ec,0x20c,0x228,0x244,0x290,0x298,0x2b0,0x2b8,0x2dc,1,1,1,1,1, +1,0x2f4,0x334,0x340,0x354,0x36c,0x3b0,0x3b4,0x3d0,0x3f0,0x428,0x430,0x444,0x45c,0x468,0x48c, +0x4cc,1,0x4d4,0x4f4,0x510,0x530,0x57c,0x584,0x5a0,0x5a8,0x5d0,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0x5e8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0x1284,0x128a,0xade,0x1290,0xaf4,0xafe,0x5f4,0xb08, +0x1296,0x129c,0xb12,0x12a2,0x12a8,0x12ae,0x12b4,0xb28,1,0x12ba,0x12c0,0x12c6,0xb32,0xb48,0xb5a,1, +0x5fc,0x12cc,0x12d2,0x12d8,0xb64,0x12de,1,1,0x12e4,0x12ea,0xb7a,0x12f0,0xb90,0xb9a,0x600,0xba4, +0x12f6,0x12fc,0xbae,0x1302,0x1308,0x130e,0x1314,0xbc4,1,0x131a,0x1320,0x1326,0xbce,0xbe4,0xbf6,1, +0x608,0x132c,0x1332,0x1338,0xc00,0x133e,1,0x1344,0x134a,0x1350,0xc16,0xc2c,0x1357,0x135d,0x1362,0x1368, +0x136e,0x1374,0x137a,0x1380,0x1386,0x138c,0x1392,0x1398,1,1,0xc42,0xc50,0x139e,0x13a4,0x13aa,0x13b0, +0x13b7,0x13bd,0x13c2,0x13c8,0x13ce,0x13d4,0x13da,0x13e0,0x13e6,0x13ec,0x13f3,0x13f9,0x13fe,0x1404,1,1, +0x140a,0x1410,0x1416,0x141c,0x1422,0x1428,0x142f,0x1435,0x143a,1,1,1,0x1441,0x1447,0x144d,0x1453, +1,0x1458,0x145e,0x1465,0x146b,0x1470,0x1476,1,1,1,1,0x147c,0x1482,0x1489,0x148f,0x1494, +0x149a,1,1,1,0xc5e,0xc6c,0x14a0,0x14a6,0x14ac,0x14b2,1,1,0x14b8,0x14be,0x14c5,0x14cb, +0x14d0,0x14d6,0xc7a,0xc84,0x14dc,0x14e2,0x14e9,0x14ef,0xc8e,0xc98,0x14f5,0x14fb,0x1500,0x1506,1,1, +0xca2,0xcac,0xcb6,0xcc0,0x150c,0x1512,0x1518,0x151e,0x1524,0x152a,0x1531,0x1537,0x153c,0x1542,0x1548,0x154e, +0x1554,0x155a,0x1560,0x1566,0x156c,0x1572,0x1578,0x60c,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xcca,0xce4,1,1,1,1,1,1, +1,1,1,1,1,1,1,0xcfe,0xd18,1,1,1,1,1,1,0x610, +1,1,1,1,1,1,1,1,1,1,1,1,1,0x157e,0x1584,0x158a, +0x1590,0x1596,0x159c,0x15a2,0x15a8,0x15b0,0x15ba,0x15c4,0x15ce,0x15d8,0x15e2,0x15ec,0x15f6,1,0x1600,0x160a, +0x1614,0x161e,0x1627,0x162d,1,1,0x1632,0x1638,0x163e,0x1644,0xd32,0xd3c,0x164d,0x1657,0x165f,0x1665, +0x166b,1,1,1,0x1670,0x1676,1,1,0x167c,0x1682,0x168a,0x1694,0x169d,0x16a3,0x16a9,0x16af, +0x16b4,0x16ba,0x16c0,0x16c6,0x16cc,0x16d2,0x16d8,0x16de,0x16e4,0x16ea,0x16f0,0x16f6,0x16fc,0x1702,0x1708,0x170e, +0x1714,0x171a,0x1720,0x1726,0x172c,0x1732,0x1738,0x173e,0x1744,0x174a,0x1750,0x1756,1,1,0x175c,0x1762, +1,1,1,1,1,1,0xd46,0xd50,0xd5a,0xd64,0x176a,0x1774,0x177e,0x1788,0xd6e,0xd78, +0x1792,0x179c,0x17a4,0x17aa,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0x614,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xffcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc, +0xfdcc,0xffcc,0xffcc,0xfdcc,0xffcc,0xfdcc,0xffcc,0xfdcc,0xfdcc,0xffd0,0xffb8,0xffb8,0xffb8,0xffb8,0xffd0,0xfdb0, +0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xff94,0xff94,0xfdb8,0xfdb8,0xfdb8,0xfdb8,0xfd94,0xfd94,0xffb8,0xffb8,0xffb8, +0xffb8,0xfdb8,0xfdb8,0xffb8,0xfdb8,0xfdb8,0xffb8,0xffb8,0xfe02,0xfe02,0xfe02,0xfe02,0xfc02,0xffb8,0xffb8,0xffb8, +0xffb8,0xffcc,0xffcc,0xffcc,0x3c26,0x3c2c,0xfdcc,0x3c32,0x3c38,0xfde0,0xffcc,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc, +0xffcc,0xffb8,0xffb8,1,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffd0,0xffb8,0xffb8,0xffcc, +0xffd2,0xffd4,0xffd4,0xffd2,0xffd4,0xffd4,0xffd2,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,0x29d1,1,1,1,1,1,1,1, +1,1,0x29d5,1,1,1,1,1,1,0x17b1,0x17b7,0x29d9,0x17bd,0x17c3,0x17c9,1, +0x17cf,1,0x17d5,0x17db,0x17e3,0x618,1,1,1,0x634,1,0x644,1,0x658,1,1, +1,1,1,0x674,1,0x684,1,1,1,0x688,1,1,1,0x6a0,0x17eb,0x17f1, +0xd82,0x17f7,0xd8c,0x17fd,0x1805,0x6b4,1,1,1,0x6d4,1,0x6e4,1,0x6fc,1,1, +1,1,1,0x71c,1,0x72c,1,1,1,0x734,1,1,1,0x754,0xd96,0xda8, +0x180d,0x1813,0xdba,1,1,1,0x76c,0x1819,0x181f,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0x1825,0x182b,1,0x1831,1,1,0x774,0x1837,1,1,1,1, +0x183d,0x1843,0x1849,1,0x778,1,1,0x780,1,0x784,0x790,0x798,0x79c,0x184f,0x7ac,1, +1,1,0x7b0,1,1,1,1,0x7b4,1,1,1,0x7c4,1,1,1,0x7c8, +1,0x7cc,1,1,0x7d0,1,1,0x7d8,1,0x7dc,0x7e8,0x7f0,0x7f4,0x1855,0x804,1, +1,1,0x808,1,1,1,1,0x80c,1,1,1,0x81c,1,1,1,0x820, +1,0x824,1,1,0x185b,0x1861,1,0x1867,1,1,0x828,0x186d,1,1,1,1, +0x1873,0x1879,0x187f,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0x82c,0x830,0x1885,0x188b,1,1,1,1, +1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,0x1891,0x1897,1,1,1,1,1,1,1,1,1, +1,1,1,1,0x189d,0x18a3,0x18a9,0x18af,1,1,0x18b5,0x18bb,0x834,0x838,0x18c1,0x18c7, +0x18cd,0x18d3,0x18d9,0x18df,1,1,0x18e5,0x18eb,0x18f1,0x18f7,0x18fd,0x1903,0x83c,0x840,0x1909,0x190f, +0x1915,0x191b,0x1921,0x1927,0x192d,0x1933,0x1939,0x193f,0x1945,0x194b,1,1,0x1951,0x1957,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffbc,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffbc,0xffc8,0xffcc, +0xfe14,0xfe16,0xfe18,0xfe1a,0xfe1c,0xfe1e,0xfe20,0xfe22,0xfe24,0xfe26,0xfe26,0xfe28,0xfe2a,0xfe2c,1,0xfe2e, +1,0xfe30,0xfe32,1,0xffcc,0xffb8,1,0xfe24,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xfe3c,0xfe3e,0xfe40,1,1,1,1,1, +1,1,0x195c,0x1962,0x1969,0x196f,0x1975,0x844,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0x850,1,0x854,0xfe36,0xfe38,0xfe3a,0xfe3c,0xfe3e,0xfe40,0xfe42,0xfe44,0xfdcc,0xfdcc,0xfdb8,0xffb8,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xfe46,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0x197b,0x858,0x1981,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0x85c,0x1987,1,0x860,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,1,1,0xffcc, +0xffcc,1,0xffb8,0xffcc,0xffcc,0xffb8,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xfe48,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8, +0xffb8,0xffb8,0xffcc,0xffb8,0xffb8,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffb8,0xffcc,0xffb8,0xffcc, +0xffb8,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffb8,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xffb8,0xffb8,0xffb8,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffb8, +0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xfe36,0xfe38,0xfe3a,0xffcc, +0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1, +1,1,1,1,0x864,0x198d,1,1,1,1,1,1,0x868,0x1993,1,0x86c, +0x1999,1,1,1,1,1,1,1,0xfc0e,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xfe12,1,1,1,0xffcc,0xffb8,0xffcc, +0xffcc,1,1,1,0x29dc,0x29e2,0x29e8,0x29ee,0x29f4,0x29fa,0x2a00,0x2a06,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xfe0e,1,0xfc00,1,1,1,1,1, +1,1,1,0x870,1,1,1,0x199f,0x19a5,0xfe12,1,1,1,1,1,1, +1,1,1,0xfc00,1,1,1,1,0x2a0c,0x2a12,1,0x2a18,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x2a1e, +1,1,0x2a24,1,1,1,1,1,0xfe0e,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xfe12,1,1,1,1,1,1, +1,1,1,1,1,0x2a2a,0x2a30,0x2a36,1,1,0x2a3c,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xfe0e,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xfe12,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x878, +0x19ab,1,1,0x19b1,0x19b7,0xfe12,1,1,1,1,1,1,1,1,0xfc00,0xfc00, +1,1,1,1,0x2a42,0x2a48,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0x884,1,0x19bd,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfc00,1, +1,1,1,1,1,1,0x888,0x890,1,1,0x19c3,0x19c9,0x19cf,0xfe12,1,1, +1,1,1,1,1,1,1,0xfc00,1,1,1,1,1,1,1,1, +1,1,0x894,1,0x19d5,1,1,1,1,0xfe12,1,1,1,1,1,1, +1,0xfea8,0xfcb6,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xfe0e,1,1,0x898,0x19db,1,0xfc00,1,1,1,0x89c,0x19e1,0x19e7,1,0xdc4,0x19ef, +1,0xfe12,1,1,1,1,1,1,1,0xfc00,0xfc00,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0xfe12,0xfe12,1,0xfc00,1,1,1,1,1, +1,1,0x8a8,0x8b0,1,1,0x19f7,0x19fd,0x1a03,0xfe12,1,1,1,1,1,1, +1,1,1,0xfc00,1,1,1,1,1,1,1,1,1,1,0xfc12,1, +1,1,1,0xfc00,1,1,1,1,1,1,1,1,1,0x8b4,0x1a09,1, +0xdce,0x1a11,0x1a19,0xfc00,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xfece,0xfece,0xfe12,1, +1,1,1,1,1,1,1,1,0xfed6,0xfed6,0xfed6,0xfed6,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xfeec,0xfeec,1,1,1,1,1,1,1,1,1,1, +0xfef4,0xfef4,0xfef4,0xfef4,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xffb8,0xffb8,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,0xffb8,1,0xffb8,1,0xffb0,1,1,1,1,1,1, +1,1,1,0x2a4f,1,1,1,1,1,1,1,1,1,0x2a55,1,1, +1,1,0x2a5b,1,1,1,1,0x2a61,1,1,1,1,0x2a67,1,1,1, +1,1,1,1,1,1,1,1,1,0x2a6d,1,1,1,1,1,1, +1,0xff02,0xff04,0x3c40,0xff08,0x3c48,0x2a72,1,0x2a78,1,0xff04,0xff04,0xff04,0xff04,1,1, +0xff04,0x3c50,0xffcc,0xffcc,0xfe12,1,0xffcc,0xffcc,1,1,1,1,1,1,1,1, +1,1,1,0x2a7f,1,1,1,1,1,1,1,1,1,0x2a85,1,1, +1,1,0x2a8b,1,1,1,1,0x2a91,1,1,1,1,0x2a97,1,1,1, +1,1,1,1,1,1,1,1,1,0x2a9d,1,1,1,1,1,1, +1,1,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,0x8c0,0x1a1f,1, +1,1,1,1,1,1,0xfc00,1,1,1,1,1,1,1,1,0xfe0e, +1,0xfe12,0xfe12,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,1, +1,1,1,1,1,1,1,1,1,0xffcc,1,1,1,1,1,1, +1,1,1,1,1,0xffc8,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0xffbc,0xffcc,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffb8,1,1,1, +1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,1,1,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc, +0xffcc,0xffb8,1,1,1,1,1,1,1,0x8c4,0x1a25,0x8c8,0x1a2b,0x8cc,0x1a31,0x8d0, +0x1a37,0x8d4,0x1a3d,1,1,0x8d8,0x1a43,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xfe0e,0xfc00,1,1, +1,1,0x8dc,0x1a49,0x8e0,0x1a4f,0x8e4,0x8e8,0x1a55,0x1a5b,0x8ec,0x1a61,0xfe12,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,0xfe12,0xfe12,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0xfe0e,1,1,1,1,1, +1,1,1,1,1,1,0xfe12,0xfe12,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe0e, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xffcc,0xffcc,0xffcc,1,0xfe02,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8, +0xffcc,1,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,1,1,1,1,0xffb8,1,1, +1,1,1,1,0xffcc,1,1,1,0xffcc,0xffcc,1,1,1,1,1,1, +0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffd4,0xffac,0xffb8, +0xff94,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffd0,0xffc8,0xffc8,0xffb8,1,0xffcc, +0xffd2,0xffb8,0xffcc,0xffb8,0x1a66,0x1a6c,0x1a72,0x1a78,0x1a7f,0x1a85,0x1a8b,0x1a91,0x1a99,0x1aa3,0x1aaa,0x1ab0, +0x1ab6,0x1abc,0x1ac2,0x1ac8,0x1acf,0x1ad5,0x1ada,0x1ae0,0x1ae8,0x1af2,0x1afc,0x1b06,0x1b0e,0x1b14,0x1b1a,0x1b20, +0x1b29,0x1b33,0x1b3b,0x1b41,0x1b46,0x1b4c,0x1b52,0x1b58,0x1b5e,0x1b64,0x1b6a,0x1b70,0x1b77,0x1b7d,0x1b82,0x1b88, +0x1b8e,0x1b94,0x1b9c,0x1ba6,0x1bae,0x1bb4,0x1bba,0x1bc0,0x1bc6,0x1bcc,0xdd8,0xde2,0x1bd4,0x1bde,0x1be6,0x1bec, +0x1bf2,0x1bf8,0x1bfe,0x1c04,0x1c0a,0x1c10,0x1c17,0x1c1d,0x1c22,0x1c28,0x1c2e,0x1c34,0x1c3a,0x1c40,0x1c46,0x1c4c, +0x1c54,0x1c5e,0x1c68,0x1c72,0x1c7c,0x1c86,0x1c90,0x1c9a,0x1ca3,0x1ca9,0x1caf,0x1cb5,0x1cba,0x1cc0,0xdec,0xdf6, +0x1cc8,0x1cd2,0x1cda,0x1ce0,0x1ce6,0x1cec,0xe00,0xe0a,0x1cf4,0x1cfe,0x1d08,0x1d12,0x1d1c,0x1d26,0x1d2e,0x1d34, +0x1d3a,0x1d40,0x1d46,0x1d4c,0x1d52,0x1d58,0x1d5e,0x1d64,0x1d6a,0x1d70,0x1d76,0x1d7c,0x1d84,0x1d8e,0x1d98,0x1da2, +0x1daa,0x1db0,0x1db7,0x1dbd,0x1dc2,0x1dc8,0x1dce,0x1dd4,0x1dda,0x1de0,0x1de6,0x1dec,0x1df3,0x1df9,0x1dff,0x1e05, +0x1e0b,0x1e11,0x1e16,0x1e1c,0x1e22,0x1e28,0x1e2f,0x1e35,0x1e3b,0x1e41,0x1e46,0x1e4c,0x1e52,0x1e58,1,0x1e5f, +1,1,1,1,0xe14,0xe22,0x1e64,0x1e6a,0x1e72,0x1e7c,0x1e86,0x1e90,0x1e9a,0x1ea4,0x1eae,0x1eb8, +0x1ec2,0x1ecc,0x1ed6,0x1ee0,0x1eea,0x1ef4,0x1efe,0x1f08,0x1f12,0x1f1c,0x1f26,0x1f30,0xe30,0xe3a,0x1f38,0x1f3e, +0x1f44,0x1f4a,0x1f52,0x1f5c,0x1f66,0x1f70,0x1f7a,0x1f84,0x1f8e,0x1f98,0x1fa2,0x1fac,0x1fb4,0x1fba,0x1fc0,0x1fc6, +0xe44,0xe4e,0x1fcc,0x1fd2,0x1fda,0x1fe4,0x1fee,0x1ff8,0x2002,0x200c,0x2016,0x2020,0x202a,0x2034,0x203e,0x2048, +0x2052,0x205c,0x2066,0x2070,0x207a,0x2084,0x208e,0x2098,0x20a0,0x20a6,0x20ac,0x20b2,0x20ba,0x20c4,0x20ce,0x20d8, +0x20e2,0x20ec,0x20f6,0x2100,0x210a,0x2114,0x211c,0x2122,0x2129,0x212f,0x2134,0x213a,0x2140,0x2146,1,1, +1,1,1,1,0xe58,0xe6e,0xe86,0xe94,0xea2,0xeb0,0xebe,0xecc,0xed8,0xeee,0xf06,0xf14, +0xf22,0xf30,0xf3e,0xf4c,0xf58,0xf66,0x214f,0x2159,0x2163,0x216d,1,1,0xf74,0xf82,0x2177,0x2181, +0x218b,0x2195,1,1,0xf90,0xfa6,0xfbe,0xfcc,0xfda,0xfe8,0xff6,0x1004,0x1010,0x1026,0x103e,0x104c, +0x105a,0x1068,0x1076,0x1084,0x1090,0x10a2,0x219f,0x21a9,0x21b3,0x21bd,0x21c7,0x21d1,0x10b4,0x10c6,0x21db,0x21e5, +0x21ef,0x21f9,0x2203,0x220d,0x10d8,0x10e6,0x2217,0x2221,0x222b,0x2235,1,1,0x10f4,0x1102,0x223f,0x2249, +0x2253,0x225d,1,1,0x1110,0x1122,0x2267,0x2271,0x227b,0x2285,0x228f,0x2299,1,0x1134,1,0x22a3, +1,0x22ad,1,0x22b7,0x1146,0x115c,0x1174,0x1182,0x1190,0x119e,0x11ac,0x11ba,0x11c6,0x11dc,0x11f4,0x1202, +0x1210,0x121e,0x122c,0x123a,0x1246,0x3b8e,0x22bf,0x3b96,0x1250,0x3b9e,0x22c5,0x3ba6,0x22cb,0x3bae,0x22d1,0x3bb6, +0x125a,0x3bbe,1,1,0x22d8,0x22e2,0x22f1,0x2301,0x2311,0x2321,0x2331,0x2341,0x234c,0x2356,0x2365,0x2375, +0x2385,0x2395,0x23a5,0x23b5,0x23c0,0x23ca,0x23d9,0x23e9,0x23f9,0x2409,0x2419,0x2429,0x2434,0x243e,0x244d,0x245d, +0x246d,0x247d,0x248d,0x249d,0x24a8,0x24b2,0x24c1,0x24d1,0x24e1,0x24f1,0x2501,0x2511,0x251c,0x2526,0x2535,0x2545, +0x2555,0x2565,0x2575,0x2585,0x258f,0x2595,0x259d,0x25a4,0x25ad,1,0x1264,0x25b7,0x25bf,0x25c5,0x25cb,0x3bc6, +0x25d0,1,0x2aa2,0x8f0,1,0x25d7,0x25df,0x25e6,0x25ef,1,0x126e,0x25f9,0x2601,0x3bce,0x2607,0x3bd6, +0x260c,0x2613,0x2619,0x261f,0x2625,0x262b,0x2633,0x3be0,1,1,0x263b,0x2643,0x264b,0x2651,0x2657,0x3bea, +1,0x265d,0x2663,0x2669,0x266f,0x2675,0x267d,0x3bf4,0x2685,0x268b,0x2691,0x2699,0x26a1,0x26a7,0x26ad,0x3bfe, +0x26b3,0x26b9,0x3c06,0x2aa7,1,1,0x26c1,0x26c8,0x26d1,1,0x1278,0x26db,0x26e3,0x3c0e,0x26e9,0x3c16, +0x26ee,0x2aab,0x8fc,1,0xfa09,0xfa09,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xffcc,0xffcc,0xfe02,0xfe02,0xffcc,0xffcc,0xffcc,0xffcc,0xfe02,0xfe02,0xfe02,0xffcc, +0xffcc,1,1,1,1,0xffcc,1,1,1,0xfe02,0xfe02,0xffcc,0xffb8,0xffcc,0xfe02,0xfe02, +0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0x2aae,1,1,1,0x2ab2,0x3c1e,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0x908,1,0x90c,1,0x910,1,1,1,1,1,0x26f5,0x26fb,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0x2701,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,0x2707,0x270d,0x2713, +0x914,1,0x918,1,0x91c,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,0x920,0x2719,1,1,1,0x924,0x271f,1,0x928,0x2725,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,0x92c,0x272b,0x930,0x2731,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0x934,1,1,1, +1,0x2737,1,0x938,0x273d,0x93c,1,0x2743,0x940,0x2749,1,1,1,0x944,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0x274f,0x948,0x2755,1,0x94c,0x950,1,1,1,1,1,1,1,0x275b,0x2761,0x2767, +0x276d,0x2773,0x954,0x958,0x2779,0x277f,0x95c,0x960,0x2785,0x278b,0x964,0x968,0x96c,0x970,1,1, +0x2791,0x2797,0x974,0x978,0x279d,0x27a3,0x97c,0x980,0x27a9,0x27af,1,1,1,1,1,1, +1,0x984,0x988,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,0x98c,1,1,1,1,1,0x990,0x994,1,0x998,0x27b5,0x27bb,0x27c1,0x27c7, +1,1,0x99c,0x9a0,0x9a4,0x9a8,1,1,1,1,1,1,1,1,1,1, +0x27cd,0x27d3,0x27d9,0x27df,1,1,1,1,1,1,0x27e5,0x27eb,0x27f1,0x27f7,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0x2ab7,0x2abb,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0x2abf,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0xfe12,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1, +1,1,0xffb4,0xffc8,0xffd0,0xffbc,0xffc0,0xffc0,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0x9ac,1,1,1,1,0x9b0, +0x27fd,0x9b4,0x2803,0x9b8,0x2809,0x9bc,0x280f,0x9c0,0x2815,0x9c4,0x281b,0x9c8,0x2821,0x9cc,0x2827,0x9d0, +0x282d,0x9d4,0x2833,0x9d8,0x2839,0x9dc,0x283f,1,0x9e0,0x2845,0x9e4,0x284b,0x9e8,0x2851,1,1, +1,1,1,0x9ec,0x2857,0x285d,0x9f4,0x2863,0x2869,0x9fc,0x286f,0x2875,0xa04,0x287b,0x2881,0xa0c, +0x2887,0x288d,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0x2893,1,1,1,1,0xfc10,0xfc10,1, +1,0xa14,0x2899,1,1,1,1,1,1,1,0xa18,1,1,1,1,0xa1c, +0x289f,0xa20,0x28a5,0xa24,0x28ab,0xa28,0x28b1,0xa2c,0x28b7,0xa30,0x28bd,0xa34,0x28c3,0xa38,0x28c9,0xa3c, +0x28cf,0xa40,0x28d5,0xa44,0x28db,0xa48,0x28e1,1,0xa4c,0x28e7,0xa50,0x28ed,0xa54,0x28f3,1,1, +1,1,1,0xa58,0x28f9,0x28ff,0xa60,0x2905,0x290b,0xa68,0x2911,0x2917,0xa70,0x291d,0x2923,0xa78, +0x2929,0x292f,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,0xa80,0xa84,0xa88,0xa8c,1,0x2935,1,1,0x293b,0x2941,0x2947,0x294d,1, +1,0xa90,0x2953,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,0xffcc,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xfe12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffb8, +0xffb8,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1, +1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xffcc,1,0xffcc,0xffcc,0xffb8,1,1,0xffcc,0xffcc,1,1,1, +1,1,0xffcc,0xffcc,1,0xffcc,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1, +0x2ac5,0x2ac9,0x2acd,0x2ad1,0x2ad5,0x2ad9,0x2add,0x2ae1,0x2ae1,0x2ae5,0x2ae9,0x2aed,0x2af1,0x2af5,0x2af9,0x2afd, +0x2b01,0x2b05,0x2b09,0x2b0d,0x2b11,0x2b15,0x2b19,0x2b1d,0x2b21,0x2b25,0x2b29,0x2b2d,0x2b31,0x2b35,0x2b39,0x2b3d, +0x2b41,0x2b45,0x2b49,0x2b4d,0x2b51,0x2b55,0x2b59,0x2b5d,0x2b61,0x2b65,0x2b69,0x2b6d,0x2b71,0x2b75,0x2b79,0x2b7d, +0x2b81,0x2b85,0x2b89,0x2b8d,0x2b91,0x2b95,0x2b99,0x2b9d,0x2ba1,0x2ba5,0x2ba9,0x2bad,0x2bb1,0x2bb5,0x2bb9,0x2bbd, +0x2bc1,0x2bc5,0x2bc9,0x2bcd,0x2bd1,0x2bd5,0x2bd9,0x2bdd,0x2be1,0x2be5,0x2be9,0x2bed,0x2bf1,0x2bf5,0x2bf9,0x2bfd, +0x2c01,0x2c05,0x2c09,0x2c0d,0x2c11,0x2c15,0x2c19,0x2c1d,0x2c21,0x2c25,0x2c29,0x2c2d,0x2b11,0x2c31,0x2c35,0x2c39, +0x2c3d,0x2c41,0x2c45,0x2c49,0x2c4d,0x2c51,0x2c55,0x2c59,0x2c5d,0x2c61,0x2c65,0x2c69,0x2c6d,0x2c71,0x2c75,0x2c79, +0x2c7d,0x2c81,0x2c85,0x2c89,0x2c8d,0x2c91,0x2c95,0x2c99,0x2c9d,0x2ca1,0x2ca5,0x2ca9,0x2cad,0x2cb1,0x2cb5,0x2cb9, +0x2cbd,0x2cc1,0x2cc5,0x2cc9,0x2ccd,0x2cd1,0x2cd5,0x2cd9,0x2cdd,0x2ce1,0x2ce5,0x2ce9,0x2ced,0x2cf1,0x2cf5,0x2cf9, +0x2cfd,0x2d01,0x2d05,0x2d09,0x2d0d,0x2d11,0x2d15,0x2d19,0x2d1d,0x2d21,0x2d25,0x2d29,0x2d2d,0x2d31,0x2d35,0x2d39, +0x2d3d,0x2c79,0x2d41,0x2d45,0x2d49,0x2d4d,0x2d51,0x2d55,0x2d59,0x2d5d,0x2c39,0x2d61,0x2d65,0x2d69,0x2d6d,0x2d71, +0x2d75,0x2d79,0x2d7d,0x2d81,0x2d85,0x2d89,0x2d8d,0x2d91,0x2d95,0x2d99,0x2d9d,0x2da1,0x2da5,0x2da9,0x2dad,0x2b11, +0x2db1,0x2db5,0x2db9,0x2dbd,0x2dc1,0x2dc5,0x2dc9,0x2dcd,0x2dd1,0x2dd5,0x2dd9,0x2ddd,0x2de1,0x2de5,0x2de9,0x2ded, +0x2df1,0x2df5,0x2df9,0x2dfd,0x2e01,0x2e05,0x2e09,0x2e0d,0x2e11,0x2e15,0x2e19,0x2c41,0x2e1d,0x2e21,0x2e25,0x2e29, +0x2e2d,0x2e31,0x2e35,0x2e39,0x2e3d,0x2e41,0x2e45,0x2e49,0x2e4d,0x2e51,0x2e55,0x2e59,0x2e5d,0x2e61,0x2e65,0x2e69, +0x2e6d,0x2e71,0x2e75,0x2e79,0x2e7d,0x2e81,0x2e85,0x2e89,0x2e8d,0x2e91,0x2e95,0x2e99,0x2e9d,0x2ea1,0x2ea5,0x2ea9, +0x2ead,0x2eb1,0x2eb5,0x2eb9,0x2ebd,0x2ec1,0x2ec5,0x2ec9,0x2ecd,0x2ed1,0x2ed5,0x2ed9,0x2edd,0x2ee1,1,1, +0x2ee5,1,0x2ee9,1,1,0x2eed,0x2ef1,0x2ef5,0x2ef9,0x2efd,0x2f01,0x2f05,0x2f09,0x2f0d,0x2f11,1, +0x2f15,1,0x2f19,1,1,0x2f1d,0x2f21,1,1,1,0x2f25,0x2f29,0x2f2d,0x2f31,0x2f35,0x2f39, +0x2f3d,0x2f41,0x2f45,0x2f49,0x2f4d,0x2f51,0x2f55,0x2f59,0x2f5d,0x2f61,0x2f65,0x2f69,0x2f6d,0x2f71,0x2f75,0x2f79, +0x2f7d,0x2f81,0x2f85,0x2f89,0x2f8d,0x2f91,0x2f95,0x2f99,0x2f9d,0x2fa1,0x2fa5,0x2fa9,0x2fad,0x2fb1,0x2fb5,0x2fb9, +0x2fbd,0x2fc1,0x2fc5,0x2fc9,0x2fcd,0x2fd1,0x2fd5,0x2d15,0x2fd9,0x2fdd,0x2fe1,0x2fe5,0x2fe9,0x2fed,0x2fed,0x2ff1, +0x2ff5,0x2ff9,0x2ffd,0x3001,0x3005,0x3009,0x300d,0x2f1d,0x3011,0x3015,0x3019,0x301d,0x3021,0x3027,1,1, +0x302b,0x302f,0x3033,0x3037,0x303b,0x303f,0x3043,0x3047,0x2f55,0x304b,0x304f,0x3053,0x2ee5,0x3057,0x305b,0x305f, +0x3063,0x3067,0x306b,0x306f,0x3073,0x3077,0x307b,0x307f,0x3083,0x2f79,0x3087,0x2f7d,0x308b,0x308f,0x3093,0x3097, +0x309b,0x2ee9,0x2b65,0x309f,0x30a3,0x30a7,0x2c7d,0x2dd9,0x30ab,0x30af,0x2f99,0x30b3,0x2f9d,0x30b7,0x30bb,0x30bf, +0x2ef1,0x30c3,0x30c7,0x30cb,0x30cf,0x30d3,0x2ef5,0x30d7,0x30db,0x30df,0x30e3,0x30e7,0x30eb,0x2fd5,0x30ef,0x30f3, +0x2d15,0x30f7,0x2fe5,0x30fb,0x30ff,0x3103,0x3107,0x310b,0x2ff9,0x310f,0x2f19,0x3113,0x2ffd,0x2c31,0x3117,0x3001, +0x311b,0x3009,0x311f,0x3123,0x3127,0x312b,0x312f,0x3011,0x2f09,0x3133,0x3015,0x3137,0x3019,0x313b,0x2ae1,0x313f, +0x3145,0x314b,0x3151,0x3155,0x3159,0x315d,0x3163,0x3169,0x316f,0x3173,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0x3176,0xfe34,0x317c,1,1,1,1, +1,1,1,1,1,1,0x3182,0x3188,0x3190,0x319a,0x31a2,0x31a8,0x31ae,0x31b4,0x31ba,0x31c0, +0x31c6,0x31cc,0x31d2,1,0x31d8,0x31de,0x31e4,0x31ea,0x31f0,1,0x31f6,1,0x31fc,0x3202,1,0x3208, +0x320e,1,0x3214,0x321a,0x3220,0x3226,0x322c,0x3232,0x3238,0x323e,0x3244,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xffb8,1,1,0xffb8,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0xffb8,1,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xfe02,0xffb8,1, +1,1,1,0xfe12,1,1,1,1,1,0xffcc,0xffb8,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,0xa94,0x2959,0xa9a,0x2963,1,1,1,1,1,1,1, +1,0xaa0,1,1,1,1,1,0x296d,1,1,1,1,1,1,1,1, +1,1,1,1,1,0xfe12,0xfc0e,1,1,1,1,1,0xffcc,0xffcc,0xffcc,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfc00, +1,1,1,1,1,1,0x2977,0x2981,1,0xaa6,0xaac,0xfe12,0xfe12,1,1,1, +1,1,1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1, +1,1,0xfe0e,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0xfe12,0xfe0e,1,1,1,1,1, +1,1,1,1,1,0xfe0e,0xfe12,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xab2, +1,1,1,0x298b,0x2995,0xfe12,1,1,1,1,1,1,1,1,1,0xfc00, +1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1, +1,1,1,1,1,1,0xfe12,1,1,1,0xfe0e,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xfc00,1,1,1,1,1,1,1,1,0xabe,0xfc00,0x299f, +0x29a9,0xfc00,0x29b3,1,1,1,0xfe12,0xfe0e,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0xfc00,1,1,1,1,1,1,1,1, +0xad0,0xad6,0x29bd,0x29c7,1,1,1,0xfe12,0xfe0e,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0xfe12,0xfe0e,1,1,1,1, +1,1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0xfe12,1,1,1,1,1,1,1,1,0xfe0e,1,0xfe12,0xfe12,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0xfe02,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0x324a,0x3254,0x3268,0x3280,0x3298,0x32b0,0x32c8,0xffb0,0xffb0,0xfe02, +0xfe02,0xfe02,1,1,1,0xffc4,0xffb0,0xffb0,0xffb0,0xffb0,0xffb0,1,1,1,1,1, +1,1,1,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,1,1,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffb8,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,1,1, +1,1,1,1,1,1,1,1,1,1,1,0x32d6,0x32e0,0x32f4,0x330c,0x3324, +0x333c,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, +0xffcc,0xffcc,1,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,1,1,1,1,1,1,1,1,1, +0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xfe0e,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0x334b,0x334f,0x3353,0x3357, +0x335d,0x2f3d,0x3361,0x3365,0x3369,0x336d,0x2f41,0x3371,0x3375,0x3379,0x2f45,0x337f,0x3383,0x3387,0x338b,0x3391, +0x3395,0x3399,0x339d,0x33a3,0x33a7,0x33ab,0x33af,0x302f,0x33b3,0x33b9,0x33bd,0x33c1,0x33c5,0x33c9,0x33cd,0x33d1, +0x33d5,0x3043,0x2f49,0x2f4d,0x3047,0x33d9,0x33dd,0x2c49,0x33e1,0x2f51,0x33e5,0x33e9,0x33ed,0x33f1,0x33f1,0x33f1, +0x33f5,0x33fb,0x33ff,0x3403,0x3407,0x340d,0x3411,0x3415,0x3419,0x341d,0x3421,0x3425,0x3429,0x342d,0x3431,0x3435, +0x3439,0x343d,0x343d,0x304f,0x3441,0x3445,0x3449,0x344d,0x2f59,0x3451,0x3455,0x3459,0x2ead,0x345d,0x3461,0x3465, +0x3469,0x346d,0x3471,0x3475,0x3479,0x347d,0x3483,0x3487,0x348b,0x348f,0x3493,0x3497,0x349b,0x34a1,0x34a7,0x34ab, +0x34af,0x34b3,0x34b7,0x34bb,0x34bf,0x34c3,0x34c7,0x34c7,0x34cb,0x34d1,0x34d5,0x2c39,0x34d9,0x34dd,0x34e3,0x34e7, +0x34eb,0x34ef,0x34f3,0x34f7,0x2f6d,0x34fb,0x34ff,0x3503,0x3509,0x350d,0x3513,0x3517,0x351b,0x351f,0x3523,0x3527, +0x352b,0x352f,0x3533,0x3537,0x353b,0x353f,0x3545,0x3549,0x354d,0x3551,0x2b61,0x3555,0x355b,0x355f,0x355f,0x3565, +0x3569,0x3569,0x356d,0x3571,0x3577,0x357d,0x3581,0x3585,0x3589,0x358d,0x3591,0x3595,0x3599,0x359d,0x35a1,0x2f71, +0x35a5,0x35ab,0x35af,0x35b3,0x307f,0x35b3,0x35b7,0x2f79,0x35bb,0x35bf,0x35c3,0x35c7,0x2f7d,0x2af5,0x35cb,0x35cf, +0x35d3,0x35d7,0x35db,0x35df,0x35e3,0x35e9,0x35ed,0x35f1,0x35f5,0x35f9,0x35fd,0x3603,0x3607,0x360b,0x360f,0x3613, +0x3617,0x361b,0x361f,0x3623,0x2f81,0x3627,0x362b,0x3631,0x3635,0x3639,0x363d,0x2f89,0x3641,0x3645,0x3649,0x364d, +0x3651,0x3655,0x3659,0x365d,0x2b65,0x309f,0x3661,0x3665,0x3669,0x366d,0x3673,0x3677,0x367b,0x367f,0x2f8d,0x3683, +0x3689,0x368d,0x3691,0x3151,0x3695,0x3699,0x369d,0x36a1,0x36a5,0x36ab,0x36af,0x36b3,0x36b7,0x36bd,0x36c1,0x36c5, +0x36c9,0x2c7d,0x36cd,0x36d1,0x36d7,0x36dd,0x36e3,0x36e7,0x36ed,0x36f1,0x36f5,0x36f9,0x36fd,0x2f91,0x2dd9,0x3701, +0x3705,0x3709,0x370d,0x3713,0x3717,0x371b,0x371f,0x30af,0x3723,0x3727,0x372d,0x3731,0x3735,0x373b,0x3741,0x3745, +0x30b3,0x3749,0x374d,0x3751,0x3755,0x3759,0x375d,0x3761,0x3767,0x376b,0x3771,0x3775,0x377b,0x30bb,0x377f,0x3783, +0x3789,0x378d,0x3791,0x3797,0x379d,0x37a1,0x37a5,0x37a9,0x37ad,0x37ad,0x37b1,0x37b5,0x30c3,0x37b9,0x37bd,0x37c1, +0x37c5,0x37c9,0x37cf,0x37d3,0x2c45,0x37d9,0x37df,0x37e3,0x37e9,0x37ef,0x37f5,0x37f9,0x30db,0x37fd,0x3803,0x3809, +0x380f,0x3815,0x3819,0x3819,0x30df,0x3159,0x381d,0x3821,0x3825,0x3829,0x382f,0x2bad,0x30e7,0x3833,0x3837,0x2fbd, +0x383d,0x3843,0x2f05,0x3849,0x384d,0x2fcd,0x3851,0x3855,0x3859,0x385f,0x385f,0x3865,0x3869,0x386d,0x3873,0x3877, +0x387b,0x387f,0x3885,0x3889,0x388d,0x3891,0x3895,0x3899,0x389f,0x38a3,0x38a7,0x38ab,0x38af,0x38b3,0x38b7,0x38bd, +0x38c3,0x38c7,0x38cd,0x38d1,0x38d7,0x38db,0x2fe5,0x38df,0x38e5,0x38eb,0x38ef,0x38f5,0x38f9,0x38ff,0x3903,0x3907, +0x390b,0x390f,0x3913,0x3917,0x391d,0x3923,0x3929,0x3565,0x392f,0x3933,0x3937,0x393b,0x393f,0x3943,0x3947,0x394b, +0x394f,0x3953,0x3957,0x395b,0x2c8d,0x3961,0x3965,0x3969,0x396d,0x3971,0x3975,0x2ff1,0x3979,0x397d,0x3981,0x3985, +0x3989,0x398f,0x3995,0x399b,0x399f,0x39a3,0x39a7,0x39ab,0x39b1,0x39b5,0x39bb,0x39bf,0x39c3,0x39c9,0x39cf,0x39d3, +0x2b99,0x39d7,0x39db,0x39df,0x39e3,0x39e7,0x39eb,0x3103,0x39ef,0x39f3,0x39f7,0x39fb,0x39ff,0x3a03,0x3a07,0x3a0b, +0x3a0f,0x3a13,0x3a19,0x3a1d,0x3a21,0x3a25,0x3a29,0x3a2d,0x3a33,0x3a39,0x3a3d,0x3a41,0x3117,0x311b,0x3a45,0x3a49, +0x3a4f,0x3a53,0x3a57,0x3a5b,0x3a5f,0x3a65,0x3a6b,0x3a6f,0x3a73,0x3a77,0x3a7d,0x311f,0x3a81,0x3a87,0x3a8d,0x3a91, +0x3a95,0x3a99,0x3a9f,0x3aa3,0x3aa7,0x3aab,0x3aaf,0x3ab3,0x3ab7,0x3abb,0x3ac1,0x3ac5,0x3ac9,0x3acd,0x3ad3,0x3ad7, +0x3adb,0x3adf,0x3ae3,0x3ae9,0x3aef,0x3af3,0x3af7,0x3afb,0x3b01,0x3b05,0x3137,0x3137,0x3b0b,0x3b0f,0x3b15,0x3b19, +0x3b1d,0x3b21,0x3b25,0x3b29,0x3b2d,0x3b31,0x313b,0x3b37,0x3b3b,0x3b3f,0x3b43,0x3b47,0x3b4b,0x3b51,0x3b55,0x3b5b, +0x3b61,0x3b67,0x3b6b,0x3b6f,0x3b73,0x3b77,0x3b7b,0x3b7f,0x3b83,0x3b87,1,1,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe00,0xfe00,0xfe00, +0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00, +0xfe00,0xfe00,1,1,1,1,1,1,1,1,1,1,0xfe00,0xfe00,0xfe00,0xfe00, +0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00, +0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0xadc,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, +0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, +0xadc,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, +0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0x1283,0x1283,0x1283,0x1283,0xadc,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, +0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, +0x1283,0x1283,0x1283,0x1283,0x3c54,1,0x3c54,1,0x3c54,0x3c54,0x3c54,0x3c54,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x3c54,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x3c54, +1,1,1,1,0x3c54,1,1,1,0x3c54,1,0x3c54,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0x3b87,1,1,1,1,1 }; -static const uint16_t norm2_nfc_data_extraData[7722]={ +static const uint16_t norm2_nfc_data_extraData[7724]={ 0xffff,0xffff,0x8670,0x44dc,0x8670,0x44c0,0x8670,0x44de,0x600,0x180,0x602,0x182,0x604,0x185,0x606,0x186, 0x608,0x200,0x60c,0x205,0x60e,0x44d,0x610,0x189,0x612,0x3d44,0x614,0x18b,0x618,0x39a,0x61e,0x400, 0x622,0x404,0x646,0x3d41,0x64a,0x3c00,0x8650,0x208,0x60e,0x3c04,0x646,0x3c08,0x8662,0x3c0c,0x602,0x20c, @@ -712,407 +720,407 @@ static const uint16_t norm2_nfc_data_extraData[7722]={ 0x6132,0x61a6,0xe134,0x61a8,0x6132,0x61ac,0xe134,0x61ae,0x6132,0x61b2,0xe134,0x61b4,0x6132,0x61b8,0xe134,0x61ba, 0xe132,0x61ee,0xe132,0x61f0,0xe132,0x61f2,0xe132,0x61f4,0xe132,0x61fc,0xb489,0x2e82,0x2134,0xb489,0x2e82,0x2138, 0xb489,0x2e82,0x2156,0xb489,0x49c2,0x225c,0xb489,0x49c2,0x225e,0x3489,0xcf82,0x2696,0xb489,0xd5c2,0x2698,0x348b, -0x2c02,0x2978,0x348b,0x2e82,0x2976,0xb48b,0x2f42,0x297c,0xb48b,0x6bc2,0x2b74,0xb48b,0x6bc2,0x2b76,0,0xe622, -0x41,0x302,0x600,0x3d4c,0x602,0x3d48,0x606,0x3d54,0x8612,0x3d50,0xe622,0x41,0x308,0x8608,0x3bc,0xe622, -0x41,0x30a,0x8602,0x3f4,0xca22,0x43,0x327,0x8602,0x3c10,0xe622,0x45,0x302,0x600,0x3d80,0x602,0x3d7c, -0x606,0x3d88,0x8612,0x3d84,0xe622,0x49,0x308,0x8602,0x3c5c,0xe622,0x4f,0x302,0x600,0x3da4,0x602,0x3da0, -0x606,0x3dac,0x8612,0x3da8,0xe622,0x4f,0x303,0x602,0x3c98,0x608,0x458,0x8610,0x3c9c,0xe622,0x4f,0x308, -0x8608,0x454,0xe622,0x55,0x308,0x600,0x3b6,0x602,0x3ae,0x608,0x3aa,0x8618,0x3b2,0xe622,0x61,0x302, -0x600,0x3d4e,0x602,0x3d4a,0x606,0x3d56,0x8612,0x3d52,0xe622,0x61,0x308,0x8608,0x3be,0xe622,0x61,0x30a, -0x8602,0x3f6,0xca22,0x63,0x327,0x8602,0x3c12,0xe622,0x65,0x302,0x600,0x3d82,0x602,0x3d7e,0x606,0x3d8a, -0x8612,0x3d86,0xe622,0x69,0x308,0x8602,0x3c5e,0xe622,0x6f,0x302,0x600,0x3da6,0x602,0x3da2,0x606,0x3dae, -0x8612,0x3daa,0xe622,0x6f,0x303,0x602,0x3c9a,0x608,0x45a,0x8610,0x3c9e,0xe622,0x6f,0x308,0x8608,0x456, -0xe622,0x75,0x308,0x600,0x3b8,0x602,0x3b0,0x608,0x3ac,0x8618,0x3b4,0xe622,0x41,0x306,0x600,0x3d60, -0x602,0x3d5c,0x606,0x3d68,0x8612,0x3d64,0xe622,0x61,0x306,0x600,0x3d62,0x602,0x3d5e,0x606,0x3d6a,0x8612, -0x3d66,0xe622,0x45,0x304,0x600,0x3c28,0x8602,0x3c2c,0xe622,0x65,0x304,0x600,0x3c2a,0x8602,0x3c2e,0xe622, -0x4f,0x304,0x600,0x3ca0,0x8602,0x3ca4,0xe622,0x6f,0x304,0x600,0x3ca2,0x8602,0x3ca6,0xe622,0x53,0x301, -0x860e,0x3cc8,0xe622,0x73,0x301,0x860e,0x3cca,0xe622,0x53,0x30c,0x860e,0x3ccc,0xe622,0x73,0x30c,0x860e, -0x3cce,0xe622,0x55,0x303,0x8602,0x3cf0,0xe622,0x75,0x303,0x8602,0x3cf2,0xe622,0x55,0x304,0x8610,0x3cf4, -0xe622,0x75,0x304,0x8610,0x3cf6,0xd822,0x4f,0x31b,0x600,0x3db8,0x602,0x3db4,0x606,0x3dc0,0x612,0x3dbc, -0x8646,0x3dc4,0xd822,0x6f,0x31b,0x600,0x3dba,0x602,0x3db6,0x606,0x3dc2,0x612,0x3dbe,0x8646,0x3dc6,0xd822, -0x55,0x31b,0x600,0x3dd4,0x602,0x3dd0,0x606,0x3ddc,0x612,0x3dd8,0x8646,0x3de0,0xd822,0x75,0x31b,0x600, -0x3dd6,0x602,0x3dd2,0x606,0x3dde,0x612,0x3dda,0x8646,0x3de2,0xca22,0x4f,0x328,0x8608,0x3d8,0xca22,0x6f, -0x328,0x8608,0x3da,0xe622,0x41,0x307,0x8608,0x3c0,0xe622,0x61,0x307,0x8608,0x3c2,0xca22,0x45,0x327, -0x860c,0x3c38,0xca22,0x65,0x327,0x860c,0x3c3a,0xe622,0x4f,0x307,0x8608,0x460,0xe622,0x6f,0x307,0x8608, -0x462,0xe622,0x3b1,0x301,0x868a,0x3f68,0xe622,0x3b7,0x301,0x868a,0x3f88,0xe622,0x3b9,0x308,0x600,0x3fa4, -0x602,0x720,0x8684,0x3fae,0xe622,0x3c5,0x308,0x600,0x3fc4,0x602,0x760,0x8684,0x3fce,0xe622,0x3c9,0x301, -0x868a,0x3fe8,0x22,0xcc6,0xcc2,0x99aa,0x1996,0x22,0xdd9,0xdcf,0x9b94,0x1bba,0xdc22,0x4c,0x323,0x8608, -0x3c70,0xdc22,0x6c,0x323,0x8608,0x3c72,0xdc22,0x52,0x323,0x8608,0x3cb8,0xdc22,0x72,0x323,0x8608,0x3cba, -0xdc22,0x53,0x323,0x860e,0x3cd0,0xdc22,0x73,0x323,0x860e,0x3cd2,0xdc22,0x41,0x323,0x604,0x3d58,0x860c, -0x3d6c,0xdc22,0x61,0x323,0x604,0x3d5a,0x860c,0x3d6e,0xdc22,0x45,0x323,0x8604,0x3d8c,0xdc22,0x65,0x323, -0x8604,0x3d8e,0xdc22,0x4f,0x323,0x8604,0x3db0,0xdc22,0x6f,0x323,0x8604,0x3db2,0xe622,0x3b1,0x313,0x600, -0x3e05,0x602,0x3e09,0x684,0x3e0d,0x868a,0x3f00,0xe622,0x3b1,0x314,0x600,0x3e07,0x602,0x3e0b,0x684,0x3e0f, -0x868a,0x3f02,0x1f00,0xe663,0x3b1,0x313,0x300,0x868a,0x3f04,0x1f01,0xe663,0x3b1,0x314,0x300,0x868a,0x3f06, -0x1f00,0xe663,0x3b1,0x313,0x301,0x868a,0x3f08,0x1f01,0xe663,0x3b1,0x314,0x301,0x868a,0x3f0a,0x1f00,0xe663, -0x3b1,0x313,0x342,0x868a,0x3f0c,0x1f01,0xe663,0x3b1,0x314,0x342,0x868a,0x3f0e,0xe622,0x391,0x313,0x600, -0x3e15,0x602,0x3e19,0x684,0x3e1d,0x868a,0x3f10,0xe622,0x391,0x314,0x600,0x3e17,0x602,0x3e1b,0x684,0x3e1f, -0x868a,0x3f12,0x1f08,0xe663,0x391,0x313,0x300,0x868a,0x3f14,0x1f09,0xe663,0x391,0x314,0x300,0x868a,0x3f16, -0x1f08,0xe663,0x391,0x313,0x301,0x868a,0x3f18,0x1f09,0xe663,0x391,0x314,0x301,0x868a,0x3f1a,0x1f08,0xe663, -0x391,0x313,0x342,0x868a,0x3f1c,0x1f09,0xe663,0x391,0x314,0x342,0x868a,0x3f1e,0xe622,0x3b5,0x313,0x600, -0x3e24,0x8602,0x3e28,0xe622,0x3b5,0x314,0x600,0x3e26,0x8602,0x3e2a,0xe622,0x395,0x313,0x600,0x3e34,0x8602, -0x3e38,0xe622,0x395,0x314,0x600,0x3e36,0x8602,0x3e3a,0xe622,0x3b7,0x313,0x600,0x3e45,0x602,0x3e49,0x684, -0x3e4d,0x868a,0x3f20,0xe622,0x3b7,0x314,0x600,0x3e47,0x602,0x3e4b,0x684,0x3e4f,0x868a,0x3f22,0x1f20,0xe663, -0x3b7,0x313,0x300,0x868a,0x3f24,0x1f21,0xe663,0x3b7,0x314,0x300,0x868a,0x3f26,0x1f20,0xe663,0x3b7,0x313, -0x301,0x868a,0x3f28,0x1f21,0xe663,0x3b7,0x314,0x301,0x868a,0x3f2a,0x1f20,0xe663,0x3b7,0x313,0x342,0x868a, -0x3f2c,0x1f21,0xe663,0x3b7,0x314,0x342,0x868a,0x3f2e,0xe622,0x397,0x313,0x600,0x3e55,0x602,0x3e59,0x684, -0x3e5d,0x868a,0x3f30,0xe622,0x397,0x314,0x600,0x3e57,0x602,0x3e5b,0x684,0x3e5f,0x868a,0x3f32,0x1f28,0xe663, -0x397,0x313,0x300,0x868a,0x3f34,0x1f29,0xe663,0x397,0x314,0x300,0x868a,0x3f36,0x1f28,0xe663,0x397,0x313, -0x301,0x868a,0x3f38,0x1f29,0xe663,0x397,0x314,0x301,0x868a,0x3f3a,0x1f28,0xe663,0x397,0x313,0x342,0x868a, -0x3f3c,0x1f29,0xe663,0x397,0x314,0x342,0x868a,0x3f3e,0xe622,0x3b9,0x313,0x600,0x3e64,0x602,0x3e68,0x8684, -0x3e6c,0xe622,0x3b9,0x314,0x600,0x3e66,0x602,0x3e6a,0x8684,0x3e6e,0xe622,0x399,0x313,0x600,0x3e74,0x602, -0x3e78,0x8684,0x3e7c,0xe622,0x399,0x314,0x600,0x3e76,0x602,0x3e7a,0x8684,0x3e7e,0xe622,0x3bf,0x313,0x600, -0x3e84,0x8602,0x3e88,0xe622,0x3bf,0x314,0x600,0x3e86,0x8602,0x3e8a,0xe622,0x39f,0x313,0x600,0x3e94,0x8602, -0x3e98,0xe622,0x39f,0x314,0x600,0x3e96,0x8602,0x3e9a,0xe622,0x3c5,0x313,0x600,0x3ea4,0x602,0x3ea8,0x8684, -0x3eac,0xe622,0x3c5,0x314,0x600,0x3ea6,0x602,0x3eaa,0x8684,0x3eae,0xe622,0x3a5,0x314,0x600,0x3eb6,0x602, -0x3eba,0x8684,0x3ebe,0xe622,0x3c9,0x313,0x600,0x3ec5,0x602,0x3ec9,0x684,0x3ecd,0x868a,0x3f40,0xe622,0x3c9, -0x314,0x600,0x3ec7,0x602,0x3ecb,0x684,0x3ecf,0x868a,0x3f42,0x1f60,0xe663,0x3c9,0x313,0x300,0x868a,0x3f44, -0x1f61,0xe663,0x3c9,0x314,0x300,0x868a,0x3f46,0x1f60,0xe663,0x3c9,0x313,0x301,0x868a,0x3f48,0x1f61,0xe663, -0x3c9,0x314,0x301,0x868a,0x3f4a,0x1f60,0xe663,0x3c9,0x313,0x342,0x868a,0x3f4c,0x1f61,0xe663,0x3c9,0x314, -0x342,0x868a,0x3f4e,0xe622,0x3a9,0x313,0x600,0x3ed5,0x602,0x3ed9,0x684,0x3edd,0x868a,0x3f50,0xe622,0x3a9, -0x314,0x600,0x3ed7,0x602,0x3edb,0x684,0x3edf,0x868a,0x3f52,0x1f68,0xe663,0x3a9,0x313,0x300,0x868a,0x3f54, -0x1f69,0xe663,0x3a9,0x314,0x300,0x868a,0x3f56,0x1f68,0xe663,0x3a9,0x313,0x301,0x868a,0x3f58,0x1f69,0xe663, -0x3a9,0x314,0x301,0x868a,0x3f5a,0x1f68,0xe663,0x3a9,0x313,0x342,0x868a,0x3f5c,0x1f69,0xe663,0x3a9,0x314, -0x342,0x868a,0x3f5e,0xe622,0x3b1,0x300,0x868a,0x3f64,0xe622,0x3b7,0x300,0x868a,0x3f84,0xe622,0x3c9,0x300, -0x868a,0x3fe4,0xe622,0x3b1,0x342,0x868a,0x3f6e,0xe622,0x3b7,0x342,0x868a,0x3f8e,0xe622,0x3c9,0x342,0x868a, -0x3fee,0xe622,0x41,0x300,0xe622,0x41,0x301,0xe622,0x41,0x303,0xe622,0x45,0x300,0xe622,0x45,0x301, -0xe622,0x45,0x308,0xe622,0x49,0x300,0xe622,0x49,0x301,0xe622,0x49,0x302,0xe622,0x4e,0x303,0xe622, -0x4f,0x300,0xe622,0x4f,0x301,0xe622,0x55,0x300,0xe622,0x55,0x301,0xe622,0x55,0x302,0xe622,0x59, -0x301,0xe622,0x61,0x300,0xe622,0x61,0x301,0xe622,0x61,0x303,0xe622,0x65,0x300,0xe622,0x65,0x301, -0xe622,0x65,0x308,0xe622,0x69,0x300,0xe622,0x69,0x301,0xe622,0x69,0x302,0xe622,0x6e,0x303,0xe622, -0x6f,0x300,0xe622,0x6f,0x301,0xe622,0x75,0x300,0xe622,0x75,0x301,0xe622,0x75,0x302,0xe622,0x79, -0x301,0xe622,0x79,0x308,0xe622,0x41,0x304,0xe622,0x61,0x304,0xca02,0x41,0x328,0xca02,0x61,0x328, -0xe622,0x43,0x301,0xe622,0x63,0x301,0xe622,0x43,0x302,0xe622,0x63,0x302,0xe622,0x43,0x307,0xe622, -0x63,0x307,0xe622,0x43,0x30c,0xe622,0x63,0x30c,0xe622,0x44,0x30c,0xe622,0x64,0x30c,0xe622,0x45, -0x306,0xe622,0x65,0x306,0xe622,0x45,0x307,0xe622,0x65,0x307,0xca02,0x45,0x328,0xca02,0x65,0x328, -0xe622,0x45,0x30c,0xe622,0x65,0x30c,0xe622,0x47,0x302,0xe622,0x67,0x302,0xe622,0x47,0x306,0xe622, -0x67,0x306,0xe622,0x47,0x307,0xe622,0x67,0x307,0xca02,0x47,0x327,0xca02,0x67,0x327,0xe622,0x48, -0x302,0xe622,0x68,0x302,0xe622,0x49,0x303,0xe622,0x69,0x303,0xe622,0x49,0x304,0xe622,0x69,0x304, -0xe622,0x49,0x306,0xe622,0x69,0x306,0xca02,0x49,0x328,0xca02,0x69,0x328,0xe622,0x49,0x307,0xe602, -0x4a,0x302,0xe602,0x6a,0x302,0xca02,0x4b,0x327,0xca02,0x6b,0x327,0xe622,0x4c,0x301,0xe622,0x6c, -0x301,0xca02,0x4c,0x327,0xca02,0x6c,0x327,0xe622,0x4c,0x30c,0xe622,0x6c,0x30c,0xe622,0x4e,0x301, -0xe622,0x6e,0x301,0xca02,0x4e,0x327,0xca02,0x6e,0x327,0xe622,0x4e,0x30c,0xe622,0x6e,0x30c,0xe622, -0x4f,0x306,0xe622,0x6f,0x306,0xe622,0x4f,0x30b,0xe622,0x6f,0x30b,0xe622,0x52,0x301,0xe622,0x72, -0x301,0xca02,0x52,0x327,0xca02,0x72,0x327,0xe622,0x52,0x30c,0xe622,0x72,0x30c,0xe622,0x53,0x302, -0xe622,0x73,0x302,0xca02,0x53,0x327,0xca02,0x73,0x327,0xca02,0x54,0x327,0xca02,0x74,0x327,0xe622, -0x54,0x30c,0xe622,0x74,0x30c,0xe622,0x55,0x306,0xe622,0x75,0x306,0xe622,0x55,0x30a,0xe622,0x75, -0x30a,0xe622,0x55,0x30b,0xe622,0x75,0x30b,0xca02,0x55,0x328,0xca02,0x75,0x328,0xe622,0x57,0x302, -0xe622,0x77,0x302,0xe622,0x59,0x302,0xe622,0x79,0x302,0xe622,0x59,0x308,0xe622,0x5a,0x301,0xe622, -0x7a,0x301,0xe622,0x5a,0x307,0xe622,0x7a,0x307,0xe622,0x5a,0x30c,0xe622,0x7a,0x30c,0xe622,0x41, -0x30c,0xe622,0x61,0x30c,0xe622,0x49,0x30c,0xe622,0x69,0x30c,0xe622,0x4f,0x30c,0xe622,0x6f,0x30c, -0xe622,0x55,0x30c,0xe622,0x75,0x30c,0xdc,0xe663,0x55,0x308,0x304,0xfc,0xe663,0x75,0x308,0x304, -0xdc,0xe663,0x55,0x308,0x301,0xfc,0xe663,0x75,0x308,0x301,0xdc,0xe663,0x55,0x308,0x30c,0xfc, -0xe663,0x75,0x308,0x30c,0xdc,0xe663,0x55,0x308,0x300,0xfc,0xe663,0x75,0x308,0x300,0xc4,0xe663, -0x41,0x308,0x304,0xe4,0xe663,0x61,0x308,0x304,0x226,0xe663,0x41,0x307,0x304,0x227,0xe663,0x61, -0x307,0x304,0xe602,0xc6,0x304,0xe602,0xe6,0x304,0xe622,0x47,0x30c,0xe622,0x67,0x30c,0xe622,0x4b, -0x30c,0xe622,0x6b,0x30c,0x1ea,0xe643,0x4f,0x328,0x304,0x1eb,0xe643,0x6f,0x328,0x304,0xe602,0x1b7, -0x30c,0xe602,0x292,0x30c,0xe602,0x6a,0x30c,0xe622,0x47,0x301,0xe622,0x67,0x301,0xe622,0x4e,0x300, -0xe622,0x6e,0x300,0xc5,0xe663,0x41,0x30a,0x301,0xe5,0xe663,0x61,0x30a,0x301,0xe602,0xc6,0x301, -0xe602,0xe6,0x301,0xe602,0xd8,0x301,0xe602,0xf8,0x301,0xe622,0x41,0x30f,0xe622,0x61,0x30f,0xe622, -0x41,0x311,0xe622,0x61,0x311,0xe622,0x45,0x30f,0xe622,0x65,0x30f,0xe622,0x45,0x311,0xe622,0x65, -0x311,0xe622,0x49,0x30f,0xe622,0x69,0x30f,0xe622,0x49,0x311,0xe622,0x69,0x311,0xe622,0x4f,0x30f, -0xe622,0x6f,0x30f,0xe622,0x4f,0x311,0xe622,0x6f,0x311,0xe622,0x52,0x30f,0xe622,0x72,0x30f,0xe622, -0x52,0x311,0xe622,0x72,0x311,0xe622,0x55,0x30f,0xe622,0x75,0x30f,0xe622,0x55,0x311,0xe622,0x75, -0x311,0xdc22,0x53,0x326,0xdc22,0x73,0x326,0xdc22,0x54,0x326,0xdc22,0x74,0x326,0xe622,0x48,0x30c, -0xe622,0x68,0x30c,0xd6,0xe663,0x4f,0x308,0x304,0xf6,0xe663,0x6f,0x308,0x304,0xd5,0xe663,0x4f, -0x303,0x304,0xf5,0xe663,0x6f,0x303,0x304,0x22e,0xe663,0x4f,0x307,0x304,0x22f,0xe663,0x6f,0x307, -0x304,0xe622,0x59,0x304,0xe622,0x79,0x304,0xe602,0xa8,0x301,0xe602,0x391,0x301,0xe602,0x395,0x301, -0xe602,0x397,0x301,0xe602,0x399,0x301,0xe602,0x39f,0x301,0xe602,0x3a5,0x301,0xe602,0x3a9,0x301,0x3ca, -0xe643,0x3b9,0x308,0x301,0xe602,0x399,0x308,0xe602,0x3a5,0x308,0xe602,0x3b5,0x301,0xe602,0x3b9,0x301, -0x3cb,0xe643,0x3c5,0x308,0x301,0xe602,0x3bf,0x301,0xe602,0x3c5,0x301,0xe602,0x3d2,0x301,0xe602,0x3d2, -0x308,0xe602,0x415,0x300,0xe602,0x415,0x308,0xe602,0x413,0x301,0xe602,0x406,0x308,0xe602,0x41a,0x301, -0xe602,0x418,0x300,0xe602,0x423,0x306,0xe602,0x418,0x306,0xe602,0x438,0x306,0xe602,0x435,0x300,0xe602, -0x435,0x308,0xe602,0x433,0x301,0xe602,0x456,0x308,0xe602,0x43a,0x301,0xe602,0x438,0x300,0xe602,0x443, -0x306,0xe602,0x474,0x30f,0xe602,0x475,0x30f,0xe602,0x416,0x306,0xe602,0x436,0x306,0xe602,0x410,0x306, -0xe602,0x430,0x306,0xe602,0x410,0x308,0xe602,0x430,0x308,0xe602,0x415,0x306,0xe602,0x435,0x306,0xe602, -0x4d8,0x308,0xe602,0x4d9,0x308,0xe602,0x416,0x308,0xe602,0x436,0x308,0xe602,0x417,0x308,0xe602,0x437, -0x308,0xe602,0x418,0x304,0xe602,0x438,0x304,0xe602,0x418,0x308,0xe602,0x438,0x308,0xe602,0x41e,0x308, -0xe602,0x43e,0x308,0xe602,0x4e8,0x308,0xe602,0x4e9,0x308,0xe602,0x42d,0x308,0xe602,0x44d,0x308,0xe602, -0x423,0x304,0xe602,0x443,0x304,0xe602,0x423,0x308,0xe602,0x443,0x308,0xe602,0x423,0x30b,0xe602,0x443, -0x30b,0xe602,0x427,0x308,0xe602,0x447,0x308,0xe602,0x42b,0x308,0xe602,0x44b,0x308,0xe622,0x627,0x653, -0xe622,0x627,0x654,0xe602,0x648,0x654,0xdc02,0x627,0x655,0xe602,0x64a,0x654,0xe602,0x6d5,0x654,0xe602, -0x6c1,0x654,0xe602,0x6d2,0x654,0x702,0x928,0x93c,0x702,0x930,0x93c,0x702,0x933,0x93c,2,0x9c7, -0x9be,2,0x9c7,0x9d7,2,0xb47,0xb56,2,0xb47,0xb3e,2,0xb47,0xb57,2,0xb92,0xbd7, -2,0xbc6,0xbbe,2,0xbc7,0xbbe,2,0xbc6,0xbd7,0x5b02,0xc46,0xc56,2,0xcbf,0xcd5,2, -0xcc6,0xcd5,2,0xcc6,0xcd6,0xcca,0x43,0xcc6,0xcc2,0xcd5,2,0xd46,0xd3e,2,0xd47,0xd3e, -2,0xd46,0xd57,0x902,0xdd9,0xdca,0xddc,0x943,0xdd9,0xdcf,0xdca,2,0xdd9,0xddf,2,0x1025, -0x102e,2,0x1b05,0x1b35,2,0x1b07,0x1b35,2,0x1b09,0x1b35,2,0x1b0b,0x1b35,2,0x1b0d,0x1b35, -2,0x1b11,0x1b35,2,0x1b3a,0x1b35,2,0x1b3c,0x1b35,2,0x1b3e,0x1b35,2,0x1b3f,0x1b35,2, -0x1b42,0x1b35,0xdc22,0x41,0x325,0xdc22,0x61,0x325,0xe622,0x42,0x307,0xe622,0x62,0x307,0xdc02,0x42, -0x323,0xdc02,0x62,0x323,0xdc02,0x42,0x331,0xdc02,0x62,0x331,0xc7,0xe643,0x43,0x327,0x301,0xe7, -0xe643,0x63,0x327,0x301,0xe622,0x44,0x307,0xe622,0x64,0x307,0xdc22,0x44,0x323,0xdc22,0x64,0x323, -0xdc22,0x44,0x331,0xdc22,0x64,0x331,0xca02,0x44,0x327,0xca02,0x64,0x327,0xdc22,0x44,0x32d,0xdc22, -0x64,0x32d,0x112,0xe663,0x45,0x304,0x300,0x113,0xe663,0x65,0x304,0x300,0x112,0xe663,0x45,0x304, -0x301,0x113,0xe663,0x65,0x304,0x301,0xdc22,0x45,0x32d,0xdc22,0x65,0x32d,0xdc22,0x45,0x330,0xdc22, -0x65,0x330,0x228,0xe643,0x45,0x327,0x306,0x229,0xe643,0x65,0x327,0x306,0xe602,0x46,0x307,0xe602, -0x66,0x307,0xe622,0x47,0x304,0xe622,0x67,0x304,0xe622,0x48,0x307,0xe622,0x68,0x307,0xdc22,0x48, -0x323,0xdc22,0x68,0x323,0xe622,0x48,0x308,0xe622,0x68,0x308,0xca02,0x48,0x327,0xca02,0x68,0x327, -0xdc22,0x48,0x32e,0xdc22,0x68,0x32e,0xdc22,0x49,0x330,0xdc22,0x69,0x330,0xcf,0xe663,0x49,0x308, -0x301,0xef,0xe663,0x69,0x308,0x301,0xe622,0x4b,0x301,0xe622,0x6b,0x301,0xdc22,0x4b,0x323,0xdc22, -0x6b,0x323,0xdc22,0x4b,0x331,0xdc22,0x6b,0x331,0x1e36,0xe663,0x4c,0x323,0x304,0x1e37,0xe663,0x6c, -0x323,0x304,0xdc22,0x4c,0x331,0xdc22,0x6c,0x331,0xdc22,0x4c,0x32d,0xdc22,0x6c,0x32d,0xe622,0x4d, -0x301,0xe622,0x6d,0x301,0xe622,0x4d,0x307,0xe622,0x6d,0x307,0xdc02,0x4d,0x323,0xdc02,0x6d,0x323, -0xe622,0x4e,0x307,0xe622,0x6e,0x307,0xdc22,0x4e,0x323,0xdc22,0x6e,0x323,0xdc22,0x4e,0x331,0xdc22, -0x6e,0x331,0xdc22,0x4e,0x32d,0xdc22,0x6e,0x32d,0xd5,0xe663,0x4f,0x303,0x301,0xf5,0xe663,0x6f, -0x303,0x301,0xd5,0xe663,0x4f,0x303,0x308,0xf5,0xe663,0x6f,0x303,0x308,0x14c,0xe663,0x4f,0x304, -0x300,0x14d,0xe663,0x6f,0x304,0x300,0x14c,0xe663,0x4f,0x304,0x301,0x14d,0xe663,0x6f,0x304,0x301, -0xe602,0x50,0x301,0xe602,0x70,0x301,0xe602,0x50,0x307,0xe602,0x70,0x307,0xe622,0x52,0x307,0xe622, -0x72,0x307,0x1e5a,0xe663,0x52,0x323,0x304,0x1e5b,0xe663,0x72,0x323,0x304,0xdc22,0x52,0x331,0xdc22, -0x72,0x331,0xe622,0x53,0x307,0xe622,0x73,0x307,0x15a,0xe663,0x53,0x301,0x307,0x15b,0xe663,0x73, -0x301,0x307,0x160,0xe663,0x53,0x30c,0x307,0x161,0xe663,0x73,0x30c,0x307,0x1e62,0xe663,0x53,0x323, -0x307,0x1e63,0xe663,0x73,0x323,0x307,0xe622,0x54,0x307,0xe622,0x74,0x307,0xdc22,0x54,0x323,0xdc22, -0x74,0x323,0xdc22,0x54,0x331,0xdc22,0x74,0x331,0xdc22,0x54,0x32d,0xdc22,0x74,0x32d,0xdc22,0x55, -0x324,0xdc22,0x75,0x324,0xdc22,0x55,0x330,0xdc22,0x75,0x330,0xdc22,0x55,0x32d,0xdc22,0x75,0x32d, -0x168,0xe663,0x55,0x303,0x301,0x169,0xe663,0x75,0x303,0x301,0x16a,0xe663,0x55,0x304,0x308,0x16b, -0xe663,0x75,0x304,0x308,0xe622,0x56,0x303,0xe622,0x76,0x303,0xdc02,0x56,0x323,0xdc02,0x76,0x323, -0xe622,0x57,0x300,0xe622,0x77,0x300,0xe622,0x57,0x301,0xe622,0x77,0x301,0xe622,0x57,0x308,0xe622, -0x77,0x308,0xe622,0x57,0x307,0xe622,0x77,0x307,0xdc02,0x57,0x323,0xdc02,0x77,0x323,0xe602,0x58, -0x307,0xe602,0x78,0x307,0xe602,0x58,0x308,0xe602,0x78,0x308,0xe622,0x59,0x307,0xe622,0x79,0x307, -0xe622,0x5a,0x302,0xe622,0x7a,0x302,0xdc02,0x5a,0x323,0xdc02,0x7a,0x323,0xdc02,0x5a,0x331,0xdc02, -0x7a,0x331,0xdc22,0x68,0x331,0xe622,0x74,0x308,0xe622,0x77,0x30a,0xe622,0x79,0x30a,0xe602,0x17f, -0x307,0xe622,0x41,0x309,0xe622,0x61,0x309,0xc2,0xe663,0x41,0x302,0x301,0xe2,0xe663,0x61,0x302, -0x301,0xc2,0xe663,0x41,0x302,0x300,0xe2,0xe663,0x61,0x302,0x300,0xc2,0xe663,0x41,0x302,0x309, -0xe2,0xe663,0x61,0x302,0x309,0xc2,0xe663,0x41,0x302,0x303,0xe2,0xe663,0x61,0x302,0x303,0x1ea0, -0xe663,0x41,0x323,0x302,0x1ea1,0xe663,0x61,0x323,0x302,0x102,0xe663,0x41,0x306,0x301,0x103,0xe663, -0x61,0x306,0x301,0x102,0xe663,0x41,0x306,0x300,0x103,0xe663,0x61,0x306,0x300,0x102,0xe663,0x41, -0x306,0x309,0x103,0xe663,0x61,0x306,0x309,0x102,0xe663,0x41,0x306,0x303,0x103,0xe663,0x61,0x306, -0x303,0x1ea0,0xe663,0x41,0x323,0x306,0x1ea1,0xe663,0x61,0x323,0x306,0xe622,0x45,0x309,0xe622,0x65, -0x309,0xe622,0x45,0x303,0xe622,0x65,0x303,0xca,0xe663,0x45,0x302,0x301,0xea,0xe663,0x65,0x302, -0x301,0xca,0xe663,0x45,0x302,0x300,0xea,0xe663,0x65,0x302,0x300,0xca,0xe663,0x45,0x302,0x309, -0xea,0xe663,0x65,0x302,0x309,0xca,0xe663,0x45,0x302,0x303,0xea,0xe663,0x65,0x302,0x303,0x1eb8, -0xe663,0x45,0x323,0x302,0x1eb9,0xe663,0x65,0x323,0x302,0xe622,0x49,0x309,0xe622,0x69,0x309,0xdc22, -0x49,0x323,0xdc22,0x69,0x323,0xe622,0x4f,0x309,0xe622,0x6f,0x309,0xd4,0xe663,0x4f,0x302,0x301, -0xf4,0xe663,0x6f,0x302,0x301,0xd4,0xe663,0x4f,0x302,0x300,0xf4,0xe663,0x6f,0x302,0x300,0xd4, -0xe663,0x4f,0x302,0x309,0xf4,0xe663,0x6f,0x302,0x309,0xd4,0xe663,0x4f,0x302,0x303,0xf4,0xe663, -0x6f,0x302,0x303,0x1ecc,0xe663,0x4f,0x323,0x302,0x1ecd,0xe663,0x6f,0x323,0x302,0x1a0,0xe663,0x4f, -0x31b,0x301,0x1a1,0xe663,0x6f,0x31b,0x301,0x1a0,0xe663,0x4f,0x31b,0x300,0x1a1,0xe663,0x6f,0x31b, -0x300,0x1a0,0xe663,0x4f,0x31b,0x309,0x1a1,0xe663,0x6f,0x31b,0x309,0x1a0,0xe663,0x4f,0x31b,0x303, -0x1a1,0xe663,0x6f,0x31b,0x303,0x1a0,0xdc63,0x4f,0x31b,0x323,0x1a1,0xdc63,0x6f,0x31b,0x323,0xdc22, -0x55,0x323,0xdc22,0x75,0x323,0xe622,0x55,0x309,0xe622,0x75,0x309,0x1af,0xe663,0x55,0x31b,0x301, -0x1b0,0xe663,0x75,0x31b,0x301,0x1af,0xe663,0x55,0x31b,0x300,0x1b0,0xe663,0x75,0x31b,0x300,0x1af, -0xe663,0x55,0x31b,0x309,0x1b0,0xe663,0x75,0x31b,0x309,0x1af,0xe663,0x55,0x31b,0x303,0x1b0,0xe663, -0x75,0x31b,0x303,0x1af,0xdc63,0x55,0x31b,0x323,0x1b0,0xdc63,0x75,0x31b,0x323,0xe622,0x59,0x300, -0xe622,0x79,0x300,0xdc02,0x59,0x323,0xdc02,0x79,0x323,0xe622,0x59,0x309,0xe622,0x79,0x309,0xe622, -0x59,0x303,0xe622,0x79,0x303,0x1f10,0xe643,0x3b5,0x313,0x300,0x1f11,0xe643,0x3b5,0x314,0x300,0x1f10, -0xe643,0x3b5,0x313,0x301,0x1f11,0xe643,0x3b5,0x314,0x301,0x1f18,0xe643,0x395,0x313,0x300,0x1f19,0xe643, -0x395,0x314,0x300,0x1f18,0xe643,0x395,0x313,0x301,0x1f19,0xe643,0x395,0x314,0x301,0x1f30,0xe643,0x3b9, -0x313,0x300,0x1f31,0xe643,0x3b9,0x314,0x300,0x1f30,0xe643,0x3b9,0x313,0x301,0x1f31,0xe643,0x3b9,0x314, -0x301,0x1f30,0xe643,0x3b9,0x313,0x342,0x1f31,0xe643,0x3b9,0x314,0x342,0x1f38,0xe643,0x399,0x313,0x300, -0x1f39,0xe643,0x399,0x314,0x300,0x1f38,0xe643,0x399,0x313,0x301,0x1f39,0xe643,0x399,0x314,0x301,0x1f38, -0xe643,0x399,0x313,0x342,0x1f39,0xe643,0x399,0x314,0x342,0x1f40,0xe643,0x3bf,0x313,0x300,0x1f41,0xe643, -0x3bf,0x314,0x300,0x1f40,0xe643,0x3bf,0x313,0x301,0x1f41,0xe643,0x3bf,0x314,0x301,0x1f48,0xe643,0x39f, -0x313,0x300,0x1f49,0xe643,0x39f,0x314,0x300,0x1f48,0xe643,0x39f,0x313,0x301,0x1f49,0xe643,0x39f,0x314, -0x301,0x1f50,0xe643,0x3c5,0x313,0x300,0x1f51,0xe643,0x3c5,0x314,0x300,0x1f50,0xe643,0x3c5,0x313,0x301, -0x1f51,0xe643,0x3c5,0x314,0x301,0x1f50,0xe643,0x3c5,0x313,0x342,0x1f51,0xe643,0x3c5,0x314,0x342,0x1f59, -0xe643,0x3a5,0x314,0x300,0x1f59,0xe643,0x3a5,0x314,0x301,0x1f59,0xe643,0x3a5,0x314,0x342,0xe602,0x3b5, -0x300,0xe602,0x3b9,0x300,0xe602,0x3bf,0x300,0xe602,0x3c5,0x300,0x1f00,0xf063,0x3b1,0x313,0x345,0x1f01, -0xf063,0x3b1,0x314,0x345,0x1f02,0x345,2,0xf044,0x3b1,0x313,0x300,0x345,0x1f03,0x345,2,0xf044, -0x3b1,0x314,0x300,0x345,0x1f04,0x345,2,0xf044,0x3b1,0x313,0x301,0x345,0x1f05,0x345,2,0xf044, -0x3b1,0x314,0x301,0x345,0x1f06,0x345,2,0xf044,0x3b1,0x313,0x342,0x345,0x1f07,0x345,2,0xf044, -0x3b1,0x314,0x342,0x345,0x1f08,0xf063,0x391,0x313,0x345,0x1f09,0xf063,0x391,0x314,0x345,0x1f0a,0x345, -2,0xf044,0x391,0x313,0x300,0x345,0x1f0b,0x345,2,0xf044,0x391,0x314,0x300,0x345,0x1f0c,0x345, -2,0xf044,0x391,0x313,0x301,0x345,0x1f0d,0x345,2,0xf044,0x391,0x314,0x301,0x345,0x1f0e,0x345, -2,0xf044,0x391,0x313,0x342,0x345,0x1f0f,0x345,2,0xf044,0x391,0x314,0x342,0x345,0x1f20,0xf063, -0x3b7,0x313,0x345,0x1f21,0xf063,0x3b7,0x314,0x345,0x1f22,0x345,2,0xf044,0x3b7,0x313,0x300,0x345, -0x1f23,0x345,2,0xf044,0x3b7,0x314,0x300,0x345,0x1f24,0x345,2,0xf044,0x3b7,0x313,0x301,0x345, -0x1f25,0x345,2,0xf044,0x3b7,0x314,0x301,0x345,0x1f26,0x345,2,0xf044,0x3b7,0x313,0x342,0x345, -0x1f27,0x345,2,0xf044,0x3b7,0x314,0x342,0x345,0x1f28,0xf063,0x397,0x313,0x345,0x1f29,0xf063,0x397, -0x314,0x345,0x1f2a,0x345,2,0xf044,0x397,0x313,0x300,0x345,0x1f2b,0x345,2,0xf044,0x397,0x314, -0x300,0x345,0x1f2c,0x345,2,0xf044,0x397,0x313,0x301,0x345,0x1f2d,0x345,2,0xf044,0x397,0x314, -0x301,0x345,0x1f2e,0x345,2,0xf044,0x397,0x313,0x342,0x345,0x1f2f,0x345,2,0xf044,0x397,0x314, -0x342,0x345,0x1f60,0xf063,0x3c9,0x313,0x345,0x1f61,0xf063,0x3c9,0x314,0x345,0x1f62,0x345,2,0xf044, -0x3c9,0x313,0x300,0x345,0x1f63,0x345,2,0xf044,0x3c9,0x314,0x300,0x345,0x1f64,0x345,2,0xf044, -0x3c9,0x313,0x301,0x345,0x1f65,0x345,2,0xf044,0x3c9,0x314,0x301,0x345,0x1f66,0x345,2,0xf044, -0x3c9,0x313,0x342,0x345,0x1f67,0x345,2,0xf044,0x3c9,0x314,0x342,0x345,0x1f68,0xf063,0x3a9,0x313, -0x345,0x1f69,0xf063,0x3a9,0x314,0x345,0x1f6a,0x345,2,0xf044,0x3a9,0x313,0x300,0x345,0x1f6b,0x345, -2,0xf044,0x3a9,0x314,0x300,0x345,0x1f6c,0x345,2,0xf044,0x3a9,0x313,0x301,0x345,0x1f6d,0x345, -2,0xf044,0x3a9,0x314,0x301,0x345,0x1f6e,0x345,2,0xf044,0x3a9,0x313,0x342,0x345,0x1f6f,0x345, -2,0xf044,0x3a9,0x314,0x342,0x345,0xe602,0x3b1,0x306,0xe602,0x3b1,0x304,0x1f70,0xf043,0x3b1,0x300, -0x345,0xf022,0x3b1,0x345,0x3ac,0xf043,0x3b1,0x301,0x345,0x1fb6,0xf043,0x3b1,0x342,0x345,0xe602,0x391, -0x306,0xe602,0x391,0x304,0xe602,0x391,0x300,0xf022,0x391,0x345,0xe602,0xa8,0x342,0x1f74,0xf043,0x3b7, -0x300,0x345,0xf022,0x3b7,0x345,0x3ae,0xf043,0x3b7,0x301,0x345,0x1fc6,0xf043,0x3b7,0x342,0x345,0xe602, -0x395,0x300,0xe602,0x397,0x300,0xf022,0x397,0x345,0xe602,0x1fbf,0x300,0xe602,0x1fbf,0x301,0xe602,0x1fbf, -0x342,0xe602,0x3b9,0x306,0xe602,0x3b9,0x304,0x3ca,0xe643,0x3b9,0x308,0x300,0xe602,0x3b9,0x342,0x3ca, -0xe643,0x3b9,0x308,0x342,0xe602,0x399,0x306,0xe602,0x399,0x304,0xe602,0x399,0x300,0xe602,0x1ffe,0x300, -0xe602,0x1ffe,0x301,0xe602,0x1ffe,0x342,0xe602,0x3c5,0x306,0xe602,0x3c5,0x304,0x3cb,0xe643,0x3c5,0x308, -0x300,0xe602,0x3c1,0x313,0xe602,0x3c1,0x314,0xe602,0x3c5,0x342,0x3cb,0xe643,0x3c5,0x308,0x342,0xe602, -0x3a5,0x306,0xe602,0x3a5,0x304,0xe602,0x3a5,0x300,0xe602,0x3a1,0x314,0xe602,0xa8,0x300,0x1f7c,0xf043, -0x3c9,0x300,0x345,0xf022,0x3c9,0x345,0x3ce,0xf043,0x3c9,0x301,0x345,0x1ff6,0xf043,0x3c9,0x342,0x345, -0xe602,0x39f,0x300,0xe602,0x3a9,0x300,0xf022,0x3a9,0x345,0x102,0x2190,0x338,0x102,0x2192,0x338,0x102, -0x2194,0x338,0x102,0x21d0,0x338,0x102,0x21d4,0x338,0x102,0x21d2,0x338,0x102,0x2203,0x338,0x102,0x2208, -0x338,0x102,0x220b,0x338,0x102,0x2223,0x338,0x102,0x2225,0x338,0x102,0x223c,0x338,0x102,0x2243,0x338, -0x102,0x2245,0x338,0x102,0x2248,0x338,0x102,0x3d,0x338,0x102,0x2261,0x338,0x102,0x224d,0x338,0x102, -0x3c,0x338,0x102,0x3e,0x338,0x102,0x2264,0x338,0x102,0x2265,0x338,0x102,0x2272,0x338,0x102,0x2273, -0x338,0x102,0x2276,0x338,0x102,0x2277,0x338,0x102,0x227a,0x338,0x102,0x227b,0x338,0x102,0x2282,0x338, -0x102,0x2283,0x338,0x102,0x2286,0x338,0x102,0x2287,0x338,0x102,0x22a2,0x338,0x102,0x22a8,0x338,0x102, -0x22a9,0x338,0x102,0x22ab,0x338,0x102,0x227c,0x338,0x102,0x227d,0x338,0x102,0x2291,0x338,0x102,0x2292, -0x338,0x102,0x22b2,0x338,0x102,0x22b3,0x338,0x102,0x22b4,0x338,0x102,0x22b5,0x338,0x802,0x304b,0x3099, -0x802,0x304d,0x3099,0x802,0x304f,0x3099,0x802,0x3051,0x3099,0x802,0x3053,0x3099,0x802,0x3055,0x3099,0x802, -0x3057,0x3099,0x802,0x3059,0x3099,0x802,0x305b,0x3099,0x802,0x305d,0x3099,0x802,0x305f,0x3099,0x802,0x3061, -0x3099,0x802,0x3064,0x3099,0x802,0x3066,0x3099,0x802,0x3068,0x3099,0x802,0x306f,0x3099,0x802,0x306f,0x309a, -0x802,0x3072,0x3099,0x802,0x3072,0x309a,0x802,0x3075,0x3099,0x802,0x3075,0x309a,0x802,0x3078,0x3099,0x802, -0x3078,0x309a,0x802,0x307b,0x3099,0x802,0x307b,0x309a,0x802,0x3046,0x3099,0x802,0x309d,0x3099,0x802,0x30ab, -0x3099,0x802,0x30ad,0x3099,0x802,0x30af,0x3099,0x802,0x30b1,0x3099,0x802,0x30b3,0x3099,0x802,0x30b5,0x3099, -0x802,0x30b7,0x3099,0x802,0x30b9,0x3099,0x802,0x30bb,0x3099,0x802,0x30bd,0x3099,0x802,0x30bf,0x3099,0x802, -0x30c1,0x3099,0x802,0x30c4,0x3099,0x802,0x30c6,0x3099,0x802,0x30c8,0x3099,0x802,0x30cf,0x3099,0x802,0x30cf, -0x309a,0x802,0x30d2,0x3099,0x802,0x30d2,0x309a,0x802,0x30d5,0x3099,0x802,0x30d5,0x309a,0x802,0x30d8,0x3099, -0x802,0x30d8,0x309a,0x802,0x30db,0x3099,0x802,0x30db,0x309a,0x802,0x30a6,0x3099,0x802,0x30ef,0x3099,0x802, -0x30f0,0x3099,0x802,0x30f1,0x3099,0x802,0x30f2,0x3099,0x802,0x30fd,0x3099,0x704,0xd804,0xdc99,0xd804,0xdcba, -0x704,0xd804,0xdc9b,0xd804,0xdcba,0x704,0xd804,0xdca5,0xd804,0xdcba,4,0xd804,0xdd31,0xd804,0xdd27,4, -0xd804,0xdd32,0xd804,0xdd27,4,0xd804,0xdf47,0xd804,0xdf3e,4,0xd804,0xdf47,0xd804,0xdf57,4,0xd805, -0xdcb9,0xd805,0xdcba,4,0xd805,0xdcb9,0xd805,0xdcb0,4,0xd805,0xdcb9,0xd805,0xdcbd,4,0xd805,0xddb8, -0xd805,0xddaf,4,0xd805,0xddb9,0xd805,0xddaf,0xe6e6,0xe6a1,0x300,0xe6e6,0xe6a1,0x301,0xe6e6,0xe6a1,0x313, -0xe6e6,0xe6a2,0x308,0x301,1,0x2b9,1,0x3b,1,0xb7,0x702,0x915,0x93c,0x702,0x916,0x93c, -0x702,0x917,0x93c,0x702,0x91c,0x93c,0x702,0x921,0x93c,0x702,0x922,0x93c,0x702,0x92b,0x93c,0x702, -0x92f,0x93c,0x702,0x9a1,0x9bc,0x702,0x9a2,0x9bc,0x702,0x9af,0x9bc,0x702,0xa32,0xa3c,0x702,0xa38, -0xa3c,0x702,0xa16,0xa3c,0x702,0xa17,0xa3c,0x702,0xa1c,0xa3c,0x702,0xa2b,0xa3c,0x702,0xb21,0xb3c, -0x702,0xb22,0xb3c,2,0xf42,0xfb7,2,0xf4c,0xfb7,2,0xf51,0xfb7,2,0xf56,0xfb7,2, -0xf5b,0xfb7,2,0xf40,0xfb5,0x8100,0x82a2,0xf71,0xf72,0x8100,0x84a2,0xf71,0xf74,0x8202,0xfb2,0xf80, -0x8202,0xfb3,0xf80,0x8100,0x82a2,0xf71,0xf80,2,0xf92,0xfb7,2,0xf9c,0xfb7,2,0xfa1,0xfb7, -2,0xfa6,0xfb7,2,0xfab,0xfb7,2,0xf90,0xfb5,0x3ac,0xe662,0x3b1,0x301,0x3ad,0xe642,0x3b5, -0x301,0x3ae,0xe662,0x3b7,0x301,0x3af,0xe642,0x3b9,0x301,0x3cc,0xe642,0x3bf,0x301,0x3cd,0xe642,0x3c5, -0x301,0x3ce,0xe662,0x3c9,0x301,0x386,0xe642,0x391,0x301,0x21,0x3b9,0x388,0xe642,0x395,0x301,0x389, -0xe642,0x397,0x301,0x390,1,0xe643,0x3b9,0x308,0x301,0x38a,0xe642,0x399,0x301,0x3b0,1,0xe643, -0x3c5,0x308,0x301,0x38e,0xe642,0x3a5,0x301,0x385,0xe642,0xa8,0x301,1,0x60,0x38c,0xe642,0x39f, -0x301,0x38f,0xe642,0x3a9,0x301,1,0xb4,0x21,0x3a9,0x21,0x4b,0xc5,0xe662,0x41,0x30a,1, -0x3008,1,0x3009,0x102,0x2add,0x338,1,0x8c48,1,0x66f4,1,0x8eca,1,0x8cc8,1,0x6ed1, -1,0x4e32,1,0x53e5,1,0x9f9c,1,0x5951,1,0x91d1,1,0x5587,1,0x5948,1,0x61f6, -1,0x7669,1,0x7f85,1,0x863f,1,0x87ba,1,0x88f8,1,0x908f,1,0x6a02,1,0x6d1b, -1,0x70d9,1,0x73de,1,0x843d,1,0x916a,1,0x99f1,1,0x4e82,1,0x5375,1,0x6b04, -1,0x721b,1,0x862d,1,0x9e1e,1,0x5d50,1,0x6feb,1,0x85cd,1,0x8964,1,0x62c9, -1,0x81d8,1,0x881f,1,0x5eca,1,0x6717,1,0x6d6a,1,0x72fc,1,0x90ce,1,0x4f86, -1,0x51b7,1,0x52de,1,0x64c4,1,0x6ad3,1,0x7210,1,0x76e7,1,0x8001,1,0x8606, -1,0x865c,1,0x8def,1,0x9732,1,0x9b6f,1,0x9dfa,1,0x788c,1,0x797f,1,0x7da0, -1,0x83c9,1,0x9304,1,0x9e7f,1,0x8ad6,1,0x58df,1,0x5f04,1,0x7c60,1,0x807e, -1,0x7262,1,0x78ca,1,0x8cc2,1,0x96f7,1,0x58d8,1,0x5c62,1,0x6a13,1,0x6dda, -1,0x6f0f,1,0x7d2f,1,0x7e37,1,0x964b,1,0x52d2,1,0x808b,1,0x51dc,1,0x51cc, -1,0x7a1c,1,0x7dbe,1,0x83f1,1,0x9675,1,0x8b80,1,0x62cf,1,0x8afe,1,0x4e39, -1,0x5be7,1,0x6012,1,0x7387,1,0x7570,1,0x5317,1,0x78fb,1,0x4fbf,1,0x5fa9, -1,0x4e0d,1,0x6ccc,1,0x6578,1,0x7d22,1,0x53c3,1,0x585e,1,0x7701,1,0x8449, -1,0x8aaa,1,0x6bba,1,0x8fb0,1,0x6c88,1,0x62fe,1,0x82e5,1,0x63a0,1,0x7565, -1,0x4eae,1,0x5169,1,0x51c9,1,0x6881,1,0x7ce7,1,0x826f,1,0x8ad2,1,0x91cf, -1,0x52f5,1,0x5442,1,0x5973,1,0x5eec,1,0x65c5,1,0x6ffe,1,0x792a,1,0x95ad, -1,0x9a6a,1,0x9e97,1,0x9ece,1,0x529b,1,0x66c6,1,0x6b77,1,0x8f62,1,0x5e74, -1,0x6190,1,0x6200,1,0x649a,1,0x6f23,1,0x7149,1,0x7489,1,0x79ca,1,0x7df4, -1,0x806f,1,0x8f26,1,0x84ee,1,0x9023,1,0x934a,1,0x5217,1,0x52a3,1,0x54bd, -1,0x70c8,1,0x88c2,1,0x5ec9,1,0x5ff5,1,0x637b,1,0x6bae,1,0x7c3e,1,0x7375, -1,0x4ee4,1,0x56f9,1,0x5dba,1,0x601c,1,0x73b2,1,0x7469,1,0x7f9a,1,0x8046, -1,0x9234,1,0x96f6,1,0x9748,1,0x9818,1,0x4f8b,1,0x79ae,1,0x91b4,1,0x96b8, -1,0x60e1,1,0x4e86,1,0x50da,1,0x5bee,1,0x5c3f,1,0x6599,1,0x71ce,1,0x7642, -1,0x84fc,1,0x907c,1,0x9f8d,1,0x6688,1,0x962e,1,0x5289,1,0x677b,1,0x67f3, -1,0x6d41,1,0x6e9c,1,0x7409,1,0x7559,1,0x786b,1,0x7d10,1,0x985e,1,0x516d, -1,0x622e,1,0x9678,1,0x502b,1,0x5d19,1,0x6dea,1,0x8f2a,1,0x5f8b,1,0x6144, -1,0x6817,1,0x9686,1,0x5229,1,0x540f,1,0x5c65,1,0x6613,1,0x674e,1,0x68a8, -1,0x6ce5,1,0x7406,1,0x75e2,1,0x7f79,1,0x88cf,1,0x88e1,1,0x91cc,1,0x96e2, -1,0x533f,1,0x6eba,1,0x541d,1,0x71d0,1,0x7498,1,0x85fa,1,0x96a3,1,0x9c57, -1,0x9e9f,1,0x6797,1,0x6dcb,1,0x81e8,1,0x7acb,1,0x7b20,1,0x7c92,1,0x72c0, -1,0x7099,1,0x8b58,1,0x4ec0,1,0x8336,1,0x523a,1,0x5207,1,0x5ea6,1,0x62d3, -1,0x7cd6,1,0x5b85,1,0x6d1e,1,0x66b4,1,0x8f3b,1,0x884c,1,0x964d,1,0x898b, -1,0x5ed3,1,0x5140,1,0x55c0,1,0x585a,1,0x6674,1,0x51de,1,0x732a,1,0x76ca, -1,0x793c,1,0x795e,1,0x7965,1,0x798f,1,0x9756,1,0x7cbe,1,0x7fbd,1,0x8612, -1,0x8af8,1,0x9038,1,0x90fd,1,0x98ef,1,0x98fc,1,0x9928,1,0x9db4,1,0x90de, -1,0x96b7,1,0x4fae,1,0x50e7,1,0x514d,1,0x52c9,1,0x52e4,1,0x5351,1,0x559d, -1,0x5606,1,0x5668,1,0x5840,1,0x58a8,1,0x5c64,1,0x5c6e,1,0x6094,1,0x6168, -1,0x618e,1,0x61f2,1,0x654f,1,0x65e2,1,0x6691,1,0x6885,1,0x6d77,1,0x6e1a, -1,0x6f22,1,0x716e,1,0x722b,1,0x7422,1,0x7891,1,0x793e,1,0x7949,1,0x7948, -1,0x7950,1,0x7956,1,0x795d,1,0x798d,1,0x798e,1,0x7a40,1,0x7a81,1,0x7bc0, -1,0x7e09,1,0x7e41,1,0x7f72,1,0x8005,1,0x81ed,1,0x8279,1,0x8457,1,0x8910, -1,0x8996,1,0x8b01,1,0x8b39,1,0x8cd3,1,0x8d08,1,0x8fb6,1,0x96e3,1,0x97ff, -1,0x983b,1,0x6075,2,0xd850,0xdeee,1,0x8218,1,0x4e26,1,0x51b5,1,0x5168,1, -0x4f80,1,0x5145,1,0x5180,1,0x52c7,1,0x52fa,1,0x5555,1,0x5599,1,0x55e2,1, -0x58b3,1,0x5944,1,0x5954,1,0x5a62,1,0x5b28,1,0x5ed2,1,0x5ed9,1,0x5f69,1, -0x5fad,1,0x60d8,1,0x614e,1,0x6108,1,0x6160,1,0x6234,1,0x63c4,1,0x641c,1, -0x6452,1,0x6556,1,0x671b,1,0x6756,1,0x6b79,1,0x6edb,1,0x6ecb,1,0x701e,1, -0x77a7,1,0x7235,1,0x72af,1,0x7471,1,0x7506,1,0x753b,1,0x761d,1,0x761f,1, -0x76db,1,0x76f4,1,0x774a,1,0x7740,1,0x78cc,1,0x7ab1,1,0x7c7b,1,0x7d5b,1, -0x7f3e,1,0x8352,1,0x83ef,1,0x8779,1,0x8941,1,0x8986,1,0x8abf,1,0x8acb,1, -0x8aed,1,0x8b8a,1,0x8f38,1,0x9072,1,0x9199,1,0x9276,1,0x967c,1,0x97db,1, -0x980b,1,0x9b12,2,0xd84a,0xdc4a,2,0xd84a,0xdc44,2,0xd84c,0xdfd5,1,0x3b9d,1,0x4018, -1,0x4039,2,0xd854,0xde49,2,0xd857,0xdcd0,2,0xd85f,0xded3,1,0x9f43,1,0x9f8e,0xe02, -0x5d9,0x5b4,0x1102,0x5f2,0x5b7,0x1802,0x5e9,0x5c1,0x1902,0x5e9,0x5c2,0xfb49,0x1843,0x5e9,0x5bc,0x5c1, -0xfb49,0x1943,0x5e9,0x5bc,0x5c2,0x1102,0x5d0,0x5b7,0x1202,0x5d0,0x5b8,0x1502,0x5d0,0x5bc,0x1502,0x5d1, -0x5bc,0x1502,0x5d2,0x5bc,0x1502,0x5d3,0x5bc,0x1502,0x5d4,0x5bc,0x1502,0x5d5,0x5bc,0x1502,0x5d6,0x5bc, -0x1502,0x5d8,0x5bc,0x1502,0x5d9,0x5bc,0x1502,0x5da,0x5bc,0x1502,0x5db,0x5bc,0x1502,0x5dc,0x5bc,0x1502, -0x5de,0x5bc,0x1502,0x5e0,0x5bc,0x1502,0x5e1,0x5bc,0x1502,0x5e3,0x5bc,0x1502,0x5e4,0x5bc,0x1502,0x5e6, -0x5bc,0x1502,0x5e7,0x5bc,0x1502,0x5e8,0x5bc,0x1502,0x5e9,0x5bc,0x1502,0x5ea,0x5bc,0x1302,0x5d5,0x5b9, -0x1702,0x5d1,0x5bf,0x1702,0x5db,0x5bf,0x1702,0x5e4,0x5bf,0xd804,0xd834,0xdd57,0xd834,0xdd65,0xd804,0xd834, -0xdd58,0xd834,0xdd65,0xd834,0xdd5f,0xd834,0xdd6e,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd6e,0xd834, -0xdd5f,0xd834,0xdd6f,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd6f,0xd834,0xdd5f,0xd834,0xdd70,4, -0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd70,0xd834,0xdd5f,0xd834,0xdd71,4,0xd846,0xd834,0xdd58,0xd834, -0xdd65,0xd834,0xdd71,0xd834,0xdd5f,0xd834,0xdd72,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd72,0xd804, -0xd834,0xddb9,0xd834,0xdd65,0xd804,0xd834,0xddba,0xd834,0xdd65,0xd834,0xddbb,0xd834,0xdd6e,4,0xd846,0xd834, -0xddb9,0xd834,0xdd65,0xd834,0xdd6e,0xd834,0xddbc,0xd834,0xdd6e,4,0xd846,0xd834,0xddba,0xd834,0xdd65,0xd834, -0xdd6e,0xd834,0xddbb,0xd834,0xdd6f,4,0xd846,0xd834,0xddb9,0xd834,0xdd65,0xd834,0xdd6f,0xd834,0xddbc,0xd834, -0xdd6f,4,0xd846,0xd834,0xddba,0xd834,0xdd65,0xd834,0xdd6f,1,0x4e3d,1,0x4e38,1,0x4e41,2, -0xd840,0xdd22,1,0x4f60,1,0x4fbb,1,0x5002,1,0x507a,1,0x5099,1,0x50cf,1,0x349e, -2,0xd841,0xde3a,1,0x5154,1,0x5164,1,0x5177,2,0xd841,0xdd1c,1,0x34b9,1,0x5167, -1,0x518d,2,0xd841,0xdd4b,1,0x5197,1,0x51a4,1,0x4ecc,1,0x51ac,2,0xd864,0xdddf, -1,0x51f5,1,0x5203,1,0x34df,1,0x523b,1,0x5246,1,0x5272,1,0x5277,1,0x3515, -1,0x5305,1,0x5306,1,0x5349,1,0x535a,1,0x5373,1,0x537d,1,0x537f,2,0xd842, -0xde2c,1,0x7070,1,0x53ca,1,0x53df,2,0xd842,0xdf63,1,0x53eb,1,0x53f1,1,0x5406, -1,0x549e,1,0x5438,1,0x5448,1,0x5468,1,0x54a2,1,0x54f6,1,0x5510,1,0x5553, -1,0x5563,1,0x5584,1,0x55ab,1,0x55b3,1,0x55c2,1,0x5716,1,0x5717,1,0x5651, -1,0x5674,1,0x58ee,1,0x57ce,1,0x57f4,1,0x580d,1,0x578b,1,0x5832,1,0x5831, -1,0x58ac,2,0xd845,0xdce4,1,0x58f2,1,0x58f7,1,0x5906,1,0x591a,1,0x5922,1, -0x5962,2,0xd845,0xdea8,2,0xd845,0xdeea,1,0x59ec,1,0x5a1b,1,0x5a27,1,0x59d8,1, -0x5a66,1,0x36ee,1,0x36fc,1,0x5b08,1,0x5b3e,2,0xd846,0xddc8,1,0x5bc3,1,0x5bd8, -1,0x5bf3,2,0xd846,0xdf18,1,0x5bff,1,0x5c06,1,0x5f53,1,0x5c22,1,0x3781,1, -0x5c60,1,0x5cc0,1,0x5c8d,2,0xd847,0xdde4,1,0x5d43,2,0xd847,0xdde6,1,0x5d6e,1, -0x5d6b,1,0x5d7c,1,0x5de1,1,0x5de2,1,0x382f,1,0x5dfd,1,0x5e28,1,0x5e3d,1, -0x5e69,1,0x3862,2,0xd848,0xdd83,1,0x387c,1,0x5eb0,1,0x5eb3,1,0x5eb6,2,0xd868, -0xdf92,1,0x5efe,2,0xd848,0xdf31,1,0x8201,1,0x5f22,1,0x38c7,2,0xd84c,0xdeb8,2, -0xd858,0xddda,1,0x5f62,1,0x5f6b,1,0x38e3,1,0x5f9a,1,0x5fcd,1,0x5fd7,1,0x5ff9, -1,0x6081,1,0x393a,1,0x391c,2,0xd849,0xded4,1,0x60c7,1,0x6148,1,0x614c,1, -0x617a,1,0x61b2,1,0x61a4,1,0x61af,1,0x61de,1,0x6210,1,0x621b,1,0x625d,1, -0x62b1,1,0x62d4,1,0x6350,2,0xd84a,0xdf0c,1,0x633d,1,0x62fc,1,0x6368,1,0x6383, -1,0x63e4,2,0xd84a,0xdff1,1,0x6422,1,0x63c5,1,0x63a9,1,0x3a2e,1,0x6469,1, -0x647e,1,0x649d,1,0x6477,1,0x3a6c,1,0x656c,2,0xd84c,0xdc0a,1,0x65e3,1,0x66f8, -1,0x6649,1,0x3b19,1,0x3b08,1,0x3ae4,1,0x5192,1,0x5195,1,0x6700,1,0x669c, -1,0x80ad,1,0x43d9,1,0x6721,1,0x675e,1,0x6753,2,0xd84c,0xdfc3,1,0x3b49,1, -0x67fa,1,0x6785,1,0x6852,2,0xd84d,0xdc6d,1,0x688e,1,0x681f,1,0x6914,1,0x6942, -1,0x69a3,1,0x69ea,1,0x6aa8,2,0xd84d,0xdea3,1,0x6adb,1,0x3c18,1,0x6b21,2, -0xd84e,0xdca7,1,0x6b54,1,0x3c4e,1,0x6b72,1,0x6b9f,1,0x6bbb,2,0xd84e,0xde8d,2, -0xd847,0xdd0b,2,0xd84e,0xdefa,1,0x6c4e,2,0xd84f,0xdcbc,1,0x6cbf,1,0x6ccd,1,0x6c67, -1,0x6d16,1,0x6d3e,1,0x6d69,1,0x6d78,1,0x6d85,2,0xd84f,0xdd1e,1,0x6d34,1, -0x6e2f,1,0x6e6e,1,0x3d33,1,0x6ec7,2,0xd84f,0xded1,1,0x6df9,1,0x6f6e,2,0xd84f, -0xdf5e,2,0xd84f,0xdf8e,1,0x6fc6,1,0x7039,1,0x701b,1,0x3d96,1,0x704a,1,0x707d, -1,0x7077,1,0x70ad,2,0xd841,0xdd25,1,0x7145,2,0xd850,0xde63,1,0x719c,2,0xd850, -0xdfab,1,0x7228,1,0x7250,2,0xd851,0xde08,1,0x7280,1,0x7295,2,0xd851,0xdf35,2, -0xd852,0xdc14,1,0x737a,1,0x738b,1,0x3eac,1,0x73a5,1,0x3eb8,1,0x7447,1,0x745c, -1,0x7485,1,0x74ca,1,0x3f1b,1,0x7524,2,0xd853,0xdc36,1,0x753e,2,0xd853,0xdc92, -2,0xd848,0xdd9f,1,0x7610,2,0xd853,0xdfa1,2,0xd853,0xdfb8,2,0xd854,0xdc44,1,0x3ffc, -1,0x4008,2,0xd854,0xdcf3,2,0xd854,0xdcf2,2,0xd854,0xdd19,2,0xd854,0xdd33,1,0x771e, -1,0x771f,1,0x778b,1,0x4046,1,0x4096,2,0xd855,0xdc1d,1,0x784e,1,0x40e3,2, -0xd855,0xde26,2,0xd855,0xde9a,2,0xd855,0xdec5,1,0x79eb,1,0x412f,1,0x7a4a,1,0x7a4f, -2,0xd856,0xdd7c,2,0xd856,0xdea7,1,0x7aee,1,0x4202,2,0xd856,0xdfab,1,0x7bc6,1, -0x7bc9,1,0x4227,2,0xd857,0xdc80,1,0x7cd2,1,0x42a0,1,0x7ce8,1,0x7ce3,1,0x7d00, -2,0xd857,0xdf86,1,0x7d63,1,0x4301,1,0x7dc7,1,0x7e02,1,0x7e45,1,0x4334,2, -0xd858,0xde28,2,0xd858,0xde47,1,0x4359,2,0xd858,0xded9,1,0x7f7a,2,0xd858,0xdf3e,1, -0x7f95,1,0x7ffa,2,0xd859,0xdcda,2,0xd859,0xdd23,1,0x8060,2,0xd859,0xdda8,1,0x8070, -2,0xd84c,0xdf5f,1,0x43d5,1,0x80b2,1,0x8103,1,0x440b,1,0x813e,1,0x5ab5,2, -0xd859,0xdfa7,2,0xd859,0xdfb5,2,0xd84c,0xdf93,2,0xd84c,0xdf9c,1,0x8204,1,0x8f9e,1, -0x446b,1,0x8291,1,0x828b,1,0x829d,1,0x52b3,1,0x82b1,1,0x82b3,1,0x82bd,1, -0x82e6,2,0xd85a,0xdf3c,1,0x831d,1,0x8363,1,0x83ad,1,0x8323,1,0x83bd,1,0x83e7, -1,0x8353,1,0x83ca,1,0x83cc,1,0x83dc,2,0xd85b,0xdc36,2,0xd85b,0xdd6b,2,0xd85b, -0xdcd5,1,0x452b,1,0x84f1,1,0x84f3,1,0x8516,2,0xd85c,0xdfca,1,0x8564,2,0xd85b, -0xdf2c,1,0x455d,1,0x4561,2,0xd85b,0xdfb1,2,0xd85c,0xdcd2,1,0x456b,1,0x8650,1, -0x8667,1,0x8669,1,0x86a9,1,0x8688,1,0x870e,1,0x86e2,1,0x8728,1,0x876b,1, -0x8786,1,0x45d7,1,0x87e1,1,0x8801,1,0x45f9,1,0x8860,1,0x8863,2,0xd85d,0xde67, -1,0x88d7,1,0x88de,1,0x4635,1,0x88fa,1,0x34bb,2,0xd85e,0xdcae,2,0xd85e,0xdd66, -1,0x46be,1,0x46c7,1,0x8aa0,1,0x8c55,2,0xd85f,0xdca8,1,0x8cab,1,0x8cc1,1, -0x8d1b,1,0x8d77,2,0xd85f,0xdf2f,2,0xd842,0xdc04,1,0x8dcb,1,0x8dbc,1,0x8df0,2, -0xd842,0xdcde,1,0x8ed4,2,0xd861,0xddd2,2,0xd861,0xdded,1,0x9094,1,0x90f1,1,0x9111, -2,0xd861,0xdf2e,1,0x911b,1,0x9238,1,0x92d7,1,0x92d8,1,0x927c,1,0x93f9,1, -0x9415,2,0xd862,0xdffa,1,0x958b,1,0x4995,1,0x95b7,2,0xd863,0xdd77,1,0x49e6,1, -0x96c3,1,0x5db2,1,0x9723,2,0xd864,0xdd45,2,0xd864,0xde1a,1,0x4a6e,1,0x4a76,1, -0x97e0,2,0xd865,0xdc0a,1,0x4ab2,2,0xd865,0xdc96,1,0x9829,2,0xd865,0xddb6,1,0x98e2, -1,0x4b33,1,0x9929,1,0x99a7,1,0x99c2,1,0x99fe,1,0x4bce,2,0xd866,0xdf30,1, -0x9c40,1,0x9cfd,1,0x4cce,1,0x4ced,1,0x9d67,2,0xd868,0xdcce,1,0x4cf8,2,0xd868, -0xdd05,2,0xd868,0xde0e,2,0xd868,0xde91,1,0x9ebb,1,0x4d56,1,0x9ef9,1,0x9efe,1, -0x9f05,1,0x9f0f,1,0x9f16,1,0x9f3b,2,0xd869,0xde00 +0x2c02,0x2978,0x348b,0x2e82,0x2976,0xb48b,0x2f42,0x297c,0xb48b,0x6bc2,0x2b74,0xb48b,0x6bc2,0x2b76,2,0xe602, +0x41,0x302,0x600,0x3d4c,0x602,0x3d48,0x606,0x3d54,0x8612,0x3d50,0xe602,0x41,0x308,0x8608,0x3bc,0xe602, +0x41,0x30a,0x8602,0x3f4,0xca02,0x43,0x327,0x8602,0x3c10,0xe602,0x45,0x302,0x600,0x3d80,0x602,0x3d7c, +0x606,0x3d88,0x8612,0x3d84,0xe602,0x49,0x308,0x8602,0x3c5c,0xe602,0x4f,0x302,0x600,0x3da4,0x602,0x3da0, +0x606,0x3dac,0x8612,0x3da8,0xe602,0x4f,0x303,0x602,0x3c98,0x608,0x458,0x8610,0x3c9c,0xe602,0x4f,0x308, +0x8608,0x454,0xe602,0x55,0x308,0x600,0x3b6,0x602,0x3ae,0x608,0x3aa,0x8618,0x3b2,0xe602,0x61,0x302, +0x600,0x3d4e,0x602,0x3d4a,0x606,0x3d56,0x8612,0x3d52,0xe602,0x61,0x308,0x8608,0x3be,0xe602,0x61,0x30a, +0x8602,0x3f6,0xca02,0x63,0x327,0x8602,0x3c12,0xe602,0x65,0x302,0x600,0x3d82,0x602,0x3d7e,0x606,0x3d8a, +0x8612,0x3d86,0xe602,0x69,0x308,0x8602,0x3c5e,0xe602,0x6f,0x302,0x600,0x3da6,0x602,0x3da2,0x606,0x3dae, +0x8612,0x3daa,0xe602,0x6f,0x303,0x602,0x3c9a,0x608,0x45a,0x8610,0x3c9e,0xe602,0x6f,0x308,0x8608,0x456, +0xe602,0x75,0x308,0x600,0x3b8,0x602,0x3b0,0x608,0x3ac,0x8618,0x3b4,0xe602,0x41,0x306,0x600,0x3d60, +0x602,0x3d5c,0x606,0x3d68,0x8612,0x3d64,0xe602,0x61,0x306,0x600,0x3d62,0x602,0x3d5e,0x606,0x3d6a,0x8612, +0x3d66,0xe602,0x45,0x304,0x600,0x3c28,0x8602,0x3c2c,0xe602,0x65,0x304,0x600,0x3c2a,0x8602,0x3c2e,0xe602, +0x4f,0x304,0x600,0x3ca0,0x8602,0x3ca4,0xe602,0x6f,0x304,0x600,0x3ca2,0x8602,0x3ca6,0xe602,0x53,0x301, +0x860e,0x3cc8,0xe602,0x73,0x301,0x860e,0x3cca,0xe602,0x53,0x30c,0x860e,0x3ccc,0xe602,0x73,0x30c,0x860e, +0x3cce,0xe602,0x55,0x303,0x8602,0x3cf0,0xe602,0x75,0x303,0x8602,0x3cf2,0xe602,0x55,0x304,0x8610,0x3cf4, +0xe602,0x75,0x304,0x8610,0x3cf6,0xd802,0x4f,0x31b,0x600,0x3db8,0x602,0x3db4,0x606,0x3dc0,0x612,0x3dbc, +0x8646,0x3dc4,0xd802,0x6f,0x31b,0x600,0x3dba,0x602,0x3db6,0x606,0x3dc2,0x612,0x3dbe,0x8646,0x3dc6,0xd802, +0x55,0x31b,0x600,0x3dd4,0x602,0x3dd0,0x606,0x3ddc,0x612,0x3dd8,0x8646,0x3de0,0xd802,0x75,0x31b,0x600, +0x3dd6,0x602,0x3dd2,0x606,0x3dde,0x612,0x3dda,0x8646,0x3de2,0xca02,0x4f,0x328,0x8608,0x3d8,0xca02,0x6f, +0x328,0x8608,0x3da,0xe602,0x41,0x307,0x8608,0x3c0,0xe602,0x61,0x307,0x8608,0x3c2,0xca02,0x45,0x327, +0x860c,0x3c38,0xca02,0x65,0x327,0x860c,0x3c3a,0xe602,0x4f,0x307,0x8608,0x460,0xe602,0x6f,0x307,0x8608, +0x462,0xe602,0x3b1,0x301,0x868a,0x3f68,0xe602,0x3b7,0x301,0x868a,0x3f88,0xe602,0x3b9,0x308,0x600,0x3fa4, +0x602,0x720,0x8684,0x3fae,0xe602,0x3c5,0x308,0x600,0x3fc4,0x602,0x760,0x8684,0x3fce,0xe602,0x3c9,0x301, +0x868a,0x3fe8,2,0xcc6,0xcc2,0x99aa,0x1996,2,0xdd9,0xdcf,0x9b94,0x1bba,0xdc02,0x4c,0x323,0x8608, +0x3c70,0xdc02,0x6c,0x323,0x8608,0x3c72,0xdc02,0x52,0x323,0x8608,0x3cb8,0xdc02,0x72,0x323,0x8608,0x3cba, +0xdc02,0x53,0x323,0x860e,0x3cd0,0xdc02,0x73,0x323,0x860e,0x3cd2,0xdc02,0x41,0x323,0x604,0x3d58,0x860c, +0x3d6c,0xdc02,0x61,0x323,0x604,0x3d5a,0x860c,0x3d6e,0xdc02,0x45,0x323,0x8604,0x3d8c,0xdc02,0x65,0x323, +0x8604,0x3d8e,0xdc02,0x4f,0x323,0x8604,0x3db0,0xdc02,0x6f,0x323,0x8604,0x3db2,0xe602,0x3b1,0x313,0x600, +0x3e05,0x602,0x3e09,0x684,0x3e0d,0x868a,0x3f00,0xe602,0x3b1,0x314,0x600,0x3e07,0x602,0x3e0b,0x684,0x3e0f, +0x868a,0x3f02,0x1f00,0xe643,0x3b1,0x313,0x300,0x868a,0x3f04,0x1f01,0xe643,0x3b1,0x314,0x300,0x868a,0x3f06, +0x1f00,0xe643,0x3b1,0x313,0x301,0x868a,0x3f08,0x1f01,0xe643,0x3b1,0x314,0x301,0x868a,0x3f0a,0x1f00,0xe643, +0x3b1,0x313,0x342,0x868a,0x3f0c,0x1f01,0xe643,0x3b1,0x314,0x342,0x868a,0x3f0e,0xe602,0x391,0x313,0x600, +0x3e15,0x602,0x3e19,0x684,0x3e1d,0x868a,0x3f10,0xe602,0x391,0x314,0x600,0x3e17,0x602,0x3e1b,0x684,0x3e1f, +0x868a,0x3f12,0x1f08,0xe643,0x391,0x313,0x300,0x868a,0x3f14,0x1f09,0xe643,0x391,0x314,0x300,0x868a,0x3f16, +0x1f08,0xe643,0x391,0x313,0x301,0x868a,0x3f18,0x1f09,0xe643,0x391,0x314,0x301,0x868a,0x3f1a,0x1f08,0xe643, +0x391,0x313,0x342,0x868a,0x3f1c,0x1f09,0xe643,0x391,0x314,0x342,0x868a,0x3f1e,0xe602,0x3b5,0x313,0x600, +0x3e24,0x8602,0x3e28,0xe602,0x3b5,0x314,0x600,0x3e26,0x8602,0x3e2a,0xe602,0x395,0x313,0x600,0x3e34,0x8602, +0x3e38,0xe602,0x395,0x314,0x600,0x3e36,0x8602,0x3e3a,0xe602,0x3b7,0x313,0x600,0x3e45,0x602,0x3e49,0x684, +0x3e4d,0x868a,0x3f20,0xe602,0x3b7,0x314,0x600,0x3e47,0x602,0x3e4b,0x684,0x3e4f,0x868a,0x3f22,0x1f20,0xe643, +0x3b7,0x313,0x300,0x868a,0x3f24,0x1f21,0xe643,0x3b7,0x314,0x300,0x868a,0x3f26,0x1f20,0xe643,0x3b7,0x313, +0x301,0x868a,0x3f28,0x1f21,0xe643,0x3b7,0x314,0x301,0x868a,0x3f2a,0x1f20,0xe643,0x3b7,0x313,0x342,0x868a, +0x3f2c,0x1f21,0xe643,0x3b7,0x314,0x342,0x868a,0x3f2e,0xe602,0x397,0x313,0x600,0x3e55,0x602,0x3e59,0x684, +0x3e5d,0x868a,0x3f30,0xe602,0x397,0x314,0x600,0x3e57,0x602,0x3e5b,0x684,0x3e5f,0x868a,0x3f32,0x1f28,0xe643, +0x397,0x313,0x300,0x868a,0x3f34,0x1f29,0xe643,0x397,0x314,0x300,0x868a,0x3f36,0x1f28,0xe643,0x397,0x313, +0x301,0x868a,0x3f38,0x1f29,0xe643,0x397,0x314,0x301,0x868a,0x3f3a,0x1f28,0xe643,0x397,0x313,0x342,0x868a, +0x3f3c,0x1f29,0xe643,0x397,0x314,0x342,0x868a,0x3f3e,0xe602,0x3b9,0x313,0x600,0x3e64,0x602,0x3e68,0x8684, +0x3e6c,0xe602,0x3b9,0x314,0x600,0x3e66,0x602,0x3e6a,0x8684,0x3e6e,0xe602,0x399,0x313,0x600,0x3e74,0x602, +0x3e78,0x8684,0x3e7c,0xe602,0x399,0x314,0x600,0x3e76,0x602,0x3e7a,0x8684,0x3e7e,0xe602,0x3bf,0x313,0x600, +0x3e84,0x8602,0x3e88,0xe602,0x3bf,0x314,0x600,0x3e86,0x8602,0x3e8a,0xe602,0x39f,0x313,0x600,0x3e94,0x8602, +0x3e98,0xe602,0x39f,0x314,0x600,0x3e96,0x8602,0x3e9a,0xe602,0x3c5,0x313,0x600,0x3ea4,0x602,0x3ea8,0x8684, +0x3eac,0xe602,0x3c5,0x314,0x600,0x3ea6,0x602,0x3eaa,0x8684,0x3eae,0xe602,0x3a5,0x314,0x600,0x3eb6,0x602, +0x3eba,0x8684,0x3ebe,0xe602,0x3c9,0x313,0x600,0x3ec5,0x602,0x3ec9,0x684,0x3ecd,0x868a,0x3f40,0xe602,0x3c9, +0x314,0x600,0x3ec7,0x602,0x3ecb,0x684,0x3ecf,0x868a,0x3f42,0x1f60,0xe643,0x3c9,0x313,0x300,0x868a,0x3f44, +0x1f61,0xe643,0x3c9,0x314,0x300,0x868a,0x3f46,0x1f60,0xe643,0x3c9,0x313,0x301,0x868a,0x3f48,0x1f61,0xe643, +0x3c9,0x314,0x301,0x868a,0x3f4a,0x1f60,0xe643,0x3c9,0x313,0x342,0x868a,0x3f4c,0x1f61,0xe643,0x3c9,0x314, +0x342,0x868a,0x3f4e,0xe602,0x3a9,0x313,0x600,0x3ed5,0x602,0x3ed9,0x684,0x3edd,0x868a,0x3f50,0xe602,0x3a9, +0x314,0x600,0x3ed7,0x602,0x3edb,0x684,0x3edf,0x868a,0x3f52,0x1f68,0xe643,0x3a9,0x313,0x300,0x868a,0x3f54, +0x1f69,0xe643,0x3a9,0x314,0x300,0x868a,0x3f56,0x1f68,0xe643,0x3a9,0x313,0x301,0x868a,0x3f58,0x1f69,0xe643, +0x3a9,0x314,0x301,0x868a,0x3f5a,0x1f68,0xe643,0x3a9,0x313,0x342,0x868a,0x3f5c,0x1f69,0xe643,0x3a9,0x314, +0x342,0x868a,0x3f5e,0xe602,0x3b1,0x300,0x868a,0x3f64,0xe602,0x3b7,0x300,0x868a,0x3f84,0xe602,0x3c9,0x300, +0x868a,0x3fe4,0xe602,0x3b1,0x342,0x868a,0x3f6e,0xe602,0x3b7,0x342,0x868a,0x3f8e,0xe602,0x3c9,0x342,0x868a, +0x3fee,3,0xe602,0x41,0x300,0xe602,0x41,0x301,0xe602,0x41,0x303,0xe602,0x45,0x300,0xe602,0x45, +0x301,0xe602,0x45,0x308,0xe602,0x49,0x300,0xe602,0x49,0x301,0xe602,0x49,0x302,0xe602,0x4e,0x303, +0xe602,0x4f,0x300,0xe602,0x4f,0x301,0xe602,0x55,0x300,0xe602,0x55,0x301,0xe602,0x55,0x302,0xe602, +0x59,0x301,0xe602,0x61,0x300,0xe602,0x61,0x301,0xe602,0x61,0x303,0xe602,0x65,0x300,0xe602,0x65, +0x301,0xe602,0x65,0x308,0xe602,0x69,0x300,0xe602,0x69,0x301,0xe602,0x69,0x302,0xe602,0x6e,0x303, +0xe602,0x6f,0x300,0xe602,0x6f,0x301,0xe602,0x75,0x300,0xe602,0x75,0x301,0xe602,0x75,0x302,0xe602, +0x79,0x301,0xe602,0x79,0x308,0xe602,0x41,0x304,0xe602,0x61,0x304,0xca02,0x41,0x328,0xca02,0x61, +0x328,0xe602,0x43,0x301,0xe602,0x63,0x301,0xe602,0x43,0x302,0xe602,0x63,0x302,0xe602,0x43,0x307, +0xe602,0x63,0x307,0xe602,0x43,0x30c,0xe602,0x63,0x30c,0xe602,0x44,0x30c,0xe602,0x64,0x30c,0xe602, +0x45,0x306,0xe602,0x65,0x306,0xe602,0x45,0x307,0xe602,0x65,0x307,0xca02,0x45,0x328,0xca02,0x65, +0x328,0xe602,0x45,0x30c,0xe602,0x65,0x30c,0xe602,0x47,0x302,0xe602,0x67,0x302,0xe602,0x47,0x306, +0xe602,0x67,0x306,0xe602,0x47,0x307,0xe602,0x67,0x307,0xca02,0x47,0x327,0xca02,0x67,0x327,0xe602, +0x48,0x302,0xe602,0x68,0x302,0xe602,0x49,0x303,0xe602,0x69,0x303,0xe602,0x49,0x304,0xe602,0x69, +0x304,0xe602,0x49,0x306,0xe602,0x69,0x306,0xca02,0x49,0x328,0xca02,0x69,0x328,0xe602,0x49,0x307, +0xe602,0x4a,0x302,0xe602,0x6a,0x302,0xca02,0x4b,0x327,0xca02,0x6b,0x327,0xe602,0x4c,0x301,0xe602, +0x6c,0x301,0xca02,0x4c,0x327,0xca02,0x6c,0x327,0xe602,0x4c,0x30c,0xe602,0x6c,0x30c,0xe602,0x4e, +0x301,0xe602,0x6e,0x301,0xca02,0x4e,0x327,0xca02,0x6e,0x327,0xe602,0x4e,0x30c,0xe602,0x6e,0x30c, +0xe602,0x4f,0x306,0xe602,0x6f,0x306,0xe602,0x4f,0x30b,0xe602,0x6f,0x30b,0xe602,0x52,0x301,0xe602, +0x72,0x301,0xca02,0x52,0x327,0xca02,0x72,0x327,0xe602,0x52,0x30c,0xe602,0x72,0x30c,0xe602,0x53, +0x302,0xe602,0x73,0x302,0xca02,0x53,0x327,0xca02,0x73,0x327,0xca02,0x54,0x327,0xca02,0x74,0x327, +0xe602,0x54,0x30c,0xe602,0x74,0x30c,0xe602,0x55,0x306,0xe602,0x75,0x306,0xe602,0x55,0x30a,0xe602, +0x75,0x30a,0xe602,0x55,0x30b,0xe602,0x75,0x30b,0xca02,0x55,0x328,0xca02,0x75,0x328,0xe602,0x57, +0x302,0xe602,0x77,0x302,0xe602,0x59,0x302,0xe602,0x79,0x302,0xe602,0x59,0x308,0xe602,0x5a,0x301, +0xe602,0x7a,0x301,0xe602,0x5a,0x307,0xe602,0x7a,0x307,0xe602,0x5a,0x30c,0xe602,0x7a,0x30c,0xe602, +0x41,0x30c,0xe602,0x61,0x30c,0xe602,0x49,0x30c,0xe602,0x69,0x30c,0xe602,0x4f,0x30c,0xe602,0x6f, +0x30c,0xe602,0x55,0x30c,0xe602,0x75,0x30c,0xdc,0xe643,0x55,0x308,0x304,0xfc,0xe643,0x75,0x308, +0x304,0xdc,0xe643,0x55,0x308,0x301,0xfc,0xe643,0x75,0x308,0x301,0xdc,0xe643,0x55,0x308,0x30c, +0xfc,0xe643,0x75,0x308,0x30c,0xdc,0xe643,0x55,0x308,0x300,0xfc,0xe643,0x75,0x308,0x300,0xc4, +0xe643,0x41,0x308,0x304,0xe4,0xe643,0x61,0x308,0x304,0x226,0xe643,0x41,0x307,0x304,0x227,0xe643, +0x61,0x307,0x304,0xe602,0xc6,0x304,0xe602,0xe6,0x304,0xe602,0x47,0x30c,0xe602,0x67,0x30c,0xe602, +0x4b,0x30c,0xe602,0x6b,0x30c,0x1ea,0xe643,0x4f,0x328,0x304,0x1eb,0xe643,0x6f,0x328,0x304,0xe602, +0x1b7,0x30c,0xe602,0x292,0x30c,0xe602,0x6a,0x30c,0xe602,0x47,0x301,0xe602,0x67,0x301,0xe602,0x4e, +0x300,0xe602,0x6e,0x300,0xc5,0xe643,0x41,0x30a,0x301,0xe5,0xe643,0x61,0x30a,0x301,0xe602,0xc6, +0x301,0xe602,0xe6,0x301,0xe602,0xd8,0x301,0xe602,0xf8,0x301,0xe602,0x41,0x30f,0xe602,0x61,0x30f, +0xe602,0x41,0x311,0xe602,0x61,0x311,0xe602,0x45,0x30f,0xe602,0x65,0x30f,0xe602,0x45,0x311,0xe602, +0x65,0x311,0xe602,0x49,0x30f,0xe602,0x69,0x30f,0xe602,0x49,0x311,0xe602,0x69,0x311,0xe602,0x4f, +0x30f,0xe602,0x6f,0x30f,0xe602,0x4f,0x311,0xe602,0x6f,0x311,0xe602,0x52,0x30f,0xe602,0x72,0x30f, +0xe602,0x52,0x311,0xe602,0x72,0x311,0xe602,0x55,0x30f,0xe602,0x75,0x30f,0xe602,0x55,0x311,0xe602, +0x75,0x311,0xdc02,0x53,0x326,0xdc02,0x73,0x326,0xdc02,0x54,0x326,0xdc02,0x74,0x326,0xe602,0x48, +0x30c,0xe602,0x68,0x30c,0xd6,0xe643,0x4f,0x308,0x304,0xf6,0xe643,0x6f,0x308,0x304,0xd5,0xe643, +0x4f,0x303,0x304,0xf5,0xe643,0x6f,0x303,0x304,0x22e,0xe643,0x4f,0x307,0x304,0x22f,0xe643,0x6f, +0x307,0x304,0xe602,0x59,0x304,0xe602,0x79,0x304,0xe602,0xa8,0x301,0xe602,0x391,0x301,0xe602,0x395, +0x301,0xe602,0x397,0x301,0xe602,0x399,0x301,0xe602,0x39f,0x301,0xe602,0x3a5,0x301,0xe602,0x3a9,0x301, +0x3ca,0xe643,0x3b9,0x308,0x301,0xe602,0x399,0x308,0xe602,0x3a5,0x308,0xe602,0x3b5,0x301,0xe602,0x3b9, +0x301,0x3cb,0xe643,0x3c5,0x308,0x301,0xe602,0x3bf,0x301,0xe602,0x3c5,0x301,0xe602,0x3d2,0x301,0xe602, +0x3d2,0x308,0xe602,0x415,0x300,0xe602,0x415,0x308,0xe602,0x413,0x301,0xe602,0x406,0x308,0xe602,0x41a, +0x301,0xe602,0x418,0x300,0xe602,0x423,0x306,0xe602,0x418,0x306,0xe602,0x438,0x306,0xe602,0x435,0x300, +0xe602,0x435,0x308,0xe602,0x433,0x301,0xe602,0x456,0x308,0xe602,0x43a,0x301,0xe602,0x438,0x300,0xe602, +0x443,0x306,0xe602,0x474,0x30f,0xe602,0x475,0x30f,0xe602,0x416,0x306,0xe602,0x436,0x306,0xe602,0x410, +0x306,0xe602,0x430,0x306,0xe602,0x410,0x308,0xe602,0x430,0x308,0xe602,0x415,0x306,0xe602,0x435,0x306, +0xe602,0x4d8,0x308,0xe602,0x4d9,0x308,0xe602,0x416,0x308,0xe602,0x436,0x308,0xe602,0x417,0x308,0xe602, +0x437,0x308,0xe602,0x418,0x304,0xe602,0x438,0x304,0xe602,0x418,0x308,0xe602,0x438,0x308,0xe602,0x41e, +0x308,0xe602,0x43e,0x308,0xe602,0x4e8,0x308,0xe602,0x4e9,0x308,0xe602,0x42d,0x308,0xe602,0x44d,0x308, +0xe602,0x423,0x304,0xe602,0x443,0x304,0xe602,0x423,0x308,0xe602,0x443,0x308,0xe602,0x423,0x30b,0xe602, +0x443,0x30b,0xe602,0x427,0x308,0xe602,0x447,0x308,0xe602,0x42b,0x308,0xe602,0x44b,0x308,0xe602,0x627, +0x653,0xe602,0x627,0x654,0xe602,0x648,0x654,0xdc02,0x627,0x655,0xe602,0x64a,0x654,0xe602,0x6d5,0x654, +0xe602,0x6c1,0x654,0xe602,0x6d2,0x654,0x702,0x928,0x93c,0x702,0x930,0x93c,0x702,0x933,0x93c,2, +0x9c7,0x9be,2,0x9c7,0x9d7,2,0xb47,0xb56,2,0xb47,0xb3e,2,0xb47,0xb57,2,0xb92, +0xbd7,2,0xbc6,0xbbe,2,0xbc7,0xbbe,2,0xbc6,0xbd7,0x5b02,0xc46,0xc56,2,0xcbf,0xcd5, +2,0xcc6,0xcd5,2,0xcc6,0xcd6,0xcca,0x43,0xcc6,0xcc2,0xcd5,2,0xd46,0xd3e,2,0xd47, +0xd3e,2,0xd46,0xd57,0x902,0xdd9,0xdca,0xddc,0x943,0xdd9,0xdcf,0xdca,2,0xdd9,0xddf,2, +0x1025,0x102e,2,0x1b05,0x1b35,2,0x1b07,0x1b35,2,0x1b09,0x1b35,2,0x1b0b,0x1b35,2,0x1b0d, +0x1b35,2,0x1b11,0x1b35,2,0x1b3a,0x1b35,2,0x1b3c,0x1b35,2,0x1b3e,0x1b35,2,0x1b3f,0x1b35, +2,0x1b42,0x1b35,0xdc02,0x41,0x325,0xdc02,0x61,0x325,0xe602,0x42,0x307,0xe602,0x62,0x307,0xdc02, +0x42,0x323,0xdc02,0x62,0x323,0xdc02,0x42,0x331,0xdc02,0x62,0x331,0xc7,0xe643,0x43,0x327,0x301, +0xe7,0xe643,0x63,0x327,0x301,0xe602,0x44,0x307,0xe602,0x64,0x307,0xdc02,0x44,0x323,0xdc02,0x64, +0x323,0xdc02,0x44,0x331,0xdc02,0x64,0x331,0xca02,0x44,0x327,0xca02,0x64,0x327,0xdc02,0x44,0x32d, +0xdc02,0x64,0x32d,0x112,0xe643,0x45,0x304,0x300,0x113,0xe643,0x65,0x304,0x300,0x112,0xe643,0x45, +0x304,0x301,0x113,0xe643,0x65,0x304,0x301,0xdc02,0x45,0x32d,0xdc02,0x65,0x32d,0xdc02,0x45,0x330, +0xdc02,0x65,0x330,0x228,0xe643,0x45,0x327,0x306,0x229,0xe643,0x65,0x327,0x306,0xe602,0x46,0x307, +0xe602,0x66,0x307,0xe602,0x47,0x304,0xe602,0x67,0x304,0xe602,0x48,0x307,0xe602,0x68,0x307,0xdc02, +0x48,0x323,0xdc02,0x68,0x323,0xe602,0x48,0x308,0xe602,0x68,0x308,0xca02,0x48,0x327,0xca02,0x68, +0x327,0xdc02,0x48,0x32e,0xdc02,0x68,0x32e,0xdc02,0x49,0x330,0xdc02,0x69,0x330,0xcf,0xe643,0x49, +0x308,0x301,0xef,0xe643,0x69,0x308,0x301,0xe602,0x4b,0x301,0xe602,0x6b,0x301,0xdc02,0x4b,0x323, +0xdc02,0x6b,0x323,0xdc02,0x4b,0x331,0xdc02,0x6b,0x331,0x1e36,0xe643,0x4c,0x323,0x304,0x1e37,0xe643, +0x6c,0x323,0x304,0xdc02,0x4c,0x331,0xdc02,0x6c,0x331,0xdc02,0x4c,0x32d,0xdc02,0x6c,0x32d,0xe602, +0x4d,0x301,0xe602,0x6d,0x301,0xe602,0x4d,0x307,0xe602,0x6d,0x307,0xdc02,0x4d,0x323,0xdc02,0x6d, +0x323,0xe602,0x4e,0x307,0xe602,0x6e,0x307,0xdc02,0x4e,0x323,0xdc02,0x6e,0x323,0xdc02,0x4e,0x331, +0xdc02,0x6e,0x331,0xdc02,0x4e,0x32d,0xdc02,0x6e,0x32d,0xd5,0xe643,0x4f,0x303,0x301,0xf5,0xe643, +0x6f,0x303,0x301,0xd5,0xe643,0x4f,0x303,0x308,0xf5,0xe643,0x6f,0x303,0x308,0x14c,0xe643,0x4f, +0x304,0x300,0x14d,0xe643,0x6f,0x304,0x300,0x14c,0xe643,0x4f,0x304,0x301,0x14d,0xe643,0x6f,0x304, +0x301,0xe602,0x50,0x301,0xe602,0x70,0x301,0xe602,0x50,0x307,0xe602,0x70,0x307,0xe602,0x52,0x307, +0xe602,0x72,0x307,0x1e5a,0xe643,0x52,0x323,0x304,0x1e5b,0xe643,0x72,0x323,0x304,0xdc02,0x52,0x331, +0xdc02,0x72,0x331,0xe602,0x53,0x307,0xe602,0x73,0x307,0x15a,0xe643,0x53,0x301,0x307,0x15b,0xe643, +0x73,0x301,0x307,0x160,0xe643,0x53,0x30c,0x307,0x161,0xe643,0x73,0x30c,0x307,0x1e62,0xe643,0x53, +0x323,0x307,0x1e63,0xe643,0x73,0x323,0x307,0xe602,0x54,0x307,0xe602,0x74,0x307,0xdc02,0x54,0x323, +0xdc02,0x74,0x323,0xdc02,0x54,0x331,0xdc02,0x74,0x331,0xdc02,0x54,0x32d,0xdc02,0x74,0x32d,0xdc02, +0x55,0x324,0xdc02,0x75,0x324,0xdc02,0x55,0x330,0xdc02,0x75,0x330,0xdc02,0x55,0x32d,0xdc02,0x75, +0x32d,0x168,0xe643,0x55,0x303,0x301,0x169,0xe643,0x75,0x303,0x301,0x16a,0xe643,0x55,0x304,0x308, +0x16b,0xe643,0x75,0x304,0x308,0xe602,0x56,0x303,0xe602,0x76,0x303,0xdc02,0x56,0x323,0xdc02,0x76, +0x323,0xe602,0x57,0x300,0xe602,0x77,0x300,0xe602,0x57,0x301,0xe602,0x77,0x301,0xe602,0x57,0x308, +0xe602,0x77,0x308,0xe602,0x57,0x307,0xe602,0x77,0x307,0xdc02,0x57,0x323,0xdc02,0x77,0x323,0xe602, +0x58,0x307,0xe602,0x78,0x307,0xe602,0x58,0x308,0xe602,0x78,0x308,0xe602,0x59,0x307,0xe602,0x79, +0x307,0xe602,0x5a,0x302,0xe602,0x7a,0x302,0xdc02,0x5a,0x323,0xdc02,0x7a,0x323,0xdc02,0x5a,0x331, +0xdc02,0x7a,0x331,0xdc02,0x68,0x331,0xe602,0x74,0x308,0xe602,0x77,0x30a,0xe602,0x79,0x30a,0xe602, +0x17f,0x307,0xe602,0x41,0x309,0xe602,0x61,0x309,0xc2,0xe643,0x41,0x302,0x301,0xe2,0xe643,0x61, +0x302,0x301,0xc2,0xe643,0x41,0x302,0x300,0xe2,0xe643,0x61,0x302,0x300,0xc2,0xe643,0x41,0x302, +0x309,0xe2,0xe643,0x61,0x302,0x309,0xc2,0xe643,0x41,0x302,0x303,0xe2,0xe643,0x61,0x302,0x303, +0x1ea0,0xe643,0x41,0x323,0x302,0x1ea1,0xe643,0x61,0x323,0x302,0x102,0xe643,0x41,0x306,0x301,0x103, +0xe643,0x61,0x306,0x301,0x102,0xe643,0x41,0x306,0x300,0x103,0xe643,0x61,0x306,0x300,0x102,0xe643, +0x41,0x306,0x309,0x103,0xe643,0x61,0x306,0x309,0x102,0xe643,0x41,0x306,0x303,0x103,0xe643,0x61, +0x306,0x303,0x1ea0,0xe643,0x41,0x323,0x306,0x1ea1,0xe643,0x61,0x323,0x306,0xe602,0x45,0x309,0xe602, +0x65,0x309,0xe602,0x45,0x303,0xe602,0x65,0x303,0xca,0xe643,0x45,0x302,0x301,0xea,0xe643,0x65, +0x302,0x301,0xca,0xe643,0x45,0x302,0x300,0xea,0xe643,0x65,0x302,0x300,0xca,0xe643,0x45,0x302, +0x309,0xea,0xe643,0x65,0x302,0x309,0xca,0xe643,0x45,0x302,0x303,0xea,0xe643,0x65,0x302,0x303, +0x1eb8,0xe643,0x45,0x323,0x302,0x1eb9,0xe643,0x65,0x323,0x302,0xe602,0x49,0x309,0xe602,0x69,0x309, +0xdc02,0x49,0x323,0xdc02,0x69,0x323,0xe602,0x4f,0x309,0xe602,0x6f,0x309,0xd4,0xe643,0x4f,0x302, +0x301,0xf4,0xe643,0x6f,0x302,0x301,0xd4,0xe643,0x4f,0x302,0x300,0xf4,0xe643,0x6f,0x302,0x300, +0xd4,0xe643,0x4f,0x302,0x309,0xf4,0xe643,0x6f,0x302,0x309,0xd4,0xe643,0x4f,0x302,0x303,0xf4, +0xe643,0x6f,0x302,0x303,0x1ecc,0xe643,0x4f,0x323,0x302,0x1ecd,0xe643,0x6f,0x323,0x302,0x1a0,0xe643, +0x4f,0x31b,0x301,0x1a1,0xe643,0x6f,0x31b,0x301,0x1a0,0xe643,0x4f,0x31b,0x300,0x1a1,0xe643,0x6f, +0x31b,0x300,0x1a0,0xe643,0x4f,0x31b,0x309,0x1a1,0xe643,0x6f,0x31b,0x309,0x1a0,0xe643,0x4f,0x31b, +0x303,0x1a1,0xe643,0x6f,0x31b,0x303,0x1a0,0xdc43,0x4f,0x31b,0x323,0x1a1,0xdc43,0x6f,0x31b,0x323, +0xdc02,0x55,0x323,0xdc02,0x75,0x323,0xe602,0x55,0x309,0xe602,0x75,0x309,0x1af,0xe643,0x55,0x31b, +0x301,0x1b0,0xe643,0x75,0x31b,0x301,0x1af,0xe643,0x55,0x31b,0x300,0x1b0,0xe643,0x75,0x31b,0x300, +0x1af,0xe643,0x55,0x31b,0x309,0x1b0,0xe643,0x75,0x31b,0x309,0x1af,0xe643,0x55,0x31b,0x303,0x1b0, +0xe643,0x75,0x31b,0x303,0x1af,0xdc43,0x55,0x31b,0x323,0x1b0,0xdc43,0x75,0x31b,0x323,0xe602,0x59, +0x300,0xe602,0x79,0x300,0xdc02,0x59,0x323,0xdc02,0x79,0x323,0xe602,0x59,0x309,0xe602,0x79,0x309, +0xe602,0x59,0x303,0xe602,0x79,0x303,0x1f10,0xe643,0x3b5,0x313,0x300,0x1f11,0xe643,0x3b5,0x314,0x300, +0x1f10,0xe643,0x3b5,0x313,0x301,0x1f11,0xe643,0x3b5,0x314,0x301,0x1f18,0xe643,0x395,0x313,0x300,0x1f19, +0xe643,0x395,0x314,0x300,0x1f18,0xe643,0x395,0x313,0x301,0x1f19,0xe643,0x395,0x314,0x301,0x1f30,0xe643, +0x3b9,0x313,0x300,0x1f31,0xe643,0x3b9,0x314,0x300,0x1f30,0xe643,0x3b9,0x313,0x301,0x1f31,0xe643,0x3b9, +0x314,0x301,0x1f30,0xe643,0x3b9,0x313,0x342,0x1f31,0xe643,0x3b9,0x314,0x342,0x1f38,0xe643,0x399,0x313, +0x300,0x1f39,0xe643,0x399,0x314,0x300,0x1f38,0xe643,0x399,0x313,0x301,0x1f39,0xe643,0x399,0x314,0x301, +0x1f38,0xe643,0x399,0x313,0x342,0x1f39,0xe643,0x399,0x314,0x342,0x1f40,0xe643,0x3bf,0x313,0x300,0x1f41, +0xe643,0x3bf,0x314,0x300,0x1f40,0xe643,0x3bf,0x313,0x301,0x1f41,0xe643,0x3bf,0x314,0x301,0x1f48,0xe643, +0x39f,0x313,0x300,0x1f49,0xe643,0x39f,0x314,0x300,0x1f48,0xe643,0x39f,0x313,0x301,0x1f49,0xe643,0x39f, +0x314,0x301,0x1f50,0xe643,0x3c5,0x313,0x300,0x1f51,0xe643,0x3c5,0x314,0x300,0x1f50,0xe643,0x3c5,0x313, +0x301,0x1f51,0xe643,0x3c5,0x314,0x301,0x1f50,0xe643,0x3c5,0x313,0x342,0x1f51,0xe643,0x3c5,0x314,0x342, +0x1f59,0xe643,0x3a5,0x314,0x300,0x1f59,0xe643,0x3a5,0x314,0x301,0x1f59,0xe643,0x3a5,0x314,0x342,0xe602, +0x3b5,0x300,0xe602,0x3b9,0x300,0xe602,0x3bf,0x300,0xe602,0x3c5,0x300,0x1f00,0xf043,0x3b1,0x313,0x345, +0x1f01,0xf043,0x3b1,0x314,0x345,0x1f02,0x345,2,0xf044,0x3b1,0x313,0x300,0x345,0x1f03,0x345,2, +0xf044,0x3b1,0x314,0x300,0x345,0x1f04,0x345,2,0xf044,0x3b1,0x313,0x301,0x345,0x1f05,0x345,2, +0xf044,0x3b1,0x314,0x301,0x345,0x1f06,0x345,2,0xf044,0x3b1,0x313,0x342,0x345,0x1f07,0x345,2, +0xf044,0x3b1,0x314,0x342,0x345,0x1f08,0xf043,0x391,0x313,0x345,0x1f09,0xf043,0x391,0x314,0x345,0x1f0a, +0x345,2,0xf044,0x391,0x313,0x300,0x345,0x1f0b,0x345,2,0xf044,0x391,0x314,0x300,0x345,0x1f0c, +0x345,2,0xf044,0x391,0x313,0x301,0x345,0x1f0d,0x345,2,0xf044,0x391,0x314,0x301,0x345,0x1f0e, +0x345,2,0xf044,0x391,0x313,0x342,0x345,0x1f0f,0x345,2,0xf044,0x391,0x314,0x342,0x345,0x1f20, +0xf043,0x3b7,0x313,0x345,0x1f21,0xf043,0x3b7,0x314,0x345,0x1f22,0x345,2,0xf044,0x3b7,0x313,0x300, +0x345,0x1f23,0x345,2,0xf044,0x3b7,0x314,0x300,0x345,0x1f24,0x345,2,0xf044,0x3b7,0x313,0x301, +0x345,0x1f25,0x345,2,0xf044,0x3b7,0x314,0x301,0x345,0x1f26,0x345,2,0xf044,0x3b7,0x313,0x342, +0x345,0x1f27,0x345,2,0xf044,0x3b7,0x314,0x342,0x345,0x1f28,0xf043,0x397,0x313,0x345,0x1f29,0xf043, +0x397,0x314,0x345,0x1f2a,0x345,2,0xf044,0x397,0x313,0x300,0x345,0x1f2b,0x345,2,0xf044,0x397, +0x314,0x300,0x345,0x1f2c,0x345,2,0xf044,0x397,0x313,0x301,0x345,0x1f2d,0x345,2,0xf044,0x397, +0x314,0x301,0x345,0x1f2e,0x345,2,0xf044,0x397,0x313,0x342,0x345,0x1f2f,0x345,2,0xf044,0x397, +0x314,0x342,0x345,0x1f60,0xf043,0x3c9,0x313,0x345,0x1f61,0xf043,0x3c9,0x314,0x345,0x1f62,0x345,2, +0xf044,0x3c9,0x313,0x300,0x345,0x1f63,0x345,2,0xf044,0x3c9,0x314,0x300,0x345,0x1f64,0x345,2, +0xf044,0x3c9,0x313,0x301,0x345,0x1f65,0x345,2,0xf044,0x3c9,0x314,0x301,0x345,0x1f66,0x345,2, +0xf044,0x3c9,0x313,0x342,0x345,0x1f67,0x345,2,0xf044,0x3c9,0x314,0x342,0x345,0x1f68,0xf043,0x3a9, +0x313,0x345,0x1f69,0xf043,0x3a9,0x314,0x345,0x1f6a,0x345,2,0xf044,0x3a9,0x313,0x300,0x345,0x1f6b, +0x345,2,0xf044,0x3a9,0x314,0x300,0x345,0x1f6c,0x345,2,0xf044,0x3a9,0x313,0x301,0x345,0x1f6d, +0x345,2,0xf044,0x3a9,0x314,0x301,0x345,0x1f6e,0x345,2,0xf044,0x3a9,0x313,0x342,0x345,0x1f6f, +0x345,2,0xf044,0x3a9,0x314,0x342,0x345,0xe602,0x3b1,0x306,0xe602,0x3b1,0x304,0x1f70,0xf043,0x3b1, +0x300,0x345,0xf002,0x3b1,0x345,0x3ac,0xf043,0x3b1,0x301,0x345,0x1fb6,0xf043,0x3b1,0x342,0x345,0xe602, +0x391,0x306,0xe602,0x391,0x304,0xe602,0x391,0x300,0xf002,0x391,0x345,0xe602,0xa8,0x342,0x1f74,0xf043, +0x3b7,0x300,0x345,0xf002,0x3b7,0x345,0x3ae,0xf043,0x3b7,0x301,0x345,0x1fc6,0xf043,0x3b7,0x342,0x345, +0xe602,0x395,0x300,0xe602,0x397,0x300,0xf002,0x397,0x345,0xe602,0x1fbf,0x300,0xe602,0x1fbf,0x301,0xe602, +0x1fbf,0x342,0xe602,0x3b9,0x306,0xe602,0x3b9,0x304,0x3ca,0xe643,0x3b9,0x308,0x300,0xe602,0x3b9,0x342, +0x3ca,0xe643,0x3b9,0x308,0x342,0xe602,0x399,0x306,0xe602,0x399,0x304,0xe602,0x399,0x300,0xe602,0x1ffe, +0x300,0xe602,0x1ffe,0x301,0xe602,0x1ffe,0x342,0xe602,0x3c5,0x306,0xe602,0x3c5,0x304,0x3cb,0xe643,0x3c5, +0x308,0x300,0xe602,0x3c1,0x313,0xe602,0x3c1,0x314,0xe602,0x3c5,0x342,0x3cb,0xe643,0x3c5,0x308,0x342, +0xe602,0x3a5,0x306,0xe602,0x3a5,0x304,0xe602,0x3a5,0x300,0xe602,0x3a1,0x314,0xe602,0xa8,0x300,0x1f7c, +0xf043,0x3c9,0x300,0x345,0xf002,0x3c9,0x345,0x3ce,0xf043,0x3c9,0x301,0x345,0x1ff6,0xf043,0x3c9,0x342, +0x345,0xe602,0x39f,0x300,0xe602,0x3a9,0x300,0xf002,0x3a9,0x345,0x102,0x2190,0x338,0x102,0x2192,0x338, +0x102,0x2194,0x338,0x102,0x21d0,0x338,0x102,0x21d4,0x338,0x102,0x21d2,0x338,0x102,0x2203,0x338,0x102, +0x2208,0x338,0x102,0x220b,0x338,0x102,0x2223,0x338,0x102,0x2225,0x338,0x102,0x223c,0x338,0x102,0x2243, +0x338,0x102,0x2245,0x338,0x102,0x2248,0x338,0x102,0x3d,0x338,0x102,0x2261,0x338,0x102,0x224d,0x338, +0x102,0x3c,0x338,0x102,0x3e,0x338,0x102,0x2264,0x338,0x102,0x2265,0x338,0x102,0x2272,0x338,0x102, +0x2273,0x338,0x102,0x2276,0x338,0x102,0x2277,0x338,0x102,0x227a,0x338,0x102,0x227b,0x338,0x102,0x2282, +0x338,0x102,0x2283,0x338,0x102,0x2286,0x338,0x102,0x2287,0x338,0x102,0x22a2,0x338,0x102,0x22a8,0x338, +0x102,0x22a9,0x338,0x102,0x22ab,0x338,0x102,0x227c,0x338,0x102,0x227d,0x338,0x102,0x2291,0x338,0x102, +0x2292,0x338,0x102,0x22b2,0x338,0x102,0x22b3,0x338,0x102,0x22b4,0x338,0x102,0x22b5,0x338,0x802,0x304b, +0x3099,0x802,0x304d,0x3099,0x802,0x304f,0x3099,0x802,0x3051,0x3099,0x802,0x3053,0x3099,0x802,0x3055,0x3099, +0x802,0x3057,0x3099,0x802,0x3059,0x3099,0x802,0x305b,0x3099,0x802,0x305d,0x3099,0x802,0x305f,0x3099,0x802, +0x3061,0x3099,0x802,0x3064,0x3099,0x802,0x3066,0x3099,0x802,0x3068,0x3099,0x802,0x306f,0x3099,0x802,0x306f, +0x309a,0x802,0x3072,0x3099,0x802,0x3072,0x309a,0x802,0x3075,0x3099,0x802,0x3075,0x309a,0x802,0x3078,0x3099, +0x802,0x3078,0x309a,0x802,0x307b,0x3099,0x802,0x307b,0x309a,0x802,0x3046,0x3099,0x802,0x309d,0x3099,0x802, +0x30ab,0x3099,0x802,0x30ad,0x3099,0x802,0x30af,0x3099,0x802,0x30b1,0x3099,0x802,0x30b3,0x3099,0x802,0x30b5, +0x3099,0x802,0x30b7,0x3099,0x802,0x30b9,0x3099,0x802,0x30bb,0x3099,0x802,0x30bd,0x3099,0x802,0x30bf,0x3099, +0x802,0x30c1,0x3099,0x802,0x30c4,0x3099,0x802,0x30c6,0x3099,0x802,0x30c8,0x3099,0x802,0x30cf,0x3099,0x802, +0x30cf,0x309a,0x802,0x30d2,0x3099,0x802,0x30d2,0x309a,0x802,0x30d5,0x3099,0x802,0x30d5,0x309a,0x802,0x30d8, +0x3099,0x802,0x30d8,0x309a,0x802,0x30db,0x3099,0x802,0x30db,0x309a,0x802,0x30a6,0x3099,0x802,0x30ef,0x3099, +0x802,0x30f0,0x3099,0x802,0x30f1,0x3099,0x802,0x30f2,0x3099,0x802,0x30fd,0x3099,0x704,0xd804,0xdc99,0xd804, +0xdcba,0x704,0xd804,0xdc9b,0xd804,0xdcba,0x704,0xd804,0xdca5,0xd804,0xdcba,4,0xd804,0xdd31,0xd804,0xdd27, +4,0xd804,0xdd32,0xd804,0xdd27,4,0xd804,0xdf47,0xd804,0xdf3e,4,0xd804,0xdf47,0xd804,0xdf57,4, +0xd805,0xdcb9,0xd805,0xdcba,4,0xd805,0xdcb9,0xd805,0xdcb0,4,0xd805,0xdcb9,0xd805,0xdcbd,4,0xd805, +0xddb8,0xd805,0xddaf,4,0xd805,0xddb9,0xd805,0xddaf,1,0x2b9,1,0x3b,1,0xb7,0x702,0x915, +0x93c,0x702,0x916,0x93c,0x702,0x917,0x93c,0x702,0x91c,0x93c,0x702,0x921,0x93c,0x702,0x922,0x93c, +0x702,0x92b,0x93c,0x702,0x92f,0x93c,0x702,0x9a1,0x9bc,0x702,0x9a2,0x9bc,0x702,0x9af,0x9bc,0x702, +0xa32,0xa3c,0x702,0xa38,0xa3c,0x702,0xa16,0xa3c,0x702,0xa17,0xa3c,0x702,0xa1c,0xa3c,0x702,0xa2b, +0xa3c,0x702,0xb21,0xb3c,0x702,0xb22,0xb3c,2,0xf42,0xfb7,2,0xf4c,0xfb7,2,0xf51,0xfb7, +2,0xf56,0xfb7,2,0xf5b,0xfb7,2,0xf40,0xfb5,0x8202,0xfb2,0xf80,0x8202,0xfb3,0xf80,2, +0xf92,0xfb7,2,0xf9c,0xfb7,2,0xfa1,0xfb7,2,0xfa6,0xfb7,2,0xfab,0xfb7,2,0xf90, +0xfb5,1,0x3b9,1,0x60,1,0xb4,1,0x3a9,1,0x4b,1,0x3008,1,0x3009,0x102, +0x2add,0x338,1,0x8c48,1,0x66f4,1,0x8eca,1,0x8cc8,1,0x6ed1,1,0x4e32,1,0x53e5, +1,0x9f9c,1,0x5951,1,0x91d1,1,0x5587,1,0x5948,1,0x61f6,1,0x7669,1,0x7f85, +1,0x863f,1,0x87ba,1,0x88f8,1,0x908f,1,0x6a02,1,0x6d1b,1,0x70d9,1,0x73de, +1,0x843d,1,0x916a,1,0x99f1,1,0x4e82,1,0x5375,1,0x6b04,1,0x721b,1,0x862d, +1,0x9e1e,1,0x5d50,1,0x6feb,1,0x85cd,1,0x8964,1,0x62c9,1,0x81d8,1,0x881f, +1,0x5eca,1,0x6717,1,0x6d6a,1,0x72fc,1,0x90ce,1,0x4f86,1,0x51b7,1,0x52de, +1,0x64c4,1,0x6ad3,1,0x7210,1,0x76e7,1,0x8001,1,0x8606,1,0x865c,1,0x8def, +1,0x9732,1,0x9b6f,1,0x9dfa,1,0x788c,1,0x797f,1,0x7da0,1,0x83c9,1,0x9304, +1,0x9e7f,1,0x8ad6,1,0x58df,1,0x5f04,1,0x7c60,1,0x807e,1,0x7262,1,0x78ca, +1,0x8cc2,1,0x96f7,1,0x58d8,1,0x5c62,1,0x6a13,1,0x6dda,1,0x6f0f,1,0x7d2f, +1,0x7e37,1,0x964b,1,0x52d2,1,0x808b,1,0x51dc,1,0x51cc,1,0x7a1c,1,0x7dbe, +1,0x83f1,1,0x9675,1,0x8b80,1,0x62cf,1,0x8afe,1,0x4e39,1,0x5be7,1,0x6012, +1,0x7387,1,0x7570,1,0x5317,1,0x78fb,1,0x4fbf,1,0x5fa9,1,0x4e0d,1,0x6ccc, +1,0x6578,1,0x7d22,1,0x53c3,1,0x585e,1,0x7701,1,0x8449,1,0x8aaa,1,0x6bba, +1,0x8fb0,1,0x6c88,1,0x62fe,1,0x82e5,1,0x63a0,1,0x7565,1,0x4eae,1,0x5169, +1,0x51c9,1,0x6881,1,0x7ce7,1,0x826f,1,0x8ad2,1,0x91cf,1,0x52f5,1,0x5442, +1,0x5973,1,0x5eec,1,0x65c5,1,0x6ffe,1,0x792a,1,0x95ad,1,0x9a6a,1,0x9e97, +1,0x9ece,1,0x529b,1,0x66c6,1,0x6b77,1,0x8f62,1,0x5e74,1,0x6190,1,0x6200, +1,0x649a,1,0x6f23,1,0x7149,1,0x7489,1,0x79ca,1,0x7df4,1,0x806f,1,0x8f26, +1,0x84ee,1,0x9023,1,0x934a,1,0x5217,1,0x52a3,1,0x54bd,1,0x70c8,1,0x88c2, +1,0x5ec9,1,0x5ff5,1,0x637b,1,0x6bae,1,0x7c3e,1,0x7375,1,0x4ee4,1,0x56f9, +1,0x5dba,1,0x601c,1,0x73b2,1,0x7469,1,0x7f9a,1,0x8046,1,0x9234,1,0x96f6, +1,0x9748,1,0x9818,1,0x4f8b,1,0x79ae,1,0x91b4,1,0x96b8,1,0x60e1,1,0x4e86, +1,0x50da,1,0x5bee,1,0x5c3f,1,0x6599,1,0x71ce,1,0x7642,1,0x84fc,1,0x907c, +1,0x9f8d,1,0x6688,1,0x962e,1,0x5289,1,0x677b,1,0x67f3,1,0x6d41,1,0x6e9c, +1,0x7409,1,0x7559,1,0x786b,1,0x7d10,1,0x985e,1,0x516d,1,0x622e,1,0x9678, +1,0x502b,1,0x5d19,1,0x6dea,1,0x8f2a,1,0x5f8b,1,0x6144,1,0x6817,1,0x9686, +1,0x5229,1,0x540f,1,0x5c65,1,0x6613,1,0x674e,1,0x68a8,1,0x6ce5,1,0x7406, +1,0x75e2,1,0x7f79,1,0x88cf,1,0x88e1,1,0x91cc,1,0x96e2,1,0x533f,1,0x6eba, +1,0x541d,1,0x71d0,1,0x7498,1,0x85fa,1,0x96a3,1,0x9c57,1,0x9e9f,1,0x6797, +1,0x6dcb,1,0x81e8,1,0x7acb,1,0x7b20,1,0x7c92,1,0x72c0,1,0x7099,1,0x8b58, +1,0x4ec0,1,0x8336,1,0x523a,1,0x5207,1,0x5ea6,1,0x62d3,1,0x7cd6,1,0x5b85, +1,0x6d1e,1,0x66b4,1,0x8f3b,1,0x884c,1,0x964d,1,0x898b,1,0x5ed3,1,0x5140, +1,0x55c0,1,0x585a,1,0x6674,1,0x51de,1,0x732a,1,0x76ca,1,0x793c,1,0x795e, +1,0x7965,1,0x798f,1,0x9756,1,0x7cbe,1,0x7fbd,1,0x8612,1,0x8af8,1,0x9038, +1,0x90fd,1,0x98ef,1,0x98fc,1,0x9928,1,0x9db4,1,0x90de,1,0x96b7,1,0x4fae, +1,0x50e7,1,0x514d,1,0x52c9,1,0x52e4,1,0x5351,1,0x559d,1,0x5606,1,0x5668, +1,0x5840,1,0x58a8,1,0x5c64,1,0x5c6e,1,0x6094,1,0x6168,1,0x618e,1,0x61f2, +1,0x654f,1,0x65e2,1,0x6691,1,0x6885,1,0x6d77,1,0x6e1a,1,0x6f22,1,0x716e, +1,0x722b,1,0x7422,1,0x7891,1,0x793e,1,0x7949,1,0x7948,1,0x7950,1,0x7956, +1,0x795d,1,0x798d,1,0x798e,1,0x7a40,1,0x7a81,1,0x7bc0,1,0x7e09,1,0x7e41, +1,0x7f72,1,0x8005,1,0x81ed,1,0x8279,1,0x8457,1,0x8910,1,0x8996,1,0x8b01, +1,0x8b39,1,0x8cd3,1,0x8d08,1,0x8fb6,1,0x96e3,1,0x97ff,1,0x983b,1,0x6075, +2,0xd850,0xdeee,1,0x8218,1,0x4e26,1,0x51b5,1,0x5168,1,0x4f80,1,0x5145,1, +0x5180,1,0x52c7,1,0x52fa,1,0x5555,1,0x5599,1,0x55e2,1,0x58b3,1,0x5944,1, +0x5954,1,0x5a62,1,0x5b28,1,0x5ed2,1,0x5ed9,1,0x5f69,1,0x5fad,1,0x60d8,1, +0x614e,1,0x6108,1,0x6160,1,0x6234,1,0x63c4,1,0x641c,1,0x6452,1,0x6556,1, +0x671b,1,0x6756,1,0x6b79,1,0x6edb,1,0x6ecb,1,0x701e,1,0x77a7,1,0x7235,1, +0x72af,1,0x7471,1,0x7506,1,0x753b,1,0x761d,1,0x761f,1,0x76db,1,0x76f4,1, +0x774a,1,0x7740,1,0x78cc,1,0x7ab1,1,0x7c7b,1,0x7d5b,1,0x7f3e,1,0x8352,1, +0x83ef,1,0x8779,1,0x8941,1,0x8986,1,0x8abf,1,0x8acb,1,0x8aed,1,0x8b8a,1, +0x8f38,1,0x9072,1,0x9199,1,0x9276,1,0x967c,1,0x97db,1,0x980b,1,0x9b12,2, +0xd84a,0xdc4a,2,0xd84a,0xdc44,2,0xd84c,0xdfd5,1,0x3b9d,1,0x4018,1,0x4039,2,0xd854, +0xde49,2,0xd857,0xdcd0,2,0xd85f,0xded3,1,0x9f43,1,0x9f8e,0xe02,0x5d9,0x5b4,0x1102,0x5f2, +0x5b7,0x1802,0x5e9,0x5c1,0x1902,0x5e9,0x5c2,0xfb49,0x1843,0x5e9,0x5bc,0x5c1,0xfb49,0x1943,0x5e9,0x5bc, +0x5c2,0x1102,0x5d0,0x5b7,0x1202,0x5d0,0x5b8,0x1502,0x5d0,0x5bc,0x1502,0x5d1,0x5bc,0x1502,0x5d2,0x5bc, +0x1502,0x5d3,0x5bc,0x1502,0x5d4,0x5bc,0x1502,0x5d5,0x5bc,0x1502,0x5d6,0x5bc,0x1502,0x5d8,0x5bc,0x1502, +0x5d9,0x5bc,0x1502,0x5da,0x5bc,0x1502,0x5db,0x5bc,0x1502,0x5dc,0x5bc,0x1502,0x5de,0x5bc,0x1502,0x5e0, +0x5bc,0x1502,0x5e1,0x5bc,0x1502,0x5e3,0x5bc,0x1502,0x5e4,0x5bc,0x1502,0x5e6,0x5bc,0x1502,0x5e7,0x5bc, +0x1502,0x5e8,0x5bc,0x1502,0x5e9,0x5bc,0x1502,0x5ea,0x5bc,0x1302,0x5d5,0x5b9,0x1702,0x5d1,0x5bf,0x1702, +0x5db,0x5bf,0x1702,0x5e4,0x5bf,0xd804,0xd834,0xdd57,0xd834,0xdd65,0xd804,0xd834,0xdd58,0xd834,0xdd65,0xd834, +0xdd5f,0xd834,0xdd6e,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd6e,0xd834,0xdd5f,0xd834,0xdd6f,4, +0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd6f,0xd834,0xdd5f,0xd834,0xdd70,4,0xd846,0xd834,0xdd58,0xd834, +0xdd65,0xd834,0xdd70,0xd834,0xdd5f,0xd834,0xdd71,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd71,0xd834, +0xdd5f,0xd834,0xdd72,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd72,0xd804,0xd834,0xddb9,0xd834,0xdd65, +0xd804,0xd834,0xddba,0xd834,0xdd65,0xd834,0xddbb,0xd834,0xdd6e,4,0xd846,0xd834,0xddb9,0xd834,0xdd65,0xd834, +0xdd6e,0xd834,0xddbc,0xd834,0xdd6e,4,0xd846,0xd834,0xddba,0xd834,0xdd65,0xd834,0xdd6e,0xd834,0xddbb,0xd834, +0xdd6f,4,0xd846,0xd834,0xddb9,0xd834,0xdd65,0xd834,0xdd6f,0xd834,0xddbc,0xd834,0xdd6f,4,0xd846,0xd834, +0xddba,0xd834,0xdd65,0xd834,0xdd6f,1,0x4e3d,1,0x4e38,1,0x4e41,2,0xd840,0xdd22,1,0x4f60, +1,0x4fbb,1,0x5002,1,0x507a,1,0x5099,1,0x50cf,1,0x349e,2,0xd841,0xde3a,1, +0x5154,1,0x5164,1,0x5177,2,0xd841,0xdd1c,1,0x34b9,1,0x5167,1,0x518d,2,0xd841, +0xdd4b,1,0x5197,1,0x51a4,1,0x4ecc,1,0x51ac,2,0xd864,0xdddf,1,0x51f5,1,0x5203, +1,0x34df,1,0x523b,1,0x5246,1,0x5272,1,0x5277,1,0x3515,1,0x5305,1,0x5306, +1,0x5349,1,0x535a,1,0x5373,1,0x537d,1,0x537f,2,0xd842,0xde2c,1,0x7070,1, +0x53ca,1,0x53df,2,0xd842,0xdf63,1,0x53eb,1,0x53f1,1,0x5406,1,0x549e,1,0x5438, +1,0x5448,1,0x5468,1,0x54a2,1,0x54f6,1,0x5510,1,0x5553,1,0x5563,1,0x5584, +1,0x55ab,1,0x55b3,1,0x55c2,1,0x5716,1,0x5717,1,0x5651,1,0x5674,1,0x58ee, +1,0x57ce,1,0x57f4,1,0x580d,1,0x578b,1,0x5832,1,0x5831,1,0x58ac,2,0xd845, +0xdce4,1,0x58f2,1,0x58f7,1,0x5906,1,0x591a,1,0x5922,1,0x5962,2,0xd845,0xdea8, +2,0xd845,0xdeea,1,0x59ec,1,0x5a1b,1,0x5a27,1,0x59d8,1,0x5a66,1,0x36ee,1, +0x36fc,1,0x5b08,1,0x5b3e,2,0xd846,0xddc8,1,0x5bc3,1,0x5bd8,1,0x5bf3,2,0xd846, +0xdf18,1,0x5bff,1,0x5c06,1,0x5f53,1,0x5c22,1,0x3781,1,0x5c60,1,0x5cc0,1, +0x5c8d,2,0xd847,0xdde4,1,0x5d43,2,0xd847,0xdde6,1,0x5d6e,1,0x5d6b,1,0x5d7c,1, +0x5de1,1,0x5de2,1,0x382f,1,0x5dfd,1,0x5e28,1,0x5e3d,1,0x5e69,1,0x3862,2, +0xd848,0xdd83,1,0x387c,1,0x5eb0,1,0x5eb3,1,0x5eb6,2,0xd868,0xdf92,1,0x5efe,2, +0xd848,0xdf31,1,0x8201,1,0x5f22,1,0x38c7,2,0xd84c,0xdeb8,2,0xd858,0xddda,1,0x5f62, +1,0x5f6b,1,0x38e3,1,0x5f9a,1,0x5fcd,1,0x5fd7,1,0x5ff9,1,0x6081,1,0x393a, +1,0x391c,2,0xd849,0xded4,1,0x60c7,1,0x6148,1,0x614c,1,0x617a,1,0x61b2,1, +0x61a4,1,0x61af,1,0x61de,1,0x6210,1,0x621b,1,0x625d,1,0x62b1,1,0x62d4,1, +0x6350,2,0xd84a,0xdf0c,1,0x633d,1,0x62fc,1,0x6368,1,0x6383,1,0x63e4,2,0xd84a, +0xdff1,1,0x6422,1,0x63c5,1,0x63a9,1,0x3a2e,1,0x6469,1,0x647e,1,0x649d,1, +0x6477,1,0x3a6c,1,0x656c,2,0xd84c,0xdc0a,1,0x65e3,1,0x66f8,1,0x6649,1,0x3b19, +1,0x3b08,1,0x3ae4,1,0x5192,1,0x5195,1,0x6700,1,0x669c,1,0x80ad,1,0x43d9, +1,0x6721,1,0x675e,1,0x6753,2,0xd84c,0xdfc3,1,0x3b49,1,0x67fa,1,0x6785,1, +0x6852,2,0xd84d,0xdc6d,1,0x688e,1,0x681f,1,0x6914,1,0x6942,1,0x69a3,1,0x69ea, +1,0x6aa8,2,0xd84d,0xdea3,1,0x6adb,1,0x3c18,1,0x6b21,2,0xd84e,0xdca7,1,0x6b54, +1,0x3c4e,1,0x6b72,1,0x6b9f,1,0x6bbb,2,0xd84e,0xde8d,2,0xd847,0xdd0b,2,0xd84e, +0xdefa,1,0x6c4e,2,0xd84f,0xdcbc,1,0x6cbf,1,0x6ccd,1,0x6c67,1,0x6d16,1,0x6d3e, +1,0x6d69,1,0x6d78,1,0x6d85,2,0xd84f,0xdd1e,1,0x6d34,1,0x6e2f,1,0x6e6e,1, +0x3d33,1,0x6ec7,2,0xd84f,0xded1,1,0x6df9,1,0x6f6e,2,0xd84f,0xdf5e,2,0xd84f,0xdf8e, +1,0x6fc6,1,0x7039,1,0x701b,1,0x3d96,1,0x704a,1,0x707d,1,0x7077,1,0x70ad, +2,0xd841,0xdd25,1,0x7145,2,0xd850,0xde63,1,0x719c,2,0xd850,0xdfab,1,0x7228,1, +0x7250,2,0xd851,0xde08,1,0x7280,1,0x7295,2,0xd851,0xdf35,2,0xd852,0xdc14,1,0x737a, +1,0x738b,1,0x3eac,1,0x73a5,1,0x3eb8,1,0x7447,1,0x745c,1,0x7485,1,0x74ca, +1,0x3f1b,1,0x7524,2,0xd853,0xdc36,1,0x753e,2,0xd853,0xdc92,2,0xd848,0xdd9f,1, +0x7610,2,0xd853,0xdfa1,2,0xd853,0xdfb8,2,0xd854,0xdc44,1,0x3ffc,1,0x4008,2,0xd854, +0xdcf3,2,0xd854,0xdcf2,2,0xd854,0xdd19,2,0xd854,0xdd33,1,0x771e,1,0x771f,1,0x778b, +1,0x4046,1,0x4096,2,0xd855,0xdc1d,1,0x784e,1,0x40e3,2,0xd855,0xde26,2,0xd855, +0xde9a,2,0xd855,0xdec5,1,0x79eb,1,0x412f,1,0x7a4a,1,0x7a4f,2,0xd856,0xdd7c,2, +0xd856,0xdea7,1,0x7aee,1,0x4202,2,0xd856,0xdfab,1,0x7bc6,1,0x7bc9,1,0x4227,2, +0xd857,0xdc80,1,0x7cd2,1,0x42a0,1,0x7ce8,1,0x7ce3,1,0x7d00,2,0xd857,0xdf86,1, +0x7d63,1,0x4301,1,0x7dc7,1,0x7e02,1,0x7e45,1,0x4334,2,0xd858,0xde28,2,0xd858, +0xde47,1,0x4359,2,0xd858,0xded9,1,0x7f7a,2,0xd858,0xdf3e,1,0x7f95,1,0x7ffa,2, +0xd859,0xdcda,2,0xd859,0xdd23,1,0x8060,2,0xd859,0xdda8,1,0x8070,2,0xd84c,0xdf5f,1, +0x43d5,1,0x80b2,1,0x8103,1,0x440b,1,0x813e,1,0x5ab5,2,0xd859,0xdfa7,2,0xd859, +0xdfb5,2,0xd84c,0xdf93,2,0xd84c,0xdf9c,1,0x8204,1,0x8f9e,1,0x446b,1,0x8291,1, +0x828b,1,0x829d,1,0x52b3,1,0x82b1,1,0x82b3,1,0x82bd,1,0x82e6,2,0xd85a,0xdf3c, +1,0x831d,1,0x8363,1,0x83ad,1,0x8323,1,0x83bd,1,0x83e7,1,0x8353,1,0x83ca, +1,0x83cc,1,0x83dc,2,0xd85b,0xdc36,2,0xd85b,0xdd6b,2,0xd85b,0xdcd5,1,0x452b,1, +0x84f1,1,0x84f3,1,0x8516,2,0xd85c,0xdfca,1,0x8564,2,0xd85b,0xdf2c,1,0x455d,1, +0x4561,2,0xd85b,0xdfb1,2,0xd85c,0xdcd2,1,0x456b,1,0x8650,1,0x8667,1,0x8669,1, +0x86a9,1,0x8688,1,0x870e,1,0x86e2,1,0x8728,1,0x876b,1,0x8786,1,0x45d7,1, +0x87e1,1,0x8801,1,0x45f9,1,0x8860,1,0x8863,2,0xd85d,0xde67,1,0x88d7,1,0x88de, +1,0x4635,1,0x88fa,1,0x34bb,2,0xd85e,0xdcae,2,0xd85e,0xdd66,1,0x46be,1,0x46c7, +1,0x8aa0,1,0x8c55,2,0xd85f,0xdca8,1,0x8cab,1,0x8cc1,1,0x8d1b,1,0x8d77,2, +0xd85f,0xdf2f,2,0xd842,0xdc04,1,0x8dcb,1,0x8dbc,1,0x8df0,2,0xd842,0xdcde,1,0x8ed4, +2,0xd861,0xddd2,2,0xd861,0xdded,1,0x9094,1,0x90f1,1,0x9111,2,0xd861,0xdf2e,1, +0x911b,1,0x9238,1,0x92d7,1,0x92d8,1,0x927c,1,0x93f9,1,0x9415,2,0xd862,0xdffa, +1,0x958b,1,0x4995,1,0x95b7,2,0xd863,0xdd77,1,0x49e6,1,0x96c3,1,0x5db2,1, +0x9723,2,0xd864,0xdd45,2,0xd864,0xde1a,1,0x4a6e,1,0x4a76,1,0x97e0,2,0xd865,0xdc0a, +1,0x4ab2,2,0xd865,0xdc96,1,0x9829,2,0xd865,0xddb6,1,0x98e2,1,0x4b33,1,0x9929, +1,0x99a7,1,0x99c2,1,0x99fe,1,0x4bce,2,0xd866,0xdf30,1,0x9c40,1,0x9cfd,1, +0x4cce,1,0x4ced,1,0x9d67,2,0xd868,0xdcce,1,0x4cf8,2,0xd868,0xdd05,2,0xd868,0xde0e, +2,0xd868,0xde91,1,0x9ebb,1,0x4d56,1,0x9ef9,1,0x9efe,1,0x9f05,1,0x9f0f,1, +0x9f16,1,0x9f3b,2,0xd869,0xde00,0x3ac,0xe642,0x3b1,0x301,0x3ad,0xe642,0x3b5,0x301,0x3ae,0xe642, +0x3b7,0x301,0x3af,0xe642,0x3b9,0x301,0x3cc,0xe642,0x3bf,0x301,0x3cd,0xe642,0x3c5,0x301,0x3ce,0xe642, +0x3c9,0x301,0x386,0xe642,0x391,0x301,0x388,0xe642,0x395,0x301,0x389,0xe642,0x397,0x301,0x390,1, +0xe643,0x3b9,0x308,0x301,0x38a,0xe642,0x399,0x301,0x3b0,1,0xe643,0x3c5,0x308,0x301,0x38e,0xe642, +0x3a5,0x301,0x385,0xe642,0xa8,0x301,0x38c,0xe642,0x39f,0x301,0x38f,0xe642,0x3a9,0x301,0xc5,0xe642, +0x41,0x30a,0xe6e6,0xe681,0x300,0xe6e6,0xe681,0x301,0xe6e6,0xe681,0x313,0xe6e6,0xe682,0x308,0x301,0x8100, +0x8282,0xf71,0xf72,0x8100,0x8482,0xf71,0xf74,0x8100,0x8282,0xf71,0xf80,0 }; static const uint8_t norm2_nfc_data_smallFCD[256]={ -0xc0,0xef,3,0x7f,0xdf,0x70,0xcf,0x87,0xc7,0x66,0x66,0x46,0x64,0x44,0x66,0x5b, +0xc0,0xef,3,0x7f,0xdf,0x70,0xcf,0x87,0xc7,0x66,0x66,0x46,0x64,0x46,0x66,0x5b, 0x12,0,0,4,0,0,0,0x43,0x20,2,0x29,0xae,0xc2,0xc0,0xff,0xff, 0xc0,0x72,0xbf,0,0,0,0,0,0,0,0x40,0,0x80,0x88,0,0, 0xfe,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -1135,13 +1143,13 @@ static const UTrie2 norm2_nfc_data_trie={ norm2_nfc_data_trieIndex+2720, NULL, 2720, - 6932, + 7056, 0x188, 0xb1c, - 0x0, - 0x0, + 0x1, + 0x1, 0x30000, - 0x25b0, + 0x262c, NULL, 0, FALSE, FALSE, 0, NULL }; diff --git a/deps/icu-small/source/common/norm2allmodes.h b/deps/icu-small/source/common/norm2allmodes.h index 943e83d56704c6..682ece28f13092 100644 --- a/deps/icu-small/source/common/norm2allmodes.h +++ b/deps/icu-small/source/common/norm2allmodes.h @@ -1,11 +1,11 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * Copyright (C) 2014, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* -* loadednormalizer2impl.h +* norm2allmodes.h * * created on: 2014sep07 * created by: Markus W. Scherer @@ -18,7 +18,9 @@ #if !UCONFIG_NO_NORMALIZATION +#include "unicode/edits.h" #include "unicode/normalizer2.h" +#include "unicode/stringoptions.h" #include "unicode/unistr.h" #include "cpputils.h" #include "normalizer2impl.h" @@ -210,8 +212,8 @@ class DecomposeNormalizer2 : public Normalizer2WithImpl { virtual UNormalizationCheckResult getQuickCheck(UChar32 c) const { return impl.isDecompYes(impl.getNorm16(c)) ? UNORM_YES : UNORM_NO; } - virtual UBool hasBoundaryBefore(UChar32 c) const { return impl.hasDecompBoundary(c, TRUE); } - virtual UBool hasBoundaryAfter(UChar32 c) const { return impl.hasDecompBoundary(c, FALSE); } + virtual UBool hasBoundaryBefore(UChar32 c) const { return impl.hasDecompBoundaryBefore(c); } + virtual UBool hasBoundaryAfter(UChar32 c) const { return impl.hasDecompBoundaryAfter(c); } virtual UBool isInert(UChar32 c) const { return impl.isDecompInert(c); } }; @@ -224,19 +226,35 @@ class ComposeNormalizer2 : public Normalizer2WithImpl { private: virtual void normalize(const UChar *src, const UChar *limit, - ReorderingBuffer &buffer, UErrorCode &errorCode) const { + ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE { impl.compose(src, limit, onlyContiguous, TRUE, buffer, errorCode); } using Normalizer2WithImpl::normalize; // Avoid warning about hiding base class function. + + void + normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink, + Edits *edits, UErrorCode &errorCode) const U_OVERRIDE { + if (U_FAILURE(errorCode)) { + return; + } + if (edits != nullptr && (options & U_EDITS_NO_RESET) == 0) { + edits->reset(); + } + const uint8_t *s = reinterpret_cast(src.data()); + impl.composeUTF8(options, onlyContiguous, s, s + src.length(), + &sink, edits, errorCode); + sink.Flush(); + } + virtual void normalizeAndAppend(const UChar *src, const UChar *limit, UBool doNormalize, UnicodeString &safeMiddle, - ReorderingBuffer &buffer, UErrorCode &errorCode) const { + ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE { impl.composeAndAppend(src, limit, doNormalize, onlyContiguous, safeMiddle, buffer, errorCode); } virtual UBool - isNormalized(const UnicodeString &s, UErrorCode &errorCode) const { + isNormalized(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE { if(U_FAILURE(errorCode)) { return FALSE; } @@ -252,8 +270,16 @@ class ComposeNormalizer2 : public Normalizer2WithImpl { } return impl.compose(sArray, sArray+s.length(), onlyContiguous, FALSE, buffer, errorCode); } + virtual UBool + isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) const U_OVERRIDE { + if(U_FAILURE(errorCode)) { + return FALSE; + } + const uint8_t *s = reinterpret_cast(sp.data()); + return impl.composeUTF8(0, onlyContiguous, s, s + sp.length(), nullptr, nullptr, errorCode); + } virtual UNormalizationCheckResult - quickCheck(const UnicodeString &s, UErrorCode &errorCode) const { + quickCheck(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE { if(U_FAILURE(errorCode)) { return UNORM_MAYBE; } @@ -267,21 +293,21 @@ class ComposeNormalizer2 : public Normalizer2WithImpl { return qcResult; } virtual const UChar * - spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &) const { + spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &) const U_OVERRIDE { return impl.composeQuickCheck(src, limit, onlyContiguous, NULL); } using Normalizer2WithImpl::spanQuickCheckYes; // Avoid warning about hiding base class function. - virtual UNormalizationCheckResult getQuickCheck(UChar32 c) const { + virtual UNormalizationCheckResult getQuickCheck(UChar32 c) const U_OVERRIDE { return impl.getCompQuickCheck(impl.getNorm16(c)); } - virtual UBool hasBoundaryBefore(UChar32 c) const { + virtual UBool hasBoundaryBefore(UChar32 c) const U_OVERRIDE { return impl.hasCompBoundaryBefore(c); } - virtual UBool hasBoundaryAfter(UChar32 c) const { - return impl.hasCompBoundaryAfter(c, onlyContiguous, FALSE); + virtual UBool hasBoundaryAfter(UChar32 c) const U_OVERRIDE { + return impl.hasCompBoundaryAfter(c, onlyContiguous); } - virtual UBool isInert(UChar32 c) const { - return impl.hasCompBoundaryAfter(c, onlyContiguous, TRUE); + virtual UBool isInert(UChar32 c) const U_OVERRIDE { + return impl.isCompInert(c, onlyContiguous); } const UBool onlyContiguous; diff --git a/deps/icu-small/source/common/normalizer2.cpp b/deps/icu-small/source/common/normalizer2.cpp index 34f1cf063d50bc..133770cbc4d9aa 100644 --- a/deps/icu-small/source/common/normalizer2.cpp +++ b/deps/icu-small/source/common/normalizer2.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: normalizer2.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -20,7 +20,9 @@ #if !UCONFIG_NO_NORMALIZATION +#include "unicode/edits.h" #include "unicode/normalizer2.h" +#include "unicode/stringoptions.h" #include "unicode/unistr.h" #include "unicode/unorm.h" #include "cstring.h" @@ -42,6 +44,20 @@ U_NAMESPACE_BEGIN Normalizer2::~Normalizer2() {} +void +Normalizer2::normalizeUTF8(uint32_t /*options*/, StringPiece src, ByteSink &sink, + Edits *edits, UErrorCode &errorCode) const { + if (U_FAILURE(errorCode)) { + return; + } + if (edits != nullptr) { + errorCode = U_UNSUPPORTED_ERROR; + return; + } + UnicodeString src16 = UnicodeString::fromUTF8(src); + normalize(src16, errorCode).toUTF8(sink); +} + UBool Normalizer2::getRawDecomposition(UChar32, UnicodeString &) const { return FALSE; @@ -57,6 +73,11 @@ Normalizer2::getCombiningClass(UChar32 /*c*/) const { return 0; } +UBool +Normalizer2::isNormalizedUTF8(StringPiece s, UErrorCode &errorCode) const { + return U_SUCCESS(errorCode) && isNormalized(UnicodeString::fromUTF8(s), errorCode); +} + // Normalizer2 implementation for the old UNORM_NONE. class NoopNormalizer2 : public Normalizer2 { virtual ~NoopNormalizer2(); @@ -64,7 +85,7 @@ class NoopNormalizer2 : public Normalizer2 { virtual UnicodeString & normalize(const UnicodeString &src, UnicodeString &dest, - UErrorCode &errorCode) const { + UErrorCode &errorCode) const U_OVERRIDE { if(U_SUCCESS(errorCode)) { if(&dest!=&src) { dest=src; @@ -74,10 +95,27 @@ class NoopNormalizer2 : public Normalizer2 { } return dest; } + virtual void + normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink, + Edits *edits, UErrorCode &errorCode) const U_OVERRIDE { + if(U_SUCCESS(errorCode)) { + if (edits != nullptr) { + if ((options & U_EDITS_NO_RESET) == 0) { + edits->reset(); + } + edits->addUnchanged(src.length()); + } + if ((options & U_OMIT_UNCHANGED_TEXT) == 0) { + sink.Append(src.data(), src.length()); + } + sink.Flush(); + } + } + virtual UnicodeString & normalizeSecondAndAppend(UnicodeString &first, const UnicodeString &second, - UErrorCode &errorCode) const { + UErrorCode &errorCode) const U_OVERRIDE { if(U_SUCCESS(errorCode)) { if(&first!=&second) { first.append(second); @@ -90,7 +128,7 @@ class NoopNormalizer2 : public Normalizer2 { virtual UnicodeString & append(UnicodeString &first, const UnicodeString &second, - UErrorCode &errorCode) const { + UErrorCode &errorCode) const U_OVERRIDE { if(U_SUCCESS(errorCode)) { if(&first!=&second) { first.append(second); @@ -101,25 +139,29 @@ class NoopNormalizer2 : public Normalizer2 { return first; } virtual UBool - getDecomposition(UChar32, UnicodeString &) const { + getDecomposition(UChar32, UnicodeString &) const U_OVERRIDE { return FALSE; } - // No need to override the default getRawDecomposition(). + // No need to U_OVERRIDE the default getRawDecomposition(). + virtual UBool + isNormalized(const UnicodeString &, UErrorCode &errorCode) const U_OVERRIDE { + return U_SUCCESS(errorCode); + } virtual UBool - isNormalized(const UnicodeString &, UErrorCode &) const { - return TRUE; + isNormalizedUTF8(StringPiece, UErrorCode &errorCode) const U_OVERRIDE { + return U_SUCCESS(errorCode); } virtual UNormalizationCheckResult - quickCheck(const UnicodeString &, UErrorCode &) const { + quickCheck(const UnicodeString &, UErrorCode &) const U_OVERRIDE { return UNORM_YES; } virtual int32_t - spanQuickCheckYes(const UnicodeString &s, UErrorCode &) const { + spanQuickCheckYes(const UnicodeString &s, UErrorCode &) const U_OVERRIDE { return s.length(); } - virtual UBool hasBoundaryBefore(UChar32) const { return TRUE; } - virtual UBool hasBoundaryAfter(UChar32) const { return TRUE; } - virtual UBool isInert(UChar32) const { return TRUE; } + virtual UBool hasBoundaryBefore(UChar32) const U_OVERRIDE { return TRUE; } + virtual UBool hasBoundaryAfter(UChar32) const U_OVERRIDE { return TRUE; } + virtual UBool isInert(UChar32) const U_OVERRIDE { return TRUE; } }; NoopNormalizer2::~NoopNormalizer2() {} diff --git a/deps/icu-small/source/common/normalizer2impl.cpp b/deps/icu-small/source/common/normalizer2impl.cpp index 906c03a689bc16..15b4a528934779 100644 --- a/deps/icu-small/source/common/normalizer2impl.cpp +++ b/deps/icu-small/source/common/normalizer2impl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: normalizer2impl.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -20,10 +20,15 @@ #if !UCONFIG_NO_NORMALIZATION +#include "unicode/bytestream.h" +#include "unicode/edits.h" #include "unicode/normalizer2.h" +#include "unicode/stringoptions.h" #include "unicode/udata.h" #include "unicode/ustring.h" #include "unicode/utf16.h" +#include "unicode/utf8.h" +#include "bytesinkutil.h" #include "cmemory.h" #include "mutex.h" #include "normalizer2impl.h" @@ -35,8 +40,142 @@ U_NAMESPACE_BEGIN +namespace { + +/** + * UTF-8 lead byte for minNoMaybeCP. + * Can be lower than the actual lead byte for c. + * Typically U+0300 for NFC/NFD, U+00A0 for NFKC/NFKD, U+0041 for NFKC_Casefold. + */ +inline uint8_t leadByteForCP(UChar32 c) { + if (c <= 0x7f) { + return (uint8_t)c; + } else if (c <= 0x7ff) { + return (uint8_t)(0xc0+(c>>6)); + } else { + // Should not occur because ccc(U+0300)!=0. + return 0xe0; + } +} + +/** + * Returns the code point from one single well-formed UTF-8 byte sequence + * between cpStart and cpLimit. + * + * UTrie2 UTF-8 macros do not assemble whole code points (for efficiency). + * When we do need the code point, we call this function. + * We should not need it for normalization-inert data (norm16==0). + * Illegal sequences yield the error value norm16==0 just like real normalization-inert code points. + */ +UChar32 codePointFromValidUTF8(const uint8_t *cpStart, const uint8_t *cpLimit) { + // Similar to U8_NEXT_UNSAFE(s, i, c). + U_ASSERT(cpStart < cpLimit); + uint8_t c = *cpStart; + switch(cpLimit-cpStart) { + case 1: + return c; + 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)); + case 4: + return ((c&7)<<18) | ((cpStart[1]&0x3f)<<12) | ((cpStart[2]&0x3f)<<6) | (cpStart[3]&0x3f); + default: + U_ASSERT(FALSE); // Should not occur. + return U_SENTINEL; + } +} + +/** + * Returns the last code point in [start, p[ if it is valid and in U+1000..U+D7FF. + * Otherwise returns a negative value. + */ +UChar32 previousHangulOrJamo(const uint8_t *start, const uint8_t *p) { + if ((p - start) >= 3) { + p -= 3; + uint8_t l = *p; + uint8_t t1, t2; + if (0xe1 <= l && l <= 0xed && + (t1 = (uint8_t)(p[1] - 0x80)) <= 0x3f && + (t2 = (uint8_t)(p[2] - 0x80)) <= 0x3f && + (l < 0xed || t1 <= 0x1f)) { + return ((l & 0xf) << 12) | (t1 << 6) | t2; + } + } + return U_SENTINEL; +} + +/** + * Returns the offset from the Jamo T base if [src, limit[ starts with a single Jamo T code point. + * Otherwise returns a negative value. + */ +int32_t getJamoTMinusBase(const uint8_t *src, const uint8_t *limit) { + // Jamo T: E1 86 A8..E1 87 82 + if ((limit - src) >= 3 && *src == 0xe1) { + if (src[1] == 0x86) { + uint8_t t = src[2]; + // The first Jamo T is U+11A8 but JAMO_T_BASE is 11A7. + // Offset 0 does not correspond to any conjoining Jamo. + if (0xa8 <= t && t <= 0xbf) { + return t - 0xa7; + } + } else if (src[1] == 0x87) { + uint8_t t = src[2]; + if ((int8_t)t <= (int8_t)0x82) { + return t - (0xa7 - 0x40); + } + } + } + return -1; +} + +void +appendCodePointDelta(const uint8_t *cpStart, const uint8_t *cpLimit, int32_t delta, + ByteSink &sink, Edits *edits) { + char buffer[U8_MAX_LENGTH]; + int32_t length; + int32_t cpLength = (int32_t)(cpLimit - cpStart); + if (cpLength == 1) { + // The builder makes ASCII map to ASCII. + buffer[0] = (uint8_t)(*cpStart + delta); + length = 1; + } else { + int32_t trail = *(cpLimit-1) + delta; + if (0x80 <= trail && trail <= 0xbf) { + // The delta only changes the last trail byte. + --cpLimit; + length = 0; + do { buffer[length++] = *cpStart++; } while (cpStart < cpLimit); + buffer[length++] = (uint8_t)trail; + } else { + // Decode the code point, add the delta, re-encode. + UChar32 c = codePointFromValidUTF8(cpStart, cpLimit) + delta; + length = 0; + U8_APPEND_UNSAFE(buffer, length, c); + } + } + if (edits != nullptr) { + edits->addReplace(cpLength, length); + } + sink.Append(buffer, length); +} + +} // namespace + // ReorderingBuffer -------------------------------------------------------- *** +ReorderingBuffer::ReorderingBuffer(const Normalizer2Impl &ni, UnicodeString &dest, + UErrorCode &errorCode) : + impl(ni), str(dest), + start(str.getBuffer(8)), reorderStart(start), limit(start), + remainingCapacity(str.getCapacity()), lastCC(0) { + if (start == nullptr && U_SUCCESS(errorCode)) { + // getBuffer() already did str.setToBogus() + errorCode = U_MEMORY_ALLOCATION_ERROR; + } +} + UBool ReorderingBuffer::init(int32_t destCapacity, UErrorCode &errorCode) { int32_t length=str.length(); start=str.getBuffer(destCapacity); @@ -69,6 +208,32 @@ UBool ReorderingBuffer::equals(const UChar *otherStart, const UChar *otherLimit) 0==u_memcmp(start, otherStart, length); } +UBool ReorderingBuffer::equals(const uint8_t *otherStart, const uint8_t *otherLimit) const { + U_ASSERT((otherLimit - otherStart) <= INT32_MAX); // ensured by caller + int32_t length = (int32_t)(limit - start); + int32_t otherLength = (int32_t)(otherLimit - otherStart); + // For equal strings, UTF-8 is at least as long as UTF-16, and at most three times as long. + if (otherLength < length || (otherLength / 3) > length) { + return FALSE; + } + // Compare valid strings from between normalization boundaries. + // (Invalid sequences are normalization-inert.) + for (int32_t i = 0, j = 0;;) { + if (i >= length) { + return j >= otherLength; + } else if (j >= otherLength) { + return FALSE; + } + // Not at the end of either string yet. + UChar32 c, other; + U16_NEXT_UNSAFE(start, i, c); + U8_NEXT_UNSAFE(otherStart, j, other); + if (c != other) { + return FALSE; + } + } +} + UBool ReorderingBuffer::appendSupplementary(UChar32 c, uint8_t cc, UErrorCode &errorCode) { if(remainingCapacity<2 && !resize(2, errorCode)) { return FALSE; @@ -216,16 +381,12 @@ uint8_t ReorderingBuffer::previousCC() { return 0; } UChar32 c=*--codePointStart; - if(c>DELTA_SHIFT)-MAX_DELTA-1; normTrie=inTrie; maybeYesCompositions=inExtraData; - extraData=maybeYesCompositions+(MIN_NORMAL_MAYBE_YES-minMaybeYes); + extraData=maybeYesCompositions+((MIN_NORMAL_MAYBE_YES-minMaybeYes)>>OFFSET_SHIFT); smallFCD=inSmallFCD; - - // Build tccc180[]. - // gennorm2 enforces lccc=0 for c>=1) { - if((c&0xff)==0) { - bits=smallFCD[c>>8]; // one byte per 0x100 code points - } - if(bits&1) { - for(int i=0; i<0x20; ++i, ++c) { - tccc180[c]=(uint8_t)getFCD16FromNormData(c); - } - } else { - uprv_memset(tccc180+c, 0, 0x20); - c+=0x20; - } - } -} - -uint8_t Normalizer2Impl::getTrailCCFromCompYesAndZeroCC(const UChar *cpStart, const UChar *cpLimit) const { - UChar32 c; - if(cpStart==(cpLimit-1)) { - c=*cpStart; - } else { - c=U16_GET_SUPPLEMENTARY(cpStart[0], cpStart[1]); - } - uint16_t prevNorm16=getNorm16(c); - if(prevNorm16<=minYesNo) { - return 0; // yesYes and Hangul LV/LVT have ccc=tccc=0 - } else { - return (uint8_t)(*getMapping(prevNorm16)>>8); // tccc from yesNo - } } -namespace { - class LcccContext { public: LcccContext(const Normalizer2Impl &ni, UnicodeSet &s) : impl(ni), set(s) {} void handleRange(UChar32 start, UChar32 end, uint16_t norm16) { - if(impl.isAlgorithmicNoNo(norm16)) { - // Range of code points with same-norm16-value algorithmic decompositions. - // They might have different non-zero FCD16 values. - do { - uint16_t fcd16=impl.getFCD16(start); - if(fcd16>0xff) { set.add(start); } - } while(++start<=end); - } else { + if (norm16 > Normalizer2Impl::MIN_NORMAL_MAYBE_YES && + norm16 != Normalizer2Impl::JAMO_VT) { + set.add(start, end); + } else if (impl.minNoNoCompNoMaybeCC <= norm16 && norm16 < impl.limitNoNo) { uint16_t fcd16=impl.getFCD16(start); if(fcd16>0xff) { set.add(start, end); } } @@ -335,6 +464,8 @@ class LcccContext { UnicodeSet &set; }; +namespace { + struct PropertyStartsContext { PropertyStartsContext(const Normalizer2Impl &ni, const USetAdder *adder) : impl(ni), sa(adder) {} @@ -359,7 +490,8 @@ enumNorm16PropertyStartsRange(const void *context, UChar32 start, UChar32 end, u const PropertyStartsContext *ctx=(const PropertyStartsContext *)context; const USetAdder *sa=ctx->sa; sa->add(sa->set, start); - if(start!=end && ctx->impl.isAlgorithmicNoNo((uint16_t)value)) { + if (start != end && ctx->impl.isAlgorithmicNoNo((uint16_t)value) && + (value & Normalizer2Impl::DELTA_TCCC_MASK) > Normalizer2Impl::DELTA_TCCC_1) { // Range of code points with same-norm16-value algorithmic decompositions. // They might have different non-zero FCD16 values. uint16_t prevFCD16=ctx->impl.getFCD16(start); @@ -391,7 +523,6 @@ U_CDECL_END void Normalizer2Impl::addLcccChars(UnicodeSet &set) const { - /* add the start code point of each same-value range of each trie */ LcccContext context(*this, set); utrie2_enum(normTrie, NULL, enumLcccRange, &context); } @@ -568,77 +699,174 @@ 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. -UBool Normalizer2Impl::decomposeShort(const UChar *src, const UChar *limit, - ReorderingBuffer &buffer, - UErrorCode &errorCode) const { +const UChar * +Normalizer2Impl::decomposeShort(const UChar *src, const UChar *limit, + UBool stopAtCompBoundary, UBool onlyContiguous, + ReorderingBuffer &buffer, UErrorCode &errorCode) const { + if (U_FAILURE(errorCode)) { + return nullptr; + } while(src= limitNoNo) { + if (isMaybeOrNonZeroCC(norm16)) { return buffer.append(c, getCCFromYesOrMaybe(norm16), errorCode); - } else if(isHangul(norm16)) { + } + // Maps to an isCompYesAndZeroCC. + c=mapAlgorithmic(c, norm16); + norm16=getNorm16(c); + } + if (norm16 < minYesNo) { + // c does not decompose + return buffer.append(c, 0, errorCode); + } else if(isHangulLV(norm16) || isHangulLVT(norm16)) { + // Hangul syllable: decompose algorithmically + UChar jamos[3]; + return buffer.appendZeroCC(jamos, jamos+Hangul::decompose(c, jamos), errorCode); + } + // c decomposes, get everything from the variable-length extra data + const uint16_t *mapping=getMapping(norm16); + uint16_t firstUnit=*mapping; + int32_t length=firstUnit&MAPPING_LENGTH_MASK; + uint8_t leadCC, trailCC; + trailCC=(uint8_t)(firstUnit>>8); + if(firstUnit&MAPPING_HAS_CCC_LCCC_WORD) { + leadCC=(uint8_t)(*(mapping-1)>>8); + } else { + leadCC=0; + } + return buffer.append((const UChar *)mapping+1, length, leadCC, trailCC, errorCode); +} + +const uint8_t * +Normalizer2Impl::decomposeShort(const uint8_t *src, const uint8_t *limit, + UBool stopAtCompBoundary, UBool onlyContiguous, + ReorderingBuffer &buffer, UErrorCode &errorCode) const { + if (U_FAILURE(errorCode)) { + return nullptr; + } + while (src < limit) { + const uint8_t *prevSrc = src; + uint16_t norm16; + UTRIE2_U8_NEXT16(normTrie, src, limit, norm16); + // Get the decomposition and the lead and trail cc's. + UChar32 c = U_SENTINEL; + if (norm16 >= limitNoNo) { + if (isMaybeOrNonZeroCC(norm16)) { + // No boundaries around this character. + c = codePointFromValidUTF8(prevSrc, src); + if (!buffer.append(c, getCCFromYesOrMaybe(norm16), errorCode)) { + return nullptr; + } + continue; + } + // Maps to an isCompYesAndZeroCC. + if (stopAtCompBoundary) { + return prevSrc; + } + c = codePointFromValidUTF8(prevSrc, src); + c = mapAlgorithmic(c, norm16); + norm16 = getNorm16(c); + } else if (stopAtCompBoundary && norm16 < minNoNoCompNoMaybeCC) { + return prevSrc; + } + // norm16!=INERT guarantees that [prevSrc, src[ is valid UTF-8. + // We do not see invalid UTF-8 here because + // its norm16==INERT is normalization-inert, + // so it gets copied unchanged in the fast path, + // and we stop the slow path where invalid UTF-8 begins. + U_ASSERT(norm16 != INERT); + if (norm16 < minYesNo) { + if (c < 0) { + c = codePointFromValidUTF8(prevSrc, src); + } + // does not decompose + if (!buffer.append(c, 0, errorCode)) { + return nullptr; + } + } else if (isHangulLV(norm16) || isHangulLVT(norm16)) { // Hangul syllable: decompose algorithmically - UChar jamos[3]; - return buffer.appendZeroCC(jamos, jamos+Hangul::decompose(c, jamos), errorCode); - } else if(isDecompNoAlgorithmic(norm16)) { - c=mapAlgorithmic(c, norm16); - norm16=getNorm16(c); + if (c < 0) { + c = codePointFromValidUTF8(prevSrc, src); + } + char16_t jamos[3]; + if (!buffer.appendZeroCC(jamos, jamos+Hangul::decompose(c, jamos), errorCode)) { + return nullptr; + } } else { - // c decomposes, get everything from the variable-length extra data - const uint16_t *mapping=getMapping(norm16); - uint16_t firstUnit=*mapping; - int32_t length=firstUnit&MAPPING_LENGTH_MASK; - uint8_t leadCC, trailCC; - trailCC=(uint8_t)(firstUnit>>8); - if(firstUnit&MAPPING_HAS_CCC_LCCC_WORD) { - leadCC=(uint8_t)(*(mapping-1)>>8); + // The character decomposes, get everything from the variable-length extra data. + const uint16_t *mapping = getMapping(norm16); + uint16_t firstUnit = *mapping; + int32_t length = firstUnit & MAPPING_LENGTH_MASK; + uint8_t trailCC = (uint8_t)(firstUnit >> 8); + uint8_t leadCC; + if (firstUnit & MAPPING_HAS_CCC_LCCC_WORD) { + leadCC = (uint8_t)(*(mapping-1) >> 8); } else { - leadCC=0; + leadCC = 0; + } + if (!buffer.append((const char16_t *)mapping+1, length, leadCC, trailCC, errorCode)) { + return nullptr; } - return buffer.append((const UChar *)mapping+1, length, leadCC, trailCC, errorCode); + } + if (stopAtCompBoundary && norm16HasCompBoundaryAfter(norm16, onlyContiguous)) { + return src; } } + return src; } const UChar * Normalizer2Impl::getDecomposition(UChar32 c, UChar buffer[4], int32_t &length) const { - const UChar *decomp=NULL; uint16_t norm16; - for(;;) { - if(c>7)&1)-1; - uint16_t rm0=*rawMapping; - if(rm0<=MAPPING_LENGTH_MASK) { - length=rm0; - return (const UChar *)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); - length=mLength-1; - return buffer; - } + } + // c decomposes, get everything from the variable-length extra data + const uint16_t *mapping=getMapping(norm16); + uint16_t firstUnit=*mapping; + int32_t mLength=firstUnit&MAPPING_LENGTH_MASK; // length of normal mapping + if(firstUnit&MAPPING_HAS_RAW_MAPPING) { + // Read the raw mapping from before the firstUnit and before the optional ccc/lccc word. + // Bit 7=MAPPING_HAS_CCC_LCCC_WORD + const uint16_t *rawMapping=mapping-((firstUnit>>7)&1)-1; + uint16_t rm0=*rawMapping; + if(rm0<=MAPPING_LENGTH_MASK) { + length=rm0; + return (const UChar *)rawMapping-rm0; } else { - length=mLength; - return (const UChar *)mapping+1; + // 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); + length=mLength-1; + return buffer; } + } else { + length=mLength; + return (const UChar *)mapping+1; } } @@ -717,43 +942,60 @@ void Normalizer2Impl::decomposeAndAppend(const UChar *src, const UChar *limit, } } -// Note: hasDecompBoundary() could be implemented as aliases to -// hasFCDBoundaryBefore() and hasFCDBoundaryAfter() -// at the cost of building the FCD trie for a decomposition normalizer. -UBool Normalizer2Impl::hasDecompBoundary(UChar32 c, UBool before) const { - for(;;) { - if(cMIN_NORMAL_MAYBE_YES) { - return FALSE; // ccc!=0 - } else if(isDecompNoAlgorithmic(norm16)) { - c=mapAlgorithmic(c, norm16); - } else { - // c decomposes, get everything from the variable-length extra data - const uint16_t *mapping=getMapping(norm16); - uint16_t firstUnit=*mapping; - if((firstUnit&MAPPING_LENGTH_MASK)==0) { - return FALSE; - } - if(!before) { - // decomp after-boundary: same as hasFCDBoundaryAfter(), - // fcd16<=1 || trailCC==0 - if(firstUnit>0x1ff) { - return FALSE; // trailCC>1 - } - if(firstUnit<=0xff) { - return TRUE; // trailCC==0 - } - // if(trailCC==1) test leadCC==0, same as checking for before-boundary - } - // TRUE if leadCC==0 (hasFCDBoundaryBefore()) - return (firstUnit&MAPPING_HAS_CCC_LCCC_WORD)==0 || (*(mapping-1)&0xff00)==0; - } +UBool Normalizer2Impl::hasDecompBoundaryBefore(UChar32 c) const { + return c < minLcccCP || (c <= 0xffff && !singleLeadMightHaveNonZeroFCD16(c)) || + norm16HasDecompBoundaryBefore(getNorm16(c)); +} + +UBool Normalizer2Impl::norm16HasDecompBoundaryBefore(uint16_t norm16) const { + if (norm16 < minNoNoCompNoMaybeCC) { + return TRUE; } + if (norm16 >= limitNoNo) { + return norm16 <= MIN_NORMAL_MAYBE_YES || norm16 == JAMO_VT; + } + // c decomposes, get everything from the variable-length extra data + const uint16_t *mapping=getMapping(norm16); + uint16_t firstUnit=*mapping; + // TRUE if leadCC==0 (hasFCDBoundaryBefore()) + return (firstUnit&MAPPING_HAS_CCC_LCCC_WORD)==0 || (*(mapping-1)&0xff00)==0; +} + +UBool Normalizer2Impl::hasDecompBoundaryAfter(UChar32 c) const { + if (c < minDecompNoCP) { + return TRUE; + } + if (c <= 0xffff && !singleLeadMightHaveNonZeroFCD16(c)) { + return TRUE; + } + return norm16HasDecompBoundaryAfter(getNorm16(c)); +} + +UBool Normalizer2Impl::norm16HasDecompBoundaryAfter(uint16_t norm16) const { + if(norm16 <= minYesNo || isHangulLVT(norm16)) { + return TRUE; + } + if (norm16 >= limitNoNo) { + if (isMaybeOrNonZeroCC(norm16)) { + return norm16 <= MIN_NORMAL_MAYBE_YES || norm16 == JAMO_VT; + } + // Maps to an isCompYesAndZeroCC. + return (norm16 & DELTA_TCCC_MASK) <= DELTA_TCCC_1; + } + // c decomposes, get everything from the variable-length extra data + const uint16_t *mapping=getMapping(norm16); + uint16_t firstUnit=*mapping; + // decomp after-boundary: same as hasFCDBoundaryAfter(), + // fcd16<=1 || trailCC==0 + if(firstUnit>0x1ff) { + return FALSE; // trailCC>1 + } + if(firstUnit<=0xff) { + return TRUE; // trailCC==0 + } + // if(trailCC==1) test leadCC==0, same as checking for before-boundary + // TRUE if leadCC==0 (hasFCDBoundaryBefore()) + return (firstUnit&MAPPING_HAS_CCC_LCCC_WORD)==0 || (*(mapping-1)&0xff00)==0; } /* @@ -1031,6 +1273,7 @@ Normalizer2Impl::composePair(UChar32 a, UChar32 b) const { if(isInert(norm16)) { return U_SENTINEL; } else if(norm16minYesNo) { // composite 'a' has both mapping & compositions list list+= // mapping pointer - 1+ // +1 to skip the first unit with the mapping lenth + 1+ // +1 to skip the first unit with the mapping length (*list&MAPPING_LENGTH_MASK); // + mapping length } } } else if(norm16=minNoNo. + // The current character is either a "noNo" (has a mapping) + // or a "maybeYes" (combines backward) + // or a "yesYes" with ccc!=0. + // It is not a Hangul syllable or Jamo L because those have "yes" properties. + + // Medium-fast path: Handle cases that do not require full decomposition and recomposition. + if (!isMaybeOrNonZeroCC(norm16)) { // minNoNo <= norm16 < minMaybeYes + if (!doCompose) { + return FALSE; } - // Set prevBoundary to the last character in the quick check loop. - prevBoundary=src-1; - if( U16_IS_TRAIL(*prevBoundary) && prevSrc(getMapping(norm16)); + int32_t length = *mapping++ & MAPPING_LENGTH_MASK; + if(!buffer.appendZeroCC(mapping, mapping + length, errorCode)) { + break; + } + prevBoundary = src; + continue; + } + } else if (norm16 >= minNoNoEmpty) { + // The current character maps to nothing. + // Simply omit it from the output if there is a boundary before _or_ after it. + // The character itself implies no boundaries. + if (hasCompBoundaryBefore(src, limit) || + hasCompBoundaryAfter(prevBoundary, prevSrc, onlyContiguous)) { + if (prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) { + break; + } + prevBoundary = src; + continue; + } } - // The start of the current character (c). - prevSrc=src; - } else if(src==limit) { - break; - } - - src+=U16_LENGTH(c); - /* - * isCompYesAndZeroCC(norm16) is false, that is, norm16>=minNoNo. - * c is either a "noNo" (has a mapping) or a "maybeYes" (combines backward) - * or has ccc!=0. - * Check for Jamo V/T, then for regular characters. - * c is not a Hangul syllable or Jamo L because those have "yes" properties. - */ - if(isJamoVT(norm16) && prevBoundary!=prevSrc) { + // 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); - UBool needToDecompose=FALSE; if(c= 0) { + UChar32 syllable = Hangul::HANGUL_BASE + + (l*Hangul::JAMO_V_COUNT + (c-Hangul::JAMO_V_BASE)) * + Hangul::JAMO_T_COUNT + t; + --prevSrc; // Replace the Jamo L as well. + if (prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) { + break; + } + if(!buffer.appendBMP((UChar)syllable, 0, errorCode)) { + break; + } + prevBoundary = src; continue; } // If we see L+V+x where x!=T then we drop to the slow path, // decompose and recompose. // This is to deal with NFKC finding normal L and V but a - // compatibility variant of a T. We need to either fully compose that - // combination here (which would complicate the code and may not work - // with strange custom data) or use the slow path -- or else our replacing - // two input characters (L+V) with one output character (LV syllable) - // would violate the invariant that [prevBoundary..prevSrc[ has the same - // length as what we appended to the buffer since prevBoundary. - needToDecompose=TRUE; + // compatibility variant of a T. + // We need to either fully compose that combination here + // (which would complicate the code and may not work with strange custom data) + // or use the slow path. } - } else if(Hangul::isHangulWithoutJamoT(prev)) { - // c is a Jamo Trailing consonant, + } else if (Hangul::isHangulLV(prev)) { + // The current character is a Jamo Trailing consonant, // compose with previous Hangul LV that does not contain a Jamo T. - if(!doCompose) { + if (!doCompose) { return FALSE; } - buffer.setLastChar((UChar)(prev+c-Hangul::JAMO_T_BASE)); - prevBoundary=src; - continue; - } - if(!needToDecompose) { - // The Jamo V/T did not compose into a Hangul syllable. - if(doCompose) { - if(!buffer.appendBMP((UChar)c, 0, errorCode)) { - break; - } - } else { - prevCC=0; + UChar32 syllable = prev + c - Hangul::JAMO_T_BASE; + --prevSrc; // Replace the Hangul LV as well. + if (prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) { + break; } + if(!buffer.appendBMP((UChar)syllable, 0, errorCode)) { + break; + } + prevBoundary = src; continue; } - } - /* - * Source buffer pointers: - * - * all done quick check current char not yet - * "yes" but (c) processed - * may combine - * forward - * [-------------[-------------[-------------[-------------[ - * | | | | | - * orig. src prevBoundary prevSrc src limit - * - * - * Destination buffer pointers inside the ReorderingBuffer: - * - * all done might take not filled yet - * characters for - * reordering - * [-------------[-------------[-------------[ - * | | | | - * start reorderStart limit | - * +remainingCap.+ - */ - if(norm16>=MIN_YES_YES_WITH_CC) { - uint8_t cc=(uint8_t)norm16; // cc!=0 - if( onlyContiguous && // FCC - (doCompose ? buffer.getLastCC() : prevCC)==0 && - prevBoundarycc - ) { + // No matching context, or may need to decompose surrounding text first: + // Fall through to the slow path. + } else if (norm16 > JAMO_VT) { // norm16 >= MIN_YES_YES_WITH_CC + // One or more combining marks that do not combine-back: + // Check for canonical order, copy unchanged if ok and + // if followed by a character with a boundary-before. + uint8_t cc = getCCFromNormalYesOrMaybe(norm16); // cc!=0 + if (onlyContiguous /* FCC */ && getPreviousTrailCC(prevBoundary, prevSrc) > cc) { // Fails FCD test, need to decompose and contiguously recompose. - if(!doCompose) { + if (!doCompose) { return FALSE; } - } else if(doCompose) { - if(!buffer.append(c, cc, errorCode)) { - break; - } - continue; - } else if(prevCC<=cc) { - prevCC=cc; - continue; } else { - return FALSE; + // 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; + uint16_t n16; + for (;;) { + if (src == limit) { + if (doCompose) { + buffer.appendZeroCC(prevBoundary, limit, errorCode); + } + return TRUE; + } + uint8_t prevCC = cc; + nextSrc = src; + UTRIE2_U16_NEXT16(normTrie, nextSrc, limit, c, n16); + if (n16 >= MIN_YES_YES_WITH_CC) { + cc = getCCFromNormalYesOrMaybe(n16); + if (prevCC > cc) { + if (!doCompose) { + return FALSE; + } + break; + } + } else { + break; + } + src = nextSrc; + } + // src is after the last in-order combining mark. + // If there is a boundary here, then we continue with no change. + if (norm16HasCompBoundaryBefore(n16)) { + if (isCompYesAndZeroCC(n16)) { + src = nextSrc; + } + continue; + } + // Use the slow path. There is no boundary in [prevSrc, src[. } - } else if(!doCompose && !isMaybeOrNonZeroCC(norm16)) { - return FALSE; } - /* - * Find appropriate boundaries around this character, - * decompose the source text from between the boundaries, - * and recompose it. - * - * We may need to remove the last few characters from the ReorderingBuffer - * to account for source text that was copied or appended - * but needs to take part in the recomposition. - */ - - /* - * Find the last composition boundary in [prevBoundary..src[. - * It is either the decomposition of the current character (at prevSrc), - * or prevBoundary. - */ - if(hasCompBoundaryBefore(c, norm16)) { - prevBoundary=prevSrc; - } else if(doCompose) { - buffer.removeSuffix((int32_t)(prevSrc-prevBoundary)); - } - - // Find the next composition boundary in [src..limit[ - - // modifies src to point to the next starter. - src=(UChar *)findNextCompBoundary(src, limit); - - // Decompose [prevBoundary..src[ into the buffer and then recompose that part of it. + // Slow path: Find the nearest boundaries around the current character, + // decompose and recompose. + if (prevBoundary != prevSrc && !norm16HasCompBoundaryBefore(norm16)) { + const UChar *p = prevSrc; + UTRIE2_U16_PREV16(normTrie, prevBoundary, p, c, norm16); + if (!norm16HasCompBoundaryAfter(norm16, onlyContiguous)) { + prevSrc = p; + } + } + if (doCompose && prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) { + break; + } int32_t recomposeStartIndex=buffer.length(); - if(!decomposeShort(prevBoundary, src, buffer, errorCode)) { + // We know there is not a boundary here. + decomposeShort(prevSrc, src, FALSE /* !stopAtCompBoundary */, onlyContiguous, + buffer, errorCode); + // Decompose until the next boundary. + src = decomposeShort(src, limit, TRUE /* stopAtCompBoundary */, onlyContiguous, + buffer, errorCode); + if (U_FAILURE(errorCode)) { break; } + if ((src - prevSrc) > INT32_MAX) { // guard before buffer.equals() + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return TRUE; + } recompose(buffer, recomposeStartIndex, onlyContiguous); if(!doCompose) { - if(!buffer.equals(prevBoundary, src)) { + if(!buffer.equals(prevSrc, src)) { return FALSE; } buffer.remove(); - prevCC=0; } - - // Move to the next starter. We never need to look back before this point again. prevBoundary=src; } return TRUE; @@ -1340,30 +1600,28 @@ const UChar * Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit, UBool onlyContiguous, UNormalizationCheckResult *pQCResult) const { - /* - * prevBoundary points to the last character before the current one - * that has a composition boundary before it with ccc==0 and quick check "yes". - */ const UChar *prevBoundary=src; UChar32 minNoMaybeCP=minCompNoMaybeCP; if(limit==NULL) { UErrorCode errorCode=U_ZERO_ERROR; src=copyLowPrefixFromNulTerminated(src, minNoMaybeCP, NULL, errorCode); - if(prevBoundary=minNoNo. + // The current character is either a "noNo" (has a mapping) + // or a "maybeYes" (combines backward) + // or a "yesYes" with ccc!=0. + // It is not a Hangul syllable or Jamo L because those have "yes" properties. + + uint16_t prevNorm16 = INERT; + if (prevBoundary != prevSrc) { + if (norm16HasCompBoundaryBefore(norm16)) { + prevBoundary = prevSrc; + } else { + const UChar *p = prevSrc; + uint16_t n16; + UTRIE2_U16_PREV16(normTrie, prevBoundary, p, c, n16); + if (norm16HasCompBoundaryAfter(n16, onlyContiguous)) { + prevBoundary = prevSrc; + } else { + prevBoundary = p; + prevNorm16 = n16; + } } - prevCC=0; - // The start of the current character (c). - prevSrc=src; } - src+=U16_LENGTH(c); - /* - * isCompYesAndZeroCC(norm16) is false, that is, norm16>=minNoNo. - * c is either a "noNo" (has a mapping) or a "maybeYes" (combines backward) - * or has ccc!=0. - */ if(isMaybeOrNonZeroCC(norm16)) { uint8_t cc=getCCFromYesOrMaybe(norm16); - if( onlyContiguous && // FCC - cc!=0 && - prevCC==0 && - prevBoundarycc - ) { - // Fails FCD test. - } else if(prevCC<=cc || cc==0) { - prevCC=cc; - if(norm16 cc) { + // The [prevBoundary..prevSrc[ character + // passed the quick check "yes && ccc==0" test + // but is out of canonical order with the current combining mark. + } 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; + for (;;) { + if (norm16 < MIN_YES_YES_WITH_CC) { + if (pQCResult != nullptr) { + *pQCResult = UNORM_MAYBE; + } else { + return prevBoundary; + } + } + if (src == limit) { + return src; + } + uint8_t prevCC = cc; + nextSrc = src; + UTRIE2_U16_NEXT16(normTrie, nextSrc, limit, c, norm16); + if (isMaybeOrNonZeroCC(norm16)) { + cc = getCCFromYesOrMaybe(norm16); + if (!(prevCC <= cc || cc == 0)) { + break; + } } else { - return prevBoundary; + break; } + src = nextSrc; + } + // src is after the last in-order combining mark. + if (isCompYesAndZeroCC(norm16)) { + prevBoundary = src; + src = nextSrc; + continue; } - continue; } } if(pQCResult!=NULL) { @@ -1453,10 +1732,10 @@ void Normalizer2Impl::composeAndAppend(const UChar *src, const UChar *limit, ReorderingBuffer &buffer, UErrorCode &errorCode) const { if(!buffer.isEmpty()) { - const UChar *firstStarterInSrc=findNextCompBoundary(src, limit); + const UChar *firstStarterInSrc=findNextCompBoundary(src, limit, onlyContiguous); if(src!=firstStarterInSrc) { const UChar *lastStarterInDest=findPreviousCompBoundary(buffer.getStart(), - buffer.getLimit()); + buffer.getLimit(), onlyContiguous); int32_t destSuffixLength=(int32_t)(buffer.getLimit()-lastStarterInDest); UnicodeString middle(lastStarterInDest, destSuffixLength); buffer.removeSuffix(destSuffixLength); @@ -1481,91 +1760,349 @@ void Normalizer2Impl::composeAndAppend(const UChar *src, const UChar *limit, } } -/** - * Does c have a composition boundary before it? - * True if its decomposition begins with a character that has - * ccc=0 && NFC_QC=Yes (isCompYesAndZeroCC()). - * As a shortcut, this is true if c itself has ccc=0 && NFC_QC=Yes - * (isCompYesAndZeroCC()) so we need not decompose. - */ -UBool Normalizer2Impl::hasCompBoundaryBefore(UChar32 c, uint16_t norm16) const { - for(;;) { - if(isCompYesAndZeroCC(norm16)) { +UBool +Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous, + const uint8_t *src, const uint8_t *limit, + ByteSink *sink, Edits *edits, UErrorCode &errorCode) const { + U_ASSERT(limit != nullptr); + UnicodeString s16; + uint8_t minNoMaybeLead = leadByteForCP(minCompNoMaybeCP); + const uint8_t *prevBoundary = src; + + for (;;) { + // Fast path: Scan over a sequence of characters below the minimum "no or maybe" code point, + // or with (compYes && ccc==0) properties. + const uint8_t *prevSrc; + uint16_t norm16 = 0; + for (;;) { + if (src == limit) { + if (prevBoundary != limit && sink != nullptr) { + ByteSinkUtil::appendUnchanged(prevBoundary, limit, + *sink, options, edits, errorCode); + } + return TRUE; + } + if (*src < minNoMaybeLead) { + ++src; + } else { + prevSrc = src; + UTRIE2_U8_NEXT16(normTrie, src, limit, norm16); + if (!isCompYesAndZeroCC(norm16)) { + break; + } + } + } + // isCompYesAndZeroCC(norm16) is false, that is, norm16>=minNoNo. + // The current character is either a "noNo" (has a mapping) + // or a "maybeYes" (combines backward) + // or a "yesYes" with ccc!=0. + // It is not a Hangul syllable or Jamo L because those have "yes" properties. + + // Medium-fast path: Handle cases that do not require full decomposition and recomposition. + if (!isMaybeOrNonZeroCC(norm16)) { // minNoNo <= norm16 < minMaybeYes + if (sink == nullptr) { + return FALSE; + } + // Fast path for mapping a character that is immediately surrounded by boundaries. + // In this case, we need not decompose around the current character. + if (isDecompNoAlgorithmic(norm16)) { + // Maps to a single isCompYesAndZeroCC character + // which also implies hasCompBoundaryBefore. + if (norm16HasCompBoundaryAfter(norm16, onlyContiguous) || + hasCompBoundaryBefore(src, limit)) { + if (prevBoundary != prevSrc && + !ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc, + *sink, options, edits, errorCode)) { + break; + } + appendCodePointDelta(prevSrc, src, getAlgorithmicDelta(norm16), *sink, edits); + prevBoundary = src; + continue; + } + } else if (norm16 < minNoNoCompBoundaryBefore) { + // The mapping is comp-normalized which also implies hasCompBoundaryBefore. + if (norm16HasCompBoundaryAfter(norm16, onlyContiguous) || + hasCompBoundaryBefore(src, limit)) { + if (prevBoundary != prevSrc && + !ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc, + *sink, options, edits, errorCode)) { + break; + } + const uint16_t *mapping = getMapping(norm16); + int32_t length = *mapping++ & MAPPING_LENGTH_MASK; + if (!ByteSinkUtil::appendChange(prevSrc, src, (const UChar *)mapping, length, + *sink, edits, errorCode)) { + break; + } + prevBoundary = src; + continue; + } + } else if (norm16 >= minNoNoEmpty) { + // The current character maps to nothing. + // Simply omit it from the output if there is a boundary before _or_ after it. + // The character itself implies no boundaries. + if (hasCompBoundaryBefore(src, limit) || + hasCompBoundaryAfter(prevBoundary, prevSrc, onlyContiguous)) { + if (prevBoundary != prevSrc && + !ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc, + *sink, options, edits, errorCode)) { + break; + } + if (edits != nullptr) { + edits->addReplace((int32_t)(src - prevSrc), 0); + } + prevBoundary = src; + continue; + } + } + // Other "noNo" type, or need to examine more text around this character: + // Fall through to the slow path. + } else if (isJamoVT(norm16)) { + // Jamo L: E1 84 80..92 + // Jamo V: E1 85 A1..B5 + // Jamo T: E1 86 A8..E1 87 82 + U_ASSERT((src - prevSrc) == 3 && *prevSrc == 0xe1); + UChar32 prev = previousHangulOrJamo(prevBoundary, prevSrc); + if (prevSrc[1] == 0x85) { + // The current character is a Jamo Vowel, + // compose with previous Jamo L and following Jamo T. + UChar32 l = prev - Hangul::JAMO_L_BASE; + if ((uint32_t)l < Hangul::JAMO_L_COUNT) { + if (sink == nullptr) { + return FALSE; + } + int32_t t = getJamoTMinusBase(src, limit); + if (t >= 0) { + // The next character is a Jamo T. + src += 3; + } else if (hasCompBoundaryBefore(src, limit)) { + // No Jamo T follows, not even via decomposition. + t = 0; + } + if (t >= 0) { + UChar32 syllable = Hangul::HANGUL_BASE + + (l*Hangul::JAMO_V_COUNT + (prevSrc[2]-0xa1)) * + Hangul::JAMO_T_COUNT + t; + prevSrc -= 3; // Replace the Jamo L as well. + if (prevBoundary != prevSrc && + !ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc, + *sink, options, edits, errorCode)) { + break; + } + ByteSinkUtil::appendCodePoint(prevSrc, src, syllable, *sink, edits); + prevBoundary = src; + continue; + } + // If we see L+V+x where x!=T then we drop to the slow path, + // decompose and recompose. + // This is to deal with NFKC finding normal L and V but a + // compatibility variant of a T. + // We need to either fully compose that combination here + // (which would complicate the code and may not work with strange custom data) + // or use the slow path. + } + } else if (Hangul::isHangulLV(prev)) { + // The current character is a Jamo Trailing consonant, + // compose with previous Hangul LV that does not contain a Jamo T. + if (sink == nullptr) { + return FALSE; + } + UChar32 syllable = prev + getJamoTMinusBase(prevSrc, src); + prevSrc -= 3; // Replace the Hangul LV as well. + if (prevBoundary != prevSrc && + !ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc, + *sink, options, edits, errorCode)) { + break; + } + ByteSinkUtil::appendCodePoint(prevSrc, src, syllable, *sink, edits); + prevBoundary = src; + continue; + } + // No matching context, or may need to decompose surrounding text first: + // Fall through to the slow path. + } else if (norm16 > JAMO_VT) { // norm16 >= MIN_YES_YES_WITH_CC + // One or more combining marks that do not combine-back: + // Check for canonical order, copy unchanged if ok and + // if followed by a character with a boundary-before. + uint8_t cc = getCCFromNormalYesOrMaybe(norm16); // cc!=0 + if (onlyContiguous /* FCC */ && getPreviousTrailCC(prevBoundary, prevSrc) > cc) { + // Fails FCD test, need to decompose and contiguously recompose. + if (sink == nullptr) { + return FALSE; + } + } else { + // If !onlyContiguous (not FCC), then we ignore the tccc of + // the previous character which passed the quick check "yes && ccc==0" test. + const uint8_t *nextSrc; + uint16_t n16; + for (;;) { + if (src == limit) { + if (sink != nullptr) { + ByteSinkUtil::appendUnchanged(prevBoundary, limit, + *sink, options, edits, errorCode); + } + return TRUE; + } + uint8_t prevCC = cc; + nextSrc = src; + UTRIE2_U8_NEXT16(normTrie, nextSrc, limit, n16); + if (n16 >= MIN_YES_YES_WITH_CC) { + cc = getCCFromNormalYesOrMaybe(n16); + if (prevCC > cc) { + if (sink == nullptr) { + return FALSE; + } + break; + } + } else { + break; + } + src = nextSrc; + } + // src is after the last in-order combining mark. + // If there is a boundary here, then we continue with no change. + if (norm16HasCompBoundaryBefore(n16)) { + if (isCompYesAndZeroCC(n16)) { + src = nextSrc; + } + continue; + } + // Use the slow path. There is no boundary in [prevSrc, src[. + } + } + + // Slow path: Find the nearest boundaries around the current character, + // decompose and recompose. + if (prevBoundary != prevSrc && !norm16HasCompBoundaryBefore(norm16)) { + const uint8_t *p = prevSrc; + UTRIE2_U8_PREV16(normTrie, prevBoundary, p, norm16); + if (!norm16HasCompBoundaryAfter(norm16, onlyContiguous)) { + prevSrc = p; + } + } + ReorderingBuffer buffer(*this, s16, errorCode); + if (U_FAILURE(errorCode)) { + break; + } + // We know there is not a boundary here. + decomposeShort(prevSrc, src, FALSE /* !stopAtCompBoundary */, onlyContiguous, + buffer, errorCode); + // Decompose until the next boundary. + src = decomposeShort(src, limit, TRUE /* stopAtCompBoundary */, onlyContiguous, + buffer, errorCode); + if (U_FAILURE(errorCode)) { + break; + } + if ((src - prevSrc) > INT32_MAX) { // guard before buffer.equals() + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; return TRUE; - } else if(isMaybeOrNonZeroCC(norm16)) { - return FALSE; - } else if(isDecompNoAlgorithmic(norm16)) { - c=mapAlgorithmic(c, norm16); - norm16=getNorm16(c); - } else { - // c decomposes, get everything from the variable-length extra data - const uint16_t *mapping=getMapping(norm16); - uint16_t firstUnit=*mapping; - if((firstUnit&MAPPING_LENGTH_MASK)==0) { + } + recompose(buffer, 0, onlyContiguous); + if (!buffer.equals(prevSrc, src)) { + if (sink == nullptr) { return FALSE; } - if((firstUnit&MAPPING_HAS_CCC_LCCC_WORD) && (*(mapping-1)&0xff00)) { - return FALSE; // non-zero leadCC + if (prevBoundary != prevSrc && + !ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc, + *sink, options, edits, errorCode)) { + break; } - int32_t i=1; // skip over the firstUnit - UChar32 c; - U16_NEXT_UNSAFE(mapping, i, c); - return isCompYesAndZeroCC(getNorm16(c)); + if (!ByteSinkUtil::appendChange(prevSrc, src, buffer.getStart(), buffer.length(), + *sink, edits, errorCode)) { + break; + } + prevBoundary = src; } } + return TRUE; } -UBool Normalizer2Impl::hasCompBoundaryAfter(UChar32 c, UBool onlyContiguous, UBool testInert) const { - for(;;) { - uint16_t norm16=getNorm16(c); - if(isInert(norm16)) { - return TRUE; - } else if(norm16<=minYesNo) { - // Hangul: norm16==minYesNo - // Hangul LVT has a boundary after it. - // Hangul LV and non-inert yesYes characters combine forward. - return isHangul(norm16) && !Hangul::isHangulWithoutJamoT((UChar)c); - } else if(norm16>= (testInert ? minNoNo : minMaybeYes)) { - return FALSE; - } else if(isDecompNoAlgorithmic(norm16)) { - c=mapAlgorithmic(c, norm16); - } else { - // c decomposes, get everything from the variable-length extra data. - // If testInert, then c must be a yesNo character which has lccc=0, - // otherwise it could be a noNo. - const uint16_t *mapping=getMapping(norm16); - uint16_t firstUnit=*mapping; - // TRUE if - // not MAPPING_NO_COMP_BOUNDARY_AFTER - // (which is set if - // c is not deleted, and - // it and its decomposition do not combine forward, and it has a starter) - // and if FCC then trailCC<=1 - return - (firstUnit&MAPPING_NO_COMP_BOUNDARY_AFTER)==0 && - (!onlyContiguous || firstUnit<=0x1ff); - } +UBool Normalizer2Impl::hasCompBoundaryBefore(const UChar *src, const UChar *limit) const { + if (src == limit || *src < minCompNoMaybeCP) { + return TRUE; } + UChar32 c; + uint16_t norm16; + UTRIE2_U16_NEXT16(normTrie, src, limit, c, norm16); + return norm16HasCompBoundaryBefore(norm16); } -const UChar *Normalizer2Impl::findPreviousCompBoundary(const UChar *start, const UChar *p) const { - BackwardUTrie2StringIterator iter(normTrie, start, p); +UBool Normalizer2Impl::hasCompBoundaryBefore(const uint8_t *src, const uint8_t *limit) const { + if (src == limit) { + return TRUE; + } uint16_t norm16; - do { - norm16=iter.previous16(); - } while(!hasCompBoundaryBefore(iter.codePoint, norm16)); - // We could also test hasCompBoundaryAfter() and return iter.codePointLimit, - // but that's probably not worth the extra cost. - return iter.codePointStart; + UTRIE2_U8_NEXT16(normTrie, src, limit, norm16); + return norm16HasCompBoundaryBefore(norm16); } -const UChar *Normalizer2Impl::findNextCompBoundary(const UChar *p, const UChar *limit) const { - ForwardUTrie2StringIterator iter(normTrie, p, limit); +UBool Normalizer2Impl::hasCompBoundaryAfter(const UChar *start, const UChar *p, + UBool onlyContiguous) const { + if (start == p) { + return TRUE; + } + UChar32 c; uint16_t norm16; - do { - norm16=iter.next16(); - } while(!hasCompBoundaryBefore(iter.codePoint, norm16)); - return iter.codePointStart; + UTRIE2_U16_PREV16(normTrie, start, p, c, norm16); + return norm16HasCompBoundaryAfter(norm16, onlyContiguous); +} + +UBool Normalizer2Impl::hasCompBoundaryAfter(const uint8_t *start, const uint8_t *p, + UBool onlyContiguous) const { + if (start == p) { + return TRUE; + } + uint16_t norm16; + UTRIE2_U8_PREV16(normTrie, start, p, norm16); + return norm16HasCompBoundaryAfter(norm16, onlyContiguous); +} + +const UChar *Normalizer2Impl::findPreviousCompBoundary(const UChar *start, const UChar *p, + UBool onlyContiguous) const { + BackwardUTrie2StringIterator iter(normTrie, start, p); + for(;;) { + uint16_t norm16=iter.previous16(); + if (norm16HasCompBoundaryAfter(norm16, onlyContiguous)) { + return iter.codePointLimit; + } + if (hasCompBoundaryBefore(iter.codePoint, norm16)) { + return iter.codePointStart; + } + } +} + +const UChar *Normalizer2Impl::findNextCompBoundary(const UChar *p, const UChar *limit, + UBool onlyContiguous) const { + ForwardUTrie2StringIterator iter(normTrie, p, limit); + for(;;) { + uint16_t norm16=iter.next16(); + if (hasCompBoundaryBefore(iter.codePoint, norm16)) { + return iter.codePointStart; + } + if (norm16HasCompBoundaryAfter(norm16, onlyContiguous)) { + return iter.codePointLimit; + } + } +} + +uint8_t Normalizer2Impl::getPreviousTrailCC(const UChar *start, const UChar *p) const { + if (start == p) { + return 0; + } + int32_t i = (int32_t)(p - start); + UChar32 c; + U16_PREV(start, 0, i, c); + return (uint8_t)getFCD16(c); +} + +uint8_t Normalizer2Impl::getPreviousTrailCC(const uint8_t *start, const uint8_t *p) const { + if (start == p) { + return 0; + } + int32_t i = (int32_t)(p - start); + UChar32 c; + U8_PREV(start, 0, i, c); + return (uint8_t)getFCD16(c); } // Note: normalizer2impl.cpp r30982 (2011-nov-27) @@ -1573,43 +2110,41 @@ const UChar *Normalizer2Impl::findNextCompBoundary(const UChar *p, const UChar * // That provided faster access to FCD data than getFCD16FromNormData() // but required synchronization and consumed some 10kB of heap memory // in any process that uses FCD (e.g., via collation). -// tccc180[] and smallFCD[] are intended to help with any loss of performance, -// at least for Latin & CJK. +// minDecompNoCP etc. and smallFCD[] are intended to help with any loss of performance, +// at least for ASCII & CJK. // Gets the FCD value from the regular normalization data. uint16_t Normalizer2Impl::getFCD16FromNormData(UChar32 c) const { - // Only loops for 1:1 algorithmic mappings. - for(;;) { - uint16_t norm16=getNorm16(c); - if(norm16<=minYesNo) { - // no decomposition or Hangul syllable, all zeros - return 0; - } else if(norm16>=MIN_NORMAL_MAYBE_YES) { + uint16_t norm16=getNorm16(c); + if (norm16 >= limitNoNo) { + if(norm16>=MIN_NORMAL_MAYBE_YES) { // combining mark - norm16&=0xff; + norm16=getCCFromNormalYesOrMaybe(norm16); return norm16|(norm16<<8); } else if(norm16>=minMaybeYes) { return 0; - } else if(isDecompNoAlgorithmic(norm16)) { - c=mapAlgorithmic(c, norm16); - } else { - // c decomposes, get everything from the variable-length extra data - const uint16_t *mapping=getMapping(norm16); - uint16_t firstUnit=*mapping; - if((firstUnit&MAPPING_LENGTH_MASK)==0) { - // A character that is deleted (maps to an empty string) must - // get the worst-case lccc and tccc values because arbitrary - // characters on both sides will become adjacent. - return 0x1ff; - } else { - norm16=firstUnit>>8; // tccc - if(firstUnit&MAPPING_HAS_CCC_LCCC_WORD) { - norm16|=*(mapping-1)&0xff00; // lccc - } - return norm16; + } else { // isDecompNoAlgorithmic(norm16) + uint16_t deltaTrailCC = norm16 & DELTA_TCCC_MASK; + if (deltaTrailCC <= DELTA_TCCC_1) { + return deltaTrailCC >> OFFSET_SHIFT; } + // Maps to an isCompYesAndZeroCC. + c=mapAlgorithmic(c, norm16); + norm16=getNorm16(c); } } + if(norm16<=minYesNo || isHangulLVT(norm16)) { + // no decomposition or Hangul syllable, all zeros + return 0; + } + // c decomposes, get everything from the variable-length extra data + const uint16_t *mapping=getMapping(norm16); + uint16_t firstUnit=*mapping; + norm16=firstUnit>>8; // tccc + if(firstUnit&MAPPING_HAS_CCC_LCCC_WORD) { + norm16|=*(mapping-1)&0xff00; // lccc + } + return norm16; } // Dual functionality: @@ -1624,7 +2159,7 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit, const UChar *prevBoundary=src; int32_t prevFCD16=0; if(limit==NULL) { - src=copyLowPrefixFromNulTerminated(src, MIN_CCC_LCCC_CP, buffer, errorCode); + src=copyLowPrefixFromNulTerminated(src, minLcccCP, buffer, errorCode); if(U_FAILURE(errorCode)) { return src; } @@ -1653,7 +2188,7 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit, for(;;) { // count code units with lccc==0 for(prevSrc=src; src!=limit;) { - if((c=*src)1) { - --prevBoundary; + if(prev1) { + --prevBoundary; + } } } else { const UChar *p=src-1; @@ -1748,7 +2287,8 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit, * The source text does not fulfill the conditions for FCD. * Decompose and reorder a limited piece of the text. */ - if(!decomposeShort(prevBoundary, src, *buffer, errorCode)) { + decomposeShort(prevBoundary, src, FALSE, FALSE, *buffer, errorCode); + if (U_FAILURE(errorCode)) { break; } prevBoundary=src; @@ -1792,16 +2332,33 @@ void Normalizer2Impl::makeFCDAndAppend(const UChar *src, const UChar *limit, } const UChar *Normalizer2Impl::findPreviousFCDBoundary(const UChar *start, const UChar *p) const { - while(start

0xff) {} + while(startmakeCanonIterDataFromNorm16( - start, end, (uint16_t)value, *impl->fCanonIterData, errorCode); + InitCanonIterData::handleRange(impl, start, end, (uint16_t)value, errorCode); } return U_SUCCESS(errorCode); } +U_CDECL_END - -// UInitOnce instantiation function for CanonIterData - -static void U_CALLCONV -initCanonIterData(Normalizer2Impl *impl, UErrorCode &errorCode) { +void InitCanonIterData::doInit(Normalizer2Impl *impl, UErrorCode &errorCode) { U_ASSERT(impl->fCanonIterData == NULL); impl->fCanonIterData = new CanonIterData(errorCode); if (impl->fCanonIterData == NULL) { errorCode=U_MEMORY_ALLOCATION_ERROR; } if (U_SUCCESS(errorCode)) { - utrie2_enum(impl->getNormTrie(), NULL, enumCIDRangeHandler, impl); + utrie2_enum(impl->normTrie, NULL, enumCIDRangeHandler, impl); utrie2_freeze(impl->fCanonIterData->trie, UTRIE2_32_VALUE_BITS, &errorCode); } if (U_FAILURE(errorCode)) { @@ -1881,12 +2447,15 @@ initCanonIterData(Normalizer2Impl *impl, UErrorCode &errorCode) { } } -U_CDECL_END +void InitCanonIterData::handleRange( + Normalizer2Impl *impl, UChar32 start, UChar32 end, uint16_t value, UErrorCode &errorCode) { + impl->makeCanonIterDataFromNorm16(start, end, value, *impl->fCanonIterData, errorCode); +} -void Normalizer2Impl::makeCanonIterDataFromNorm16(UChar32 start, UChar32 end, uint16_t norm16, +void Normalizer2Impl::makeCanonIterDataFromNorm16(UChar32 start, UChar32 end, const uint16_t norm16, CanonIterData &newData, UErrorCode &errorCode) const { - if(norm16==0 || (minYesNo<=norm16 && norm16=minMaybeYes) { + if(isMaybeOrNonZeroCC(norm16)) { // not a segment starter if it occurs in a decomposition or has cc!=0 newValue|=CANON_NOT_SEGMENT_STARTER; if(norm16 minYesNo) { // c decomposes, get everything from the variable-length extra data const uint16_t *mapping=getMapping(norm16_2); uint16_t firstUnit=*mapping; @@ -2017,7 +2590,7 @@ unorm2_swap(const UDataSwapper *ds, uint8_t *outBytes; const int32_t *inIndexes; - int32_t indexes[Normalizer2Impl::IX_MIN_MAYBE_YES+1]; + int32_t indexes[Normalizer2Impl::IX_TOTAL_SIZE+1]; int32_t i, offset, nextOffset, size; @@ -2029,12 +2602,13 @@ unorm2_swap(const UDataSwapper *ds, /* check data format and format version */ pInfo=(const UDataInfo *)((const char *)inData+4); + uint8_t formatVersion0=pInfo->formatVersion[0]; if(!( pInfo->dataFormat[0]==0x4e && /* dataFormat="Nrm2" */ pInfo->dataFormat[1]==0x72 && pInfo->dataFormat[2]==0x6d && pInfo->dataFormat[3]==0x32 && - (pInfo->formatVersion[0]==1 || pInfo->formatVersion[0]==2) + (1<=formatVersion0 && formatVersion0<=3) )) { udata_printError(ds, "unorm2_swap(): data format %02x.%02x.%02x.%02x (format version %02x) is not recognized as Normalizer2 data\n", pInfo->dataFormat[0], pInfo->dataFormat[1], @@ -2048,10 +2622,18 @@ unorm2_swap(const UDataSwapper *ds, outBytes=(uint8_t *)outData+headerSize; inIndexes=(const int32_t *)inBytes; + int32_t minIndexesLength; + if(formatVersion0==1) { + minIndexesLength=Normalizer2Impl::IX_MIN_MAYBE_YES+1; + } else if(formatVersion0==2) { + minIndexesLength=Normalizer2Impl::IX_MIN_YES_NO_MAPPINGS_ONLY+1; + } else { + minIndexesLength=Normalizer2Impl::IX_MIN_LCCC_CP+1; + } if(length>=0) { length-=headerSize; - if(length<(int32_t)sizeof(indexes)) { + if(length=MIN_NORMAL_MAYBE_YES) { - return (uint8_t)norm16; + return getCCFromNormalYesOrMaybe(norm16); } if(norm16> OFFSET_SHIFT); + } static uint8_t getCCFromYesOrMaybe(uint16_t norm16) { - return norm16>=MIN_NORMAL_MAYBE_YES ? (uint8_t)norm16 : 0; + return norm16>=MIN_NORMAL_MAYBE_YES ? getCCFromNormalYesOrMaybe(norm16) : 0; + } + uint8_t getCCFromYesOrMaybeCP(UChar32 c) const { + if (c < minCompNoMaybeCP) { return 0; } + return getCCFromYesOrMaybe(getNorm16(c)); } /** @@ -272,10 +295,8 @@ class U_COMMON_API Normalizer2Impl : public UObject { * @return The lccc(c) in bits 15..8 and tccc(c) in bits 7..0. */ uint16_t getFCD16(UChar32 c) const { - if(c<0) { + if(c1) for quick FCC boundary-after tests. + DELTA_TCCC_0=0, + DELTA_TCCC_1=2, + DELTA_TCCC_GT_1=4, + DELTA_TCCC_MASK=6, + DELTA_SHIFT=3, - enum { - MIN_YES_YES_WITH_CC=0xff01, - JAMO_VT=0xff00, - MIN_NORMAL_MAYBE_YES=0xfe00, - JAMO_L=1, MAX_DELTA=0x40 }; @@ -394,21 +419,32 @@ class U_COMMON_API Normalizer2Impl : public UObject { IX_MIN_COMP_NO_MAYBE_CP, // Norm16 value thresholds for quick check combinations and types of extra data. - IX_MIN_YES_NO, // Mappings & compositions in [minYesNo..minYesNoMappingsOnly[. + + /** Mappings & compositions in [minYesNo..minYesNoMappingsOnly[. */ + IX_MIN_YES_NO, + /** Mappings are comp-normalized. */ IX_MIN_NO_NO, IX_LIMIT_NO_NO, IX_MIN_MAYBE_YES, - IX_MIN_YES_NO_MAPPINGS_ONLY, // Mappings only in [minYesNoMappingsOnly..minNoNo[. - - IX_RESERVED15, + /** Mappings only in [minYesNoMappingsOnly..minNoNo[. */ + IX_MIN_YES_NO_MAPPINGS_ONLY, + /** Mappings are not comp-normalized but have a comp boundary before. */ + IX_MIN_NO_NO_COMP_BOUNDARY_BEFORE, + /** Mappings do not have a comp boundary before. */ + IX_MIN_NO_NO_COMP_NO_MAYBE_CC, + /** Mappings to the empty string. */ + IX_MIN_NO_NO_EMPTY, + + IX_MIN_LCCC_CP, + IX_RESERVED19, IX_COUNT }; enum { MAPPING_HAS_CCC_LCCC_WORD=0x80, MAPPING_HAS_RAW_MAPPING=0x40, - MAPPING_NO_COMP_BOUNDARY_AFTER=0x20, + // unused bit 0x20, MAPPING_LENGTH_MASK=0x1f }; @@ -457,6 +493,12 @@ class U_COMMON_API Normalizer2Impl : public UObject { UnicodeString &safeMiddle, ReorderingBuffer &buffer, UErrorCode &errorCode) const; + + /** sink==nullptr: isNormalized() */ + UBool composeUTF8(uint32_t options, UBool onlyContiguous, + const uint8_t *src, const uint8_t *limit, + ByteSink *sink, icu::Edits *edits, UErrorCode &errorCode) const; + const UChar *makeFCD(const UChar *src, const UChar *limit, ReorderingBuffer *buffer, UErrorCode &errorCode) const; void makeFCDAndAppend(const UChar *src, const UChar *limit, @@ -465,27 +507,42 @@ class U_COMMON_API Normalizer2Impl : public UObject { ReorderingBuffer &buffer, UErrorCode &errorCode) const; - UBool hasDecompBoundary(UChar32 c, UBool before) const; + UBool hasDecompBoundaryBefore(UChar32 c) const; + UBool norm16HasDecompBoundaryBefore(uint16_t norm16) const; + UBool hasDecompBoundaryAfter(UChar32 c) const; + UBool norm16HasDecompBoundaryAfter(uint16_t norm16) const; UBool isDecompInert(UChar32 c) const { return isDecompYesAndZeroCC(getNorm16(c)); } UBool hasCompBoundaryBefore(UChar32 c) const { - return c=minMaybeYes; } - static UBool isInert(uint16_t norm16) { return norm16==0; } - static UBool isJamoL(uint16_t norm16) { return norm16==1; } + static UBool isInert(uint16_t norm16) { return norm16==INERT; } + static UBool isJamoL(uint16_t norm16) { return norm16==JAMO_L; } static UBool isJamoVT(uint16_t norm16) { return norm16==JAMO_VT; } - UBool isHangul(uint16_t norm16) const { return norm16==minYesNo; } + uint16_t hangulLVT() const { return minYesNoMappingsOnly|HAS_COMP_BOUNDARY_AFTER; } + UBool isHangulLV(uint16_t norm16) const { return norm16==minYesNo; } + UBool isHangulLVT(uint16_t norm16) const { + return norm16==hangulLVT(); + } UBool isCompYesAndZeroCC(uint16_t norm16) const { return norm16=MIN_YES_YES_WITH_CC || norm16=MIN_YES_YES_WITH_CC ? (uint8_t)norm16 : 0; + // return norm16>=MIN_YES_YES_WITH_CC ? getCCFromNormalYesOrMaybe(norm16) : 0; // } uint8_t getCCFromNoNo(uint16_t norm16) const { const uint16_t *mapping=getMapping(norm16); @@ -525,30 +582,47 @@ class U_COMMON_API Normalizer2Impl : public UObject { } } // requires that the [cpStart..cpLimit[ character passes isCompYesAndZeroCC() - uint8_t getTrailCCFromCompYesAndZeroCC(const UChar *cpStart, const UChar *cpLimit) const; + uint8_t getTrailCCFromCompYesAndZeroCC(uint16_t norm16) const { + if(norm16<=minYesNo) { + return 0; // yesYes and Hangul LV have ccc=tccc=0 + } else { + // For Hangul LVT we harmlessly fetch a firstUnit with tccc=0 here. + return (uint8_t)(*getMapping(norm16)>>8); // tccc from yesNo + } + } + uint8_t getPreviousTrailCC(const UChar *start, const UChar *p) const; + uint8_t getPreviousTrailCC(const uint8_t *start, const uint8_t *p) const; // Requires algorithmic-NoNo. UChar32 mapAlgorithmic(UChar32 c, uint16_t norm16) const { - return c+norm16-(minMaybeYes-MAX_DELTA-1); + return c+(norm16>>DELTA_SHIFT)-centerNoNoDelta; + } + UChar32 getAlgorithmicDelta(uint16_t norm16) const { + return (norm16>>DELTA_SHIFT)-centerNoNoDelta; } // Requires minYesNo>OFFSET_SHIFT); } const uint16_t *getCompositionsListForDecompYes(uint16_t norm16) const { - if(norm16==0 || MIN_NORMAL_MAYBE_YES<=norm16) { + if(norm16>OFFSET_SHIFT); + } /** * @param c code point must have compositions * @return compositions list pointer @@ -563,46 +637,78 @@ class U_COMMON_API Normalizer2Impl : public UObject { UChar32 minNeedDataCP, ReorderingBuffer *buffer, UErrorCode &errorCode) const; - UBool decomposeShort(const UChar *src, const UChar *limit, - ReorderingBuffer &buffer, UErrorCode &errorCode) const; + const UChar *decomposeShort(const UChar *src, const UChar *limit, + UBool stopAtCompBoundary, UBool onlyContiguous, + ReorderingBuffer &buffer, UErrorCode &errorCode) const; UBool decompose(UChar32 c, uint16_t norm16, ReorderingBuffer &buffer, UErrorCode &errorCode) const; + const uint8_t *decomposeShort(const uint8_t *src, const uint8_t *limit, + UBool stopAtCompBoundary, UBool onlyContiguous, + ReorderingBuffer &buffer, UErrorCode &errorCode) const; + static int32_t combine(const uint16_t *list, UChar32 trail); void addComposites(const uint16_t *list, UnicodeSet &set) const; void recompose(ReorderingBuffer &buffer, int32_t recomposeStartIndex, UBool onlyContiguous) const; - UBool hasCompBoundaryBefore(UChar32 c, uint16_t norm16) const; - const UChar *findPreviousCompBoundary(const UChar *start, const UChar *p) const; - const UChar *findNextCompBoundary(const UChar *p, const UChar *limit) const; + UBool hasCompBoundaryBefore(UChar32 c, uint16_t norm16) const { + return ctrie, start, end, (uint32_t)rowIndex, TRUE, pErrorCode); diff --git a/deps/icu-small/source/common/propsvec.h b/deps/icu-small/source/common/propsvec.h index b34e4ee8ff444e..39080615ea3811 100644 --- a/deps/icu-small/source/common/propsvec.h +++ b/deps/icu-small/source/common/propsvec.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: propsvec.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/punycode.cpp b/deps/icu-small/source/common/punycode.cpp index 90fd1692466a47..4f0b9ea9cd385f 100644 --- a/deps/icu-small/source/common/punycode.cpp +++ b/deps/icu-small/source/common/punycode.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: punycode.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/punycode.h b/deps/icu-small/source/common/punycode.h index ff23eb0c377d5d..5d8a243175cca3 100644 --- a/deps/icu-small/source/common/punycode.h +++ b/deps/icu-small/source/common/punycode.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: punycode.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/putil.cpp b/deps/icu-small/source/common/putil.cpp index c2ede806edcbea..e367fa6d30e866 100644 --- a/deps/icu-small/source/common/putil.cpp +++ b/deps/icu-small/source/common/putil.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -43,8 +43,24 @@ // Must be before any other #includes. #include "uposixdefs.h" -/* include ICU headers */ -#include "unicode/utypes.h" +// First, the platform type. Need this for U_PLATFORM. +#include "unicode/platform.h" + +#if U_PLATFORM == U_PF_MINGW && defined __STRICT_ANSI__ +/* tzset isn't defined in strict ANSI on MinGW. */ +#undef __STRICT_ANSI__ +#endif + +/* + * Cygwin with GCC requires inclusion of time.h after the above disabling strict asci mode statement. + */ +#include + +#if !U_PLATFORM_USES_ONLY_WIN32_API +#include +#endif + +/* include the rest of the ICU headers */ #include "unicode/putil.h" #include "unicode/ustring.h" #include "putilimp.h" @@ -76,14 +92,29 @@ * Should Cygwin be included as well (U_PLATFORM_HAS_WIN32_API) * to use native APIs as much as possible? */ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE # define NOIME # define NOMCX # include +# include "unicode/uloc.h" +#if U_PLATFORM_HAS_WINUWP_API == 0 # include "wintz.h" +#else // U_PLATFORM_HAS_WINUWP_API +typedef PVOID LPMSG; // TODO: figure out how to get rid of this typedef +#include +#include +#include +#include + +using namespace ABI::Windows::Foundation; +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +#endif #elif U_PLATFORM == U_PF_OS400 # include # include /* error code structure */ @@ -104,20 +135,6 @@ # include #endif -#if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__) -/* tzset isn't defined in strict ANSI on Cygwin and MinGW. */ -#undef __STRICT_ANSI__ -#endif - -/* - * Cygwin with GCC requires inclusion of time.h after the above disabling strict asci mode statement. - */ -#include - -#if !U_PLATFORM_USES_ONLY_WIN32_API -#include -#endif - /* * Only include langinfo.h if we have a way to get the codeset. If we later * depend on more feature, we can test on U_HAVE_NL_LANGINFO. @@ -651,13 +668,23 @@ uprv_timezone() /* Note that U_TZNAME does *not* have to be tzname, but if it is, some platforms need to have it declared here. */ -#if defined(U_TZNAME) && (U_PLATFORM == U_PF_IRIX || U_PLATFORM_IS_DARWIN_BASED || (U_PLATFORM == U_PF_CYGWIN && !U_PLATFORM_USES_ONLY_WIN32_API)) +#if defined(U_TZNAME) && (U_PLATFORM == U_PF_IRIX || U_PLATFORM_IS_DARWIN_BASED) /* RS6000 and others reject char **tzname. */ extern U_IMPORT char *U_TZNAME[]; #endif #if !UCONFIG_NO_FILE_IO && ((U_PLATFORM_IS_DARWIN_BASED && (U_PLATFORM != U_PF_IPHONE || defined(U_TIMEZONE))) || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD || U_PLATFORM == U_PF_SOLARIS) /* These platforms are likely to use Olson timezone IDs. */ +/* common targets of the symbolic link at TZDEFAULT are: + * "/usr/share/zoneinfo/" default, older Linux distros, macOS to 10.12 + * "../usr/share/zoneinfo/" newer Linux distros: Red Hat Enterprise Linux 7, Ubuntu 16, SuSe Linux 12 + * "/usr/share/lib/zoneinfo/" Solaris + * "../usr/share/lib/zoneinfo/" Solaris + * "/var/db/timezone/zoneinfo/" macOS 10.13 + * To avoid checking lots of paths, just check that the target path + * before the ends with "/zoneinfo/", and the is valid. + */ + #define CHECK_LOCALTIME_LINK 1 #if U_PLATFORM_IS_DARWIN_BASED #include @@ -665,12 +692,12 @@ extern U_IMPORT char *U_TZNAME[]; #elif U_PLATFORM == U_PF_SOLARIS #define TZDEFAULT "/etc/localtime" #define TZZONEINFO "/usr/share/lib/zoneinfo/" -#define TZZONEINFO2 "../usr/share/lib/zoneinfo/" #define TZ_ENV_CHECK "localtime" #else #define TZDEFAULT "/etc/localtime" #define TZZONEINFO "/usr/share/zoneinfo/" #endif +#define TZZONEINFOTAIL "/zoneinfo/" #if U_HAVE_DIRENT_H #define TZFILE_SKIP "posixrules" /* tz file to skip when searching. */ /* Some Linux distributions have 'localtime' in /usr/share/zoneinfo @@ -922,30 +949,30 @@ static CharString *gSearchTZFileResult = NULL; * This function is not thread safe - it uses a global, gSearchTZFileResult, to hold its results. */ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) { - DIR* dirp = opendir(path); - DIR* subDirp = NULL; + DIR* dirp = NULL; struct dirent* dirEntry = NULL; - char* result = NULL; + UErrorCode status = U_ZERO_ERROR; + + /* Save the current path */ + CharString curpath(path, -1, status); + if (U_FAILURE(status)) { + goto cleanupAndReturn; + } + + dirp = opendir(path); if (dirp == NULL) { - return result; + goto cleanupAndReturn; } if (gSearchTZFileResult == NULL) { gSearchTZFileResult = new CharString; if (gSearchTZFileResult == NULL) { - return NULL; + goto cleanupAndReturn; } ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); } - /* Save the current path */ - UErrorCode status = U_ZERO_ERROR; - CharString curpath(path, -1, status); - if (U_FAILURE(status)) { - return NULL; - } - /* Check each entry in the directory. */ while((dirEntry = readdir(dirp)) != NULL) { const char* dirName = dirEntry->d_name; @@ -954,15 +981,16 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) { CharString newpath(curpath, status); newpath.append(dirName, -1, status); if (U_FAILURE(status)) { - return NULL; + break; } + DIR* subDirp = NULL; if ((subDirp = opendir(newpath.data())) != NULL) { /* If this new path is a directory, make a recursive call with the newpath. */ closedir(subDirp); newpath.append('/', status); if (U_FAILURE(status)) { - return NULL; + break; } result = searchForTZFile(newpath.data(), tzInfo); /* @@ -986,7 +1014,7 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) { gSearchTZFileResult->clear(); gSearchTZFileResult->append(zoneid, -1, status); if (U_FAILURE(status)) { - return NULL; + break; } result = gSearchTZFileResult->data(); /* Get out after the first one found. */ @@ -995,7 +1023,11 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) { } } } - closedir(dirp); + + cleanupAndReturn: + if (dirp) { + closedir(dirp); + } return result; } #endif @@ -1008,16 +1040,66 @@ uprv_tzname_clear_cache() #endif } +// With the Universal Windows Platform we can just ask Windows for the name +#if U_PLATFORM_HAS_WINUWP_API +U_CAPI const char* U_EXPORT2 +uprv_getWindowsTimeZone() +{ + // Get default Windows timezone. + ComPtr calendar; + HRESULT hr = RoActivateInstance( + HStringReference(RuntimeClass_Windows_Globalization_Calendar).Get(), + &calendar); + if (SUCCEEDED(hr)) + { + ComPtr timezone; + hr = calendar.As(&timezone); + if (SUCCEEDED(hr)) + { + HString timezoneString; + hr = timezone->GetTimeZone(timezoneString.GetAddressOf()); + if (SUCCEEDED(hr)) + { + int32_t length = static_cast(wcslen(timezoneString.GetRawBuffer(NULL))); + char* asciiId = (char*)uprv_calloc(length + 1, sizeof(char)); + if (asciiId != nullptr) + { + u_UCharsToChars((UChar*)timezoneString.GetRawBuffer(NULL), asciiId, length); + return asciiId; + } + } + } + } + + // Failed + return nullptr; +} +#endif + U_CAPI const char* U_EXPORT2 uprv_tzname(int n) { + (void)n; // Avoid unreferenced parameter warning. const char *tzid = NULL; #if U_PLATFORM_USES_ONLY_WIN32_API +#if U_PLATFORM_HAS_WINUWP_API > 0 + tzid = uprv_getWindowsTimeZone(); +#else tzid = uprv_detectWindowsTimeZone(); +#endif if (tzid != NULL) { return tzid; } + +#ifndef U_TZNAME + // The return value is free'd in timezone.cpp on Windows because + // the other code path returns a pointer to a heap location. + // If we don't have a name already, then tzname wouldn't be any + // better, so just fall back. + return uprv_strdup("Etc/UTC"); +#endif // !U_TZNAME + #else /*#if U_PLATFORM_IS_DARWIN_BASED @@ -1059,24 +1141,15 @@ uprv_tzname(int n) */ int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)-1); if (0 < ret) { - int32_t tzZoneInfoLen = uprv_strlen(TZZONEINFO); + int32_t tzZoneInfoTailLen = uprv_strlen(TZZONEINFOTAIL); gTimeZoneBuffer[ret] = 0; - if (uprv_strncmp(gTimeZoneBuffer, TZZONEINFO, tzZoneInfoLen) == 0 - && isValidOlsonID(gTimeZoneBuffer + tzZoneInfoLen)) - { - return (gTimeZoneBufferPtr = gTimeZoneBuffer + tzZoneInfoLen); - } -#if U_PLATFORM == U_PF_SOLARIS - else + char * tzZoneInfoTailPtr = uprv_strstr(gTimeZoneBuffer, TZZONEINFOTAIL); + + if (tzZoneInfoTailPtr != NULL + && isValidOlsonID(tzZoneInfoTailPtr + tzZoneInfoTailLen)) { - tzZoneInfoLen = uprv_strlen(TZZONEINFO2); - if (uprv_strncmp(gTimeZoneBuffer, TZZONEINFO2, tzZoneInfoLen) == 0 - && isValidOlsonID(gTimeZoneBuffer + tzZoneInfoLen)) - { - return (gTimeZoneBufferPtr = gTimeZoneBuffer + tzZoneInfoLen); - } + return (gTimeZoneBufferPtr = tzZoneInfoTailPtr + tzZoneInfoTailLen); } -#endif } else { #if defined(SEARCH_TZFILE) DefaultTZInfo* tzInfo = (DefaultTZInfo*)uprv_malloc(sizeof(DefaultTZInfo)); @@ -1162,7 +1235,8 @@ UInitOnce gTimeZoneFilesInitOnce = U_INITONCE_INITIALIZER; static CharString *gTimeZoneFilesDirectory = NULL; #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API - static char *gCorrectedPOSIXLocale = NULL; /* Heap allocated */ + static const char *gCorrectedPOSIXLocale = NULL; /* Sometimes heap allocated */ + static bool gCorrectedPOSIXLocaleHeapAllocated = false; #endif static UBool U_CALLCONV putil_cleanup(void) @@ -1183,9 +1257,10 @@ static UBool U_CALLCONV putil_cleanup(void) #endif #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API - if (gCorrectedPOSIXLocale) { - uprv_free(gCorrectedPOSIXLocale); + if (gCorrectedPOSIXLocale && gCorrectedPOSIXLocaleHeapAllocated) { + uprv_free(const_cast(gCorrectedPOSIXLocale)); gCorrectedPOSIXLocale = NULL; + gCorrectedPOSIXLocaleHeapAllocated = false; } #endif return TRUE; @@ -1219,7 +1294,7 @@ u_setDataDirectory(const char *directory) { #if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR) { char *p; - while(p = uprv_strchr(newDataDir, U_FILE_ALT_SEP_CHAR)) { + while((p = uprv_strchr(newDataDir, U_FILE_ALT_SEP_CHAR)) != NULL) { *p = U_FILE_SEP_CHAR; } } @@ -1297,7 +1372,9 @@ static void U_CALLCONV dataDirectoryInitFn() { */ # if !defined(ICU_NO_USER_DATA_OVERRIDE) && !UCONFIG_NO_FILE_IO /* First try to get the environment variable */ - path=getenv("ICU_DATA"); +# if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP does not support getenv + path=getenv("ICU_DATA"); +# endif # endif /* ICU_DATA_DIR may be set as a compile option. @@ -1326,9 +1403,35 @@ static void U_CALLCONV dataDirectoryInitFn() { } #endif +#if defined(ICU_DATA_DIR_WINDOWS) && U_PLATFORM_HAS_WINUWP_API != 0 + // Use data from the %windir%\globalization\icu directory + // This is only available if ICU is built as a system component + char datadir_path_buffer[MAX_PATH]; + UINT length = GetWindowsDirectoryA(datadir_path_buffer, UPRV_LENGTHOF(datadir_path_buffer)); + if (length > 0 && length < (UPRV_LENGTHOF(datadir_path_buffer) - sizeof(ICU_DATA_DIR_WINDOWS) - 1)) + { + if (datadir_path_buffer[length - 1] != '\\') + { + datadir_path_buffer[length++] = '\\'; + datadir_path_buffer[length] = '\0'; + } + + if ((length + 1 + sizeof(ICU_DATA_DIR_WINDOWS)) < UPRV_LENGTHOF(datadir_path_buffer)) + { + uprv_strcat(datadir_path_buffer, ICU_DATA_DIR_WINDOWS); + path = datadir_path_buffer; + } + } +#endif + if(path==NULL) { /* It looks really bad, set it to something. */ +#if U_PLATFORM_HAS_WIN32_API + // Windows UWP will require icudtl.dat file in same directory as icuuc.dll + path = ".\\"; +#else path = ""; +#endif } u_setDataDirectory(path); @@ -1349,7 +1452,7 @@ static void setTimeZoneFilesDir(const char *path, UErrorCode &status) { gTimeZoneFilesDirectory->append(path, status); #if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR) char *p = gTimeZoneFilesDirectory->data(); - while (p = uprv_strchr(p, U_FILE_ALT_SEP_CHAR)) { + while ((p = uprv_strchr(p, U_FILE_ALT_SEP_CHAR)) != NULL) { *p = U_FILE_SEP_CHAR; } #endif @@ -1366,7 +1469,12 @@ static void U_CALLCONV TimeZoneDataDirInitFn(UErrorCode &status) { status = U_MEMORY_ALLOCATION_ERROR; return; } +#if U_PLATFORM_HAS_WINUWP_API == 0 const char *dir = getenv("ICU_TIMEZONE_FILES_DIR"); +#else + // TODO: UWP does not support alternate timezone data directories at this time + const char *dir = ""; +#endif // U_PLATFORM_HAS_WINUWP_API #if defined(U_TIMEZONE_FILES_DIR) if (dir == NULL) { dir = TO_STRING(U_TIMEZONE_FILES_DIR); @@ -1603,6 +1711,7 @@ The leftmost codepage (.xxx) wins. if (gCorrectedPOSIXLocale == NULL) { gCorrectedPOSIXLocale = correctedPOSIXLocale; + gCorrectedPOSIXLocaleHeapAllocated = true; ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); correctedPOSIXLocale = NULL; } @@ -1618,25 +1727,117 @@ The leftmost codepage (.xxx) wins. UErrorCode status = U_ZERO_ERROR; char *correctedPOSIXLocale = 0; + // If we have already figured this out just use the cached value if (gCorrectedPOSIXLocale != NULL) { return gCorrectedPOSIXLocale; } - LCID id = GetThreadLocale(); - correctedPOSIXLocale = static_cast(uprv_malloc(POSIX_LOCALE_CAPACITY + 1)); - if (correctedPOSIXLocale) { - int32_t posixLen = uprv_convertToPosix(id, correctedPOSIXLocale, POSIX_LOCALE_CAPACITY, &status); - if (U_SUCCESS(status)) { - *(correctedPOSIXLocale + posixLen) = 0; - gCorrectedPOSIXLocale = correctedPOSIXLocale; - ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); - } else { - uprv_free(correctedPOSIXLocale); + // No cached value, need to determine the current value + static WCHAR windowsLocale[LOCALE_NAME_MAX_LENGTH]; +#if U_PLATFORM_HAS_WINUWP_API == 0 + // If not a Universal Windows App, we'll need user default language. + // Vista and above should use Locale Names instead of LCIDs + int length = GetUserDefaultLocaleName(windowsLocale, UPRV_LENGTHOF(windowsLocale)); +#else + // In a UWP app, we want the top language that the application and user agreed upon + ComPtr> languageList; + + ComPtr applicationLanguagesStatics; + HRESULT hr = GetActivationFactory( + HStringReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), + &applicationLanguagesStatics); + if (SUCCEEDED(hr)) + { + hr = applicationLanguagesStatics->get_Languages(&languageList); + } + + if (FAILED(hr)) + { + // If there is no application context, then use the top language from the user language profile + ComPtr globalizationPreferencesStatics; + hr = GetActivationFactory( + HStringReference(RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences).Get(), + &globalizationPreferencesStatics); + if (SUCCEEDED(hr)) + { + hr = globalizationPreferencesStatics->get_Languages(&languageList); + } + } + + // We have a list of languages, ICU knows one, so use the top one for our locale + HString topLanguage; + if (SUCCEEDED(hr)) + { + hr = languageList->GetAt(0, topLanguage.GetAddressOf()); + } + + if (FAILED(hr)) + { + // Unexpected, use en-US by default + if (gCorrectedPOSIXLocale == NULL) { + gCorrectedPOSIXLocale = "en_US"; } + + return gCorrectedPOSIXLocale; } + // ResolveLocaleName will get a likely subtags form consistent with Windows behavior. + int length = ResolveLocaleName(topLanguage.GetRawBuffer(NULL), windowsLocale, UPRV_LENGTHOF(windowsLocale)); +#endif + // Now we should have a Windows locale name that needs converted to the POSIX style, + if (length > 0) + { + // First we need to go from UTF-16 to char (and also convert from _ to - while we're at it.) + char modifiedWindowsLocale[LOCALE_NAME_MAX_LENGTH]; + + int32_t i; + for (i = 0; i < UPRV_LENGTHOF(modifiedWindowsLocale); i++) + { + if (windowsLocale[i] == '_') + { + modifiedWindowsLocale[i] = '-'; + } + else + { + modifiedWindowsLocale[i] = static_cast(windowsLocale[i]); + } + + if (modifiedWindowsLocale[i] == '\0') + { + break; + } + } + + if (i >= UPRV_LENGTHOF(modifiedWindowsLocale)) + { + // Ran out of room, can't really happen, maybe we'll be lucky about a matching + // locale when tags are dropped + modifiedWindowsLocale[UPRV_LENGTHOF(modifiedWindowsLocale) - 1] = '\0'; + } + + // Now normalize the resulting name + correctedPOSIXLocale = static_cast(uprv_malloc(POSIX_LOCALE_CAPACITY + 1)); + /* TODO: Should we just exit on memory allocation failure? */ + if (correctedPOSIXLocale) + { + int32_t posixLen = uloc_canonicalize(modifiedWindowsLocale, correctedPOSIXLocale, POSIX_LOCALE_CAPACITY, &status); + if (U_SUCCESS(status)) + { + *(correctedPOSIXLocale + posixLen) = 0; + gCorrectedPOSIXLocale = correctedPOSIXLocale; + gCorrectedPOSIXLocaleHeapAllocated = true; + ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); + } + else + { + uprv_free(correctedPOSIXLocale); + } + } + } + + // If unable to find a locale we can agree upon, use en-US by default if (gCorrectedPOSIXLocale == NULL) { - return "en_US"; + gCorrectedPOSIXLocale = "en_US"; } return gCorrectedPOSIXLocale; @@ -1923,8 +2124,34 @@ int_getDefaultCodepage() #elif U_PLATFORM_USES_ONLY_WIN32_API static char codepage[64]; - sprintf(codepage, "windows-%d", GetACP()); - return codepage; + DWORD codepageNumber = 0; + +#if U_PLATFORM_HAS_WINUWP_API > 0 + // UWP doesn't have a direct API to get the default ACP as Microsoft would rather + // have folks use Unicode than a "system" code page, however this is the same + // codepage as the system default locale codepage. (FWIW, the system locale is + // ONLY used for codepage, it should never be used for anything else) + GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, + (LPWSTR)&codepageNumber, sizeof(codepageNumber) / sizeof(WCHAR)); +#else + // Win32 apps can call GetACP + codepageNumber = GetACP(); +#endif + // Special case for UTF-8 + if (codepageNumber == 65001) + { + return "UTF-8"; + } + // Windows codepages can look like windows-1252, so format the found number + // the numbers are eclectic, however all valid system code pages, besides UTF-8 + // are between 3 and 19999 + if (codepageNumber > 0 && codepageNumber < 20000) + { + sprintf(codepage, "windows-%ld", codepageNumber); + return codepage; + } + // If the codepage number call failed then return UTF-8 + return "UTF-8"; #elif U_POSIX_LOCALE static char codesetName[100]; @@ -2108,19 +2335,16 @@ u_getVersion(UVersionInfo versionArray) { * icucfg.h dependent code */ -#if U_ENABLE_DYLOAD - -#if HAVE_DLOPEN && !U_PLATFORM_USES_ONLY_WIN32_API +#if U_ENABLE_DYLOAD && HAVE_DLOPEN && !U_PLATFORM_USES_ONLY_WIN32_API #if HAVE_DLFCN_H - #ifdef __MVS__ #ifndef __SUSV3 #define __SUSV3 1 #endif #endif #include -#endif +#endif /* HAVE_DLFCN_H */ U_INTERNAL void * U_EXPORT2 uprv_dl_open(const char *libName, UErrorCode *status) { @@ -2160,38 +2384,10 @@ uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) { return uret.fp; } -#else +#elif U_ENABLE_DYLOAD && U_PLATFORM_USES_ONLY_WIN32_API && !U_PLATFORM_HAS_WINUWP_API -/* null (nonexistent) implementation. */ - -U_INTERNAL void * U_EXPORT2 -uprv_dl_open(const char *libName, UErrorCode *status) { - if(U_FAILURE(*status)) return NULL; - *status = U_UNSUPPORTED_ERROR; - return NULL; -} - -U_INTERNAL void U_EXPORT2 -uprv_dl_close(void *lib, UErrorCode *status) { - if(U_FAILURE(*status)) return; - *status = U_UNSUPPORTED_ERROR; - return; -} - - -U_INTERNAL UVoidFunction* U_EXPORT2 -uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) { - if(U_SUCCESS(*status)) { - *status = U_UNSUPPORTED_ERROR; - } - return (UVoidFunction*)NULL; -} - - - -#endif - -#elif U_PLATFORM_USES_ONLY_WIN32_API +/* Windows API implementation. */ +// Note: UWP does not expose/allow these APIs, so the UWP version gets the null implementation. */ U_INTERNAL void * U_EXPORT2 uprv_dl_open(const char *libName, UErrorCode *status) { @@ -2218,7 +2414,6 @@ uprv_dl_close(void *lib, UErrorCode *status) { return; } - U_INTERNAL UVoidFunction* U_EXPORT2 uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) { HMODULE handle = (HMODULE)lib; @@ -2240,10 +2435,9 @@ uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) { return addr; } - #else -/* No dynamic loading set. */ +/* No dynamic loading, null (nonexistent) implementation. */ U_INTERNAL void * U_EXPORT2 uprv_dl_open(const char *libName, UErrorCode *status) { @@ -2261,7 +2455,6 @@ uprv_dl_close(void *lib, UErrorCode *status) { return; } - U_INTERNAL UVoidFunction* U_EXPORT2 uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) { (void)lib; @@ -2272,7 +2465,7 @@ uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) { return (UVoidFunction*)NULL; } -#endif /* U_ENABLE_DYLOAD */ +#endif /* * Hey, Emacs, please set the following: diff --git a/deps/icu-small/source/common/putilimp.h b/deps/icu-small/source/common/putilimp.h index cb783508255dd6..56ea8df00959d1 100644 --- a/deps/icu-small/source/common/putilimp.h +++ b/deps/icu-small/source/common/putilimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -72,22 +72,13 @@ typedef size_t uintptr_t; #endif -/** - * \def U_HAVE_MSVC_2003_OR_EARLIER - * Flag for workaround of MSVC 2003 optimization bugs - * @internal - */ -#if !defined(U_HAVE_MSVC_2003_OR_EARLIER) && defined(_MSC_VER) && (_MSC_VER < 1400) -#define U_HAVE_MSVC_2003_OR_EARLIER -#endif - /*===========================================================================*/ /** @{ Information about POSIX support */ /*===========================================================================*/ #ifdef U_HAVE_NL_LANGINFO_CODESET /* Use the predefined value. */ -#elif U_PLATFORM_HAS_WIN32_API || U_PLATFORM == U_PF_ANDROID || U_PLATFORM == U_PF_QNX +#elif U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_ANDROID || U_PLATFORM == U_PF_QNX # define U_HAVE_NL_LANGINFO_CODESET 0 #else # define U_HAVE_NL_LANGINFO_CODESET 1 @@ -106,7 +97,10 @@ typedef size_t uintptr_t; #ifdef U_TZSET /* Use the predefined value. */ #elif U_PLATFORM_USES_ONLY_WIN32_API + // UWP doesn't support tzset or environment variables for tz +#if U_PLATFORM_HAS_WINUWP_API == 0 # define U_TZSET _tzset +#endif #elif U_PLATFORM == U_PF_OS400 /* not defined */ #else @@ -117,15 +111,15 @@ typedef size_t uintptr_t; /* Use the predefined value. */ #elif U_PLATFORM == U_PF_ANDROID # define U_TIMEZONE timezone +#elif defined(__UCLIBC__) + // uClibc does not have __timezone or _timezone. +#elif defined(_NEWLIB_VERSION) +# define U_TIMEZONE _timezone +#elif defined(__GLIBC__) + // glibc +# define U_TIMEZONE __timezone #elif U_PLATFORM_IS_LINUX_BASED -# if defined(__UCLIBC__) - /* uClibc does not have __timezone or _timezone. */ -# elif defined(_NEWLIB_VERSION) -# define U_TIMEZONE _timezone -# elif defined(__GLIBC__) - /* glibc */ -# define U_TIMEZONE __timezone -# endif + // not defined #elif U_PLATFORM_USES_ONLY_WIN32_API # define U_TIMEZONE _timezone #elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__) @@ -141,7 +135,10 @@ typedef size_t uintptr_t; #ifdef U_TZNAME /* Use the predefined value. */ #elif U_PLATFORM_USES_ONLY_WIN32_API + /* not usable on all windows platforms */ +#if U_PLATFORM_HAS_WINUWP_API == 0 # define U_TZNAME _tzname +#endif #elif U_PLATFORM == U_PF_OS400 /* not defined */ #else @@ -208,7 +205,7 @@ typedef size_t uintptr_t; /** * \def U_HAVE_STD_ATOMICS * Defines whether the standard C++11 is available. - * ICU will use this when avialable, + * ICU will use this when available, * otherwise will fall back to compiler or platform specific alternatives. * @internal */ @@ -233,7 +230,7 @@ typedef size_t uintptr_t; /** * \def U_HAVE_CLANG_ATOMICS - * Defines whether Clang c11 style built-in atomics are avaialable. + * Defines whether Clang c11 style built-in atomics are available. * These are used in preference to gcc atomics when both are available. */ #ifdef U_HAVE_CLANG_ATOMICS @@ -271,7 +268,7 @@ typedef size_t uintptr_t; /** * Platform utilities isolates the platform dependencies of the - * libarary. For each platform which this code is ported to, these + * library. For each platform which this code is ported to, these * functions may have to be re-implemented. */ @@ -419,7 +416,7 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void); /** * Please use uloc_getDefault() instead. - * Return the default locale ID string by querying ths system, or + * Return the default locale ID string by querying the system, or * zero if one cannot be found. * This function can call setlocale() on Unix platforms. Please read the * platform documentation on setlocale() before calling this function. diff --git a/deps/icu-small/source/common/rbbi.cpp b/deps/icu-small/source/common/rbbi.cpp index daba40b741406d..54b289e24d1e0a 100644 --- a/deps/icu-small/source/common/rbbi.cpp +++ b/deps/icu-small/source/common/rbbi.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -7,7 +7,7 @@ *************************************************************************** */ // -// file: rbbi.c Contains the implementation of the rule based break iterator +// file: rbbi.cpp Contains the implementation of the rule based break iterator // runtime engine and the API implementation for // class RuleBasedBreakIterator // @@ -21,18 +21,19 @@ #include "unicode/rbbi.h" #include "unicode/schriter.h" #include "unicode/uchriter.h" -#include "unicode/udata.h" #include "unicode/uclean.h" -#include "rbbidata.h" -#include "rbbirb.h" +#include "unicode/udata.h" + +#include "brkeng.h" +#include "ucln_cmn.h" #include "cmemory.h" #include "cstring.h" -#include "umutex.h" -#include "ucln_cmn.h" -#include "brkeng.h" - +#include "rbbidata.h" +#include "rbbi_cache.h" +#include "rbbirb.h" #include "uassert.h" -#include "uvector.h" +#include "umutex.h" +#include "uvectr32.h" // if U_LOCAL_SERVICE_HOOK is defined, then localsvc.cpp is expected to be included. #if U_LOCAL_SERVICE_HOOK @@ -40,16 +41,16 @@ #endif #ifdef RBBI_DEBUG -static UBool fTrace = FALSE; +static UBool gTrace = FALSE; #endif U_NAMESPACE_BEGIN // The state number of the starting state -#define START_STATE 1 +constexpr int32_t START_STATE = 1; // The state-transition value indicating "stop" -#define STOP_STATE 0 +constexpr int32_t STOP_STATE = 0; UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RuleBasedBreakIterator) @@ -63,9 +64,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RuleBasedBreakIterator) * Constructs a RuleBasedBreakIterator that uses the already-created * tables object that is passed in as a parameter. */ -RuleBasedBreakIterator::RuleBasedBreakIterator(RBBIDataHeader* data, UErrorCode &status) -{ - init(); +RuleBasedBreakIterator::RuleBasedBreakIterator(RBBIDataHeader* data, UErrorCode &status) { + init(status); fData = new RBBIDataWrapper(data, status); // status checked in constructor if (U_FAILURE(status)) {return;} if(fData == 0) { @@ -81,7 +81,7 @@ RuleBasedBreakIterator::RuleBasedBreakIterator(RBBIDataHeader* data, UErrorCode RuleBasedBreakIterator::RuleBasedBreakIterator(const uint8_t *compiledRules, uint32_t ruleLength, UErrorCode &status) { - init(); + init(status); if (U_FAILURE(status)) { return; } @@ -111,7 +111,7 @@ RuleBasedBreakIterator::RuleBasedBreakIterator(const uint8_t *compiledRules, //------------------------------------------------------------------------------- RuleBasedBreakIterator::RuleBasedBreakIterator(UDataMemory* udm, UErrorCode &status) { - init(); + init(status); fData = new RBBIDataWrapper(udm, status); // status checked in constructor if (U_FAILURE(status)) {return;} if(fData == 0) { @@ -131,7 +131,7 @@ RuleBasedBreakIterator::RuleBasedBreakIterator( const UnicodeString &rules, UParseError &parseError, UErrorCode &status) { - init(); + init(status); if (U_FAILURE(status)) {return;} RuleBasedBreakIterator *bi = (RuleBasedBreakIterator *) RBBIRuleBuilder::createRuleBasedBreakIterator(rules, &parseError, status); @@ -153,7 +153,8 @@ RuleBasedBreakIterator::RuleBasedBreakIterator( const UnicodeString &rules, // of rules. //------------------------------------------------------------------------------- RuleBasedBreakIterator::RuleBasedBreakIterator() { - init(); + UErrorCode status = U_ZERO_ERROR; + init(status); } @@ -166,7 +167,8 @@ RuleBasedBreakIterator::RuleBasedBreakIterator() { RuleBasedBreakIterator::RuleBasedBreakIterator(const RuleBasedBreakIterator& other) : BreakIterator(other) { - this->init(); + UErrorCode status = U_ZERO_ERROR; + this->init(status); *this = other; } @@ -181,7 +183,7 @@ RuleBasedBreakIterator::~RuleBasedBreakIterator() { } fCharIter = NULL; delete fSCharIter; - fCharIter = NULL; + fSCharIter = NULL; delete fDCharIter; fDCharIter = NULL; @@ -191,18 +193,17 @@ RuleBasedBreakIterator::~RuleBasedBreakIterator() { fData->removeReference(); fData = NULL; } - if (fCachedBreakPositions) { - uprv_free(fCachedBreakPositions); - fCachedBreakPositions = NULL; - } - if (fLanguageBreakEngines) { - delete fLanguageBreakEngines; - fLanguageBreakEngines = NULL; - } - if (fUnhandledBreakEngine) { - delete fUnhandledBreakEngine; - fUnhandledBreakEngine = NULL; - } + delete fBreakCache; + fBreakCache = NULL; + + delete fDictionaryCache; + fDictionaryCache = NULL; + + delete fLanguageBreakEngines; + fLanguageBreakEngines = NULL; + + delete fUnhandledBreakEngine; + fUnhandledBreakEngine = NULL; } /** @@ -214,7 +215,8 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) { if (this == &that) { return *this; } - reset(); // Delete break cache information + BreakIterator::operator=(that); + fBreakType = that.fBreakType; if (fLanguageBreakEngines != NULL) { delete fLanguageBreakEngines; @@ -244,6 +246,17 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) { fData = that.fData->addReference(); } + fPosition = that.fPosition; + fRuleStatusIndex = that.fRuleStatusIndex; + fDone = that.fDone; + + // TODO: both the dictionary and the main cache need to be copied. + // Current position could be within a dictionary range. Trying to continue + // the iteration without the caches present would go to the rules, with + // the assumption that the current position is on a rule boundary. + fBreakCache->reset(fPosition, fRuleStatusIndex); + fDictionaryCache->reset(); + return *this; } @@ -255,33 +268,43 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) { // Initializes all fields, leaving the object in a consistent state. // //----------------------------------------------------------------------------- -void RuleBasedBreakIterator::init() { - UErrorCode status = U_ZERO_ERROR; - fText = utext_openUChars(NULL, NULL, 0, &status); +void RuleBasedBreakIterator::init(UErrorCode &status) { + fText = NULL; fCharIter = NULL; fSCharIter = NULL; fDCharIter = NULL; fData = NULL; - fLastRuleStatusIndex = 0; - fLastStatusIndexValid = TRUE; + fPosition = 0; + fRuleStatusIndex = 0; + fDone = false; fDictionaryCharCount = 0; fBreakType = UBRK_WORD; // Defaulting BreakType to word gives reasonable // dictionary behavior for Break Iterators that are // built from rules. Even better would be the ability to // declare the type in the rules. - fCachedBreakPositions = NULL; - fLanguageBreakEngines = NULL; - fUnhandledBreakEngine = NULL; - fNumCachedBreakPositions = 0; - fPositionInCache = 0; + fLanguageBreakEngines = NULL; + fUnhandledBreakEngine = NULL; + fBreakCache = NULL; + fDictionaryCache = NULL; + + if (U_FAILURE(status)) { + return; + } + + fText = utext_openUChars(NULL, NULL, 0, &status); + fDictionaryCache = new DictionaryCache(this, status); + fBreakCache = new BreakCache(this, status); + if (U_SUCCESS(status) && (fText == NULL || fDictionaryCache == NULL || fBreakCache == NULL)) { + status = U_MEMORY_ALLOCATION_ERROR; + } #ifdef RBBI_DEBUG static UBool debugInitDone = FALSE; if (debugInitDone == FALSE) { char *debugEnv = getenv("U_RBBIDEBUG"); if (debugEnv && uprv_strstr(debugEnv, "trace")) { - fTrace = TRUE; + gTrace = TRUE; } debugInitDone = TRUE; } @@ -311,16 +334,28 @@ RuleBasedBreakIterator::operator==(const BreakIterator& that) const { if (typeid(*this) != typeid(that)) { return FALSE; } + if (this == &that) { + return TRUE; + } + + // The base class BreakIterator carries no state that participates in equality, + // and does not implement an equality function that would otherwise be + // checked at this point. const RuleBasedBreakIterator& that2 = (const RuleBasedBreakIterator&) that; if (!utext_equals(fText, that2.fText)) { // The two break iterators are operating on different text, - // or have a different interation position. + // or have a different iteration position. + // Note that fText's position is always the same as the break iterator's position. return FALSE; }; - // TODO: need a check for when in a dictionary region at different offsets. + if (!(fPosition == that2.fPosition && + fRuleStatusIndex == that2.fRuleStatusIndex && + fDone == that2.fDone)) { + return FALSE; + } if (that2.fData == fData || (fData != NULL && that2.fData != NULL && *that2.fData == *fData)) { @@ -348,7 +383,8 @@ void RuleBasedBreakIterator::setText(UText *ut, UErrorCode &status) { if (U_FAILURE(status)) { return; } - reset(); + fBreakCache->reset(); + fDictionaryCache->reset(); fText = utext_clone(fText, ut, FALSE, TRUE, &status); // Set up a dummy CharacterIterator to be returned if anyone @@ -382,27 +418,6 @@ UText *RuleBasedBreakIterator::getUText(UText *fillIn, UErrorCode &status) const } - -/** - * Returns the description used to create this iterator - */ -const UnicodeString& -RuleBasedBreakIterator::getRules() const { - if (fData != NULL) { - return fData->getRuleSourceString(); - } else { - static const UnicodeString *s; - if (s == NULL) { - // TODO: something more elegant here. - // perhaps API should return the string by value. - // Note: thread unsafe init & leak are semi-ok, better than - // what was before. Sould be cleaned up, though. - s = new UnicodeString; - } - return *s; - } -} - //======================================================================= // BreakIterator overrides //======================================================================= @@ -430,7 +445,8 @@ RuleBasedBreakIterator::adoptText(CharacterIterator* newText) { fCharIter = newText; UErrorCode status = U_ZERO_ERROR; - reset(); + fBreakCache->reset(); + fDictionaryCache->reset(); if (newText==NULL || newText->startIndex() != 0) { // startIndex !=0 wants to be an error, but there's no way to report it. // Make the iterator text be an empty string. @@ -449,7 +465,8 @@ RuleBasedBreakIterator::adoptText(CharacterIterator* newText) { void RuleBasedBreakIterator::setText(const UnicodeString& newText) { UErrorCode status = U_ZERO_ERROR; - reset(); + fBreakCache->reset(); + fDictionaryCache->reset(); fText = utext_openConstUnicodeString(fText, &newText, &status); // Set up a character iterator on the string. @@ -509,13 +526,12 @@ RuleBasedBreakIterator &RuleBasedBreakIterator::refreshInputText(UText *input, U * @return The new iterator position, which is zero. */ int32_t RuleBasedBreakIterator::first(void) { - reset(); - fLastRuleStatusIndex = 0; - fLastStatusIndexValid = TRUE; - //if (fText == NULL) - // return BreakIterator::DONE; - - utext_setNativeIndex(fText, 0); + UErrorCode status = U_ZERO_ERROR; + if (!fBreakCache->seek(0)) { + fBreakCache->populateNear(0, status); + } + fBreakCache->current(); + U_ASSERT(fPosition == 0); return 0; } @@ -524,17 +540,12 @@ int32_t RuleBasedBreakIterator::first(void) { * @return The text's past-the-end offset. */ int32_t RuleBasedBreakIterator::last(void) { - reset(); - if (fText == NULL) { - fLastRuleStatusIndex = 0; - fLastStatusIndexValid = TRUE; - return BreakIterator::DONE; - } - - fLastStatusIndexValid = FALSE; - int32_t pos = (int32_t)utext_nativeLength(fText); - utext_setNativeIndex(fText, pos); - return pos; + int32_t endPos = (int32_t)utext_nativeLength(fText); + UBool endShouldBeBoundary = isBoundary(endPos); // Has side effect of setting iterator position. + (void)endShouldBeBoundary; + U_ASSERT(endShouldBeBoundary); + U_ASSERT(fPosition == endPos); + return endPos; } /** @@ -547,14 +558,17 @@ int32_t RuleBasedBreakIterator::last(void) { * the current one. */ int32_t RuleBasedBreakIterator::next(int32_t n) { - int32_t result = current(); - while (n > 0) { - result = next(); - --n; - } - while (n < 0) { - result = previous(); - ++n; + int32_t result = 0; + if (n > 0) { + for (; n > 0 && result != UBRK_DONE; --n) { + result = next(); + } + } else if (n < 0) { + for (; n < 0 && result != UBRK_DONE; ++n) { + result = previous(); + } + } else { + result = current(); } return result; } @@ -564,396 +578,120 @@ int32_t RuleBasedBreakIterator::next(int32_t n) { * @return The position of the first boundary after this one. */ int32_t RuleBasedBreakIterator::next(void) { - // if we have cached break positions and we're still in the range - // covered by them, just move one step forward in the cache - if (fCachedBreakPositions != NULL) { - if (fPositionInCache < fNumCachedBreakPositions - 1) { - ++fPositionInCache; - int32_t pos = fCachedBreakPositions[fPositionInCache]; - utext_setNativeIndex(fText, pos); - return pos; - } - else { - reset(); - } - } - - int32_t startPos = current(); - fDictionaryCharCount = 0; - int32_t result = handleNext(fData->fForwardTable); - if (fDictionaryCharCount > 0) { - result = checkDictionary(startPos, result, FALSE); - } - return result; + fBreakCache->next(); + return fDone ? UBRK_DONE : fPosition; } /** - * Advances the iterator backwards, to the last boundary preceding this one. - * @return The position of the last boundary position preceding this one. + * Move the iterator backwards, to the boundary preceding the current one. + * + * Starts from the current position within fText. + * Starting position need not be on a boundary. + * + * @return The position of the boundary position immediately preceding the starting position. */ int32_t RuleBasedBreakIterator::previous(void) { - int32_t result; - int32_t startPos; - - // if we have cached break positions and we're still in the range - // covered by them, just move one step backward in the cache - if (fCachedBreakPositions != NULL) { - if (fPositionInCache > 0) { - --fPositionInCache; - // If we're at the beginning of the cache, need to reevaluate the - // rule status - if (fPositionInCache <= 0) { - fLastStatusIndexValid = FALSE; - } - int32_t pos = fCachedBreakPositions[fPositionInCache]; - utext_setNativeIndex(fText, pos); - return pos; - } - else { - reset(); - } - } - - // if we're already sitting at the beginning of the text, return DONE - if (fText == NULL || (startPos = current()) == 0) { - fLastRuleStatusIndex = 0; - fLastStatusIndexValid = TRUE; - return BreakIterator::DONE; - } - - if (fData->fSafeRevTable != NULL || fData->fSafeFwdTable != NULL) { - result = handlePrevious(fData->fReverseTable); - if (fDictionaryCharCount > 0) { - result = checkDictionary(result, startPos, TRUE); - } - return result; - } - - // old rule syntax - // set things up. handlePrevious() will back us up to some valid - // break position before the current position (we back our internal - // iterator up one step to prevent handlePrevious() from returning - // the current position), but not necessarily the last one before - // where we started - - int32_t start = current(); - - (void)UTEXT_PREVIOUS32(fText); - int32_t lastResult = handlePrevious(fData->fReverseTable); - if (lastResult == UBRK_DONE) { - lastResult = 0; - utext_setNativeIndex(fText, 0); - } - result = lastResult; - int32_t lastTag = 0; - UBool breakTagValid = FALSE; - - // iterate forward from the known break position until we pass our - // starting point. The last break position before the starting - // point is our return value - - for (;;) { - result = next(); - if (result == BreakIterator::DONE || result >= start) { - break; - } - lastResult = result; - lastTag = fLastRuleStatusIndex; - breakTagValid = TRUE; - } - - // fLastBreakTag wants to have the value for section of text preceding - // the result position that we are to return (in lastResult.) If - // the backwards rules overshot and the above loop had to do two or more - // next()s to move up to the desired return position, we will have a valid - // tag value. But, if handlePrevious() took us to exactly the correct result position, - // we wont have a tag value for that position, which is only set by handleNext(). - - // Set the current iteration position to be the last break position - // before where we started, and then return that value. - utext_setNativeIndex(fText, lastResult); - fLastRuleStatusIndex = lastTag; // for use by getRuleStatus() - fLastStatusIndexValid = breakTagValid; - - // No need to check the dictionary; it will have been handled by - // next() - - return lastResult; + UErrorCode status = U_ZERO_ERROR; + fBreakCache->previous(status); + return fDone ? UBRK_DONE : fPosition; } /** * Sets the iterator to refer to the first boundary position following * the specified position. - * @offset The position from which to begin searching for a break position. + * @param startPos The position from which to begin searching for a break position. * @return The position of the first break after the current position. */ -int32_t RuleBasedBreakIterator::following(int32_t offset) { - // if the offset passed in is already past the end of the text, - // just return DONE; if it's before the beginning, return the +int32_t RuleBasedBreakIterator::following(int32_t startPos) { + // if the supplied position is before the beginning, return the // text's starting offset - if (fText == NULL || offset >= utext_nativeLength(fText)) { - last(); - return next(); - } - else if (offset < 0) { + if (startPos < 0) { return first(); } // Move requested offset to a code point start. It might be on a trail surrogate, - // or on a trail byte if the input is UTF-8. - utext_setNativeIndex(fText, offset); - offset = (int32_t)utext_getNativeIndex(fText); - - // if we have cached break positions and offset is in the range - // covered by them, use them - // TODO: could use binary search - // TODO: what if offset is outside range, but break is not? - if (fCachedBreakPositions != NULL) { - if (offset >= fCachedBreakPositions[0] - && offset < fCachedBreakPositions[fNumCachedBreakPositions - 1]) { - fPositionInCache = 0; - // We are guaranteed not to leave the array due to range test above - while (offset >= fCachedBreakPositions[fPositionInCache]) { - ++fPositionInCache; - } - int32_t pos = fCachedBreakPositions[fPositionInCache]; - utext_setNativeIndex(fText, pos); - return pos; - } - else { - reset(); - } - } - - // Set our internal iteration position (temporarily) - // to the position passed in. If this is the _beginning_ position, - // then we can just use next() to get our return value - - int32_t result = 0; + // or on a trail byte if the input is UTF-8. Or it may be beyond the end of the text. + utext_setNativeIndex(fText, startPos); + startPos = (int32_t)utext_getNativeIndex(fText); - if (fData->fSafeRevTable != NULL) { - // new rule syntax - utext_setNativeIndex(fText, offset); - // move forward one codepoint to prepare for moving back to a - // safe point. - // this handles offset being between a supplementary character - // TODO: is this still needed, with move to code point boundary handled above? - (void)UTEXT_NEXT32(fText); - // handlePrevious will move most of the time to < 1 boundary away - handlePrevious(fData->fSafeRevTable); - int32_t result = next(); - while (result <= offset) { - result = next(); - } - return result; - } - if (fData->fSafeFwdTable != NULL) { - // backup plan if forward safe table is not available - utext_setNativeIndex(fText, offset); - (void)UTEXT_PREVIOUS32(fText); - // handle next will give result >= offset - handleNext(fData->fSafeFwdTable); - // previous will give result 0 or 1 boundary away from offset, - // most of the time - // we have to - int32_t oldresult = previous(); - while (oldresult > offset) { - int32_t result = previous(); - if (result <= offset) { - return oldresult; - } - oldresult = result; - } - int32_t result = next(); - if (result <= offset) { - return next(); - } - return result; - } - // otherwise, we have to sync up first. Use handlePrevious() to back - // up to a known break position before the specified position (if - // we can determine that the specified position is a break position, - // we don't back up at all). This may or may not be the last break - // position at or before our starting position. Advance forward - // from here until we've passed the starting position. The position - // we stop on will be the first break position after the specified one. - // old rule syntax - - utext_setNativeIndex(fText, offset); - if (offset==0 || - (offset==1 && utext_getNativeIndex(fText)==0)) { - return next(); - } - result = previous(); - - while (result != BreakIterator::DONE && result <= offset) { - result = next(); - } - - return result; + UErrorCode status = U_ZERO_ERROR; + fBreakCache->following(startPos, status); + return fDone ? UBRK_DONE : fPosition; } /** * Sets the iterator to refer to the last boundary position before the * specified position. - * @offset The position to begin searching for a break from. + * @param offset The position to begin searching for a break from. * @return The position of the last boundary before the starting position. */ int32_t RuleBasedBreakIterator::preceding(int32_t offset) { - // if the offset passed in is already past the end of the text, - // just return DONE; if it's before the beginning, return the - // text's starting offset if (fText == NULL || offset > utext_nativeLength(fText)) { return last(); } - else if (offset < 0) { - return first(); - } // Move requested offset to a code point start. It might be on a trail surrogate, // or on a trail byte if the input is UTF-8. - utext_setNativeIndex(fText, offset); - offset = (int32_t)utext_getNativeIndex(fText); - - // if we have cached break positions and offset is in the range - // covered by them, use them - if (fCachedBreakPositions != NULL) { - // TODO: binary search? - // TODO: What if offset is outside range, but break is not? - if (offset > fCachedBreakPositions[0] - && offset <= fCachedBreakPositions[fNumCachedBreakPositions - 1]) { - fPositionInCache = 0; - while (fPositionInCache < fNumCachedBreakPositions - && offset > fCachedBreakPositions[fPositionInCache]) - ++fPositionInCache; - --fPositionInCache; - // If we're at the beginning of the cache, need to reevaluate the - // rule status - if (fPositionInCache <= 0) { - fLastStatusIndexValid = FALSE; - } - utext_setNativeIndex(fText, fCachedBreakPositions[fPositionInCache]); - return fCachedBreakPositions[fPositionInCache]; - } - else { - reset(); - } - } - - // if we start by updating the current iteration position to the - // position specified by the caller, we can just use previous() - // to carry out this operation - - if (fData->fSafeFwdTable != NULL) { - // new rule syntax - utext_setNativeIndex(fText, offset); - int32_t newOffset = (int32_t)UTEXT_GETNATIVEINDEX(fText); - if (newOffset != offset) { - // Will come here if specified offset was not a code point boundary AND - // the underlying implmentation is using UText, which snaps any non-code-point-boundary - // indices to the containing code point. - // For breakitereator::preceding only, these non-code-point indices need to be moved - // up to refer to the following codepoint. - (void)UTEXT_NEXT32(fText); - offset = (int32_t)UTEXT_GETNATIVEINDEX(fText); - } - // TODO: (synwee) would it be better to just check for being in the middle of a surrogate pair, - // rather than adjusting the position unconditionally? - // (Change would interact with safe rules.) - // TODO: change RBBI behavior for off-boundary indices to match that of UText? - // affects only preceding(), seems cleaner, but is slightly different. - (void)UTEXT_PREVIOUS32(fText); - handleNext(fData->fSafeFwdTable); - int32_t result = (int32_t)UTEXT_GETNATIVEINDEX(fText); - while (result >= offset) { - result = previous(); - } - return result; - } - if (fData->fSafeRevTable != NULL) { - // backup plan if forward safe table is not available - // TODO: check whether this path can be discarded - // It's probably OK to say that rules must supply both safe tables - // if they use safe tables at all. We have certainly never described - // to anyone how to work with just one safe table. - utext_setNativeIndex(fText, offset); - (void)UTEXT_NEXT32(fText); - - // handle previous will give result <= offset - handlePrevious(fData->fSafeRevTable); - - // next will give result 0 or 1 boundary away from offset, - // most of the time - // we have to - int32_t oldresult = next(); - while (oldresult < offset) { - int32_t result = next(); - if (result >= offset) { - return oldresult; - } - oldresult = result; - } - int32_t result = previous(); - if (result >= offset) { - return previous(); - } - return result; - } - - // old rule syntax utext_setNativeIndex(fText, offset); - return previous(); + int32_t adjustedOffset = utext_getNativeIndex(fText); + + UErrorCode status = U_ZERO_ERROR; + fBreakCache->preceding(adjustedOffset, status); + return fDone ? UBRK_DONE : fPosition; } /** * Returns true if the specfied position is a boundary position. As a side * effect, leaves the iterator pointing to the first boundary position at * or after "offset". + * * @param offset the offset to check. * @return True if "offset" is a boundary position. */ UBool RuleBasedBreakIterator::isBoundary(int32_t offset) { - // the beginning index of the iterator is always a boundary position by definition - if (offset == 0) { - first(); // For side effects on current position, tag values. - return TRUE; - } - - if (offset == (int32_t)utext_nativeLength(fText)) { - last(); // For side effects on current position, tag values. - return TRUE; - } - // out-of-range indexes are never boundary positions if (offset < 0) { first(); // For side effects on current position, tag values. return FALSE; } - if (offset > utext_nativeLength(fText)) { - last(); // For side effects on current position, tag values. - return FALSE; + // Adjust offset to be on a code point boundary and not beyond the end of the text. + // Note that isBoundary() is always be false for offsets that are not on code point boundaries. + // But we still need the side effect of leaving iteration at the following boundary. + + utext_setNativeIndex(fText, offset); + int32_t adjustedOffset = utext_getNativeIndex(fText); + + bool result = false; + UErrorCode status = U_ZERO_ERROR; + if (fBreakCache->seek(adjustedOffset) || fBreakCache->populateNear(adjustedOffset, status)) { + result = (fBreakCache->current() == offset); } - // otherwise, we can use following() on the position before the specified - // one and return true if the position we get back is the one the user - // specified - utext_previous32From(fText, offset); - int32_t backOne = (int32_t)UTEXT_GETNATIVEINDEX(fText); - UBool result = following(backOne) == offset; + if (result && adjustedOffset < offset && utext_char32At(fText, offset) == U_SENTINEL) { + // Original offset is beyond the end of the text. Return FALSE, it's not a boundary, + // but the iteration position remains set to the end of the text, which is a boundary. + return FALSE; + } + if (!result) { + // Not on a boundary. isBoundary() must leave iterator on the following boundary. + // Cache->seek(), above, left us on the preceding boundary, so advance one. + next(); + } return result; } + /** * Returns the current iteration position. * @return The current iteration position. */ int32_t RuleBasedBreakIterator::current(void) const { - int32_t pos = (int32_t)UTEXT_GETNATIVEINDEX(fText); - return pos; + return fPosition; } + //======================================================================= // implementation //======================================================================= @@ -1020,15 +758,11 @@ struct LookAheadResults { //----------------------------------------------------------------------------------- // -// handleNext(stateTable) -// This method is the actual implementation of the rbbi next() method. -// This method initializes the state machine to state 1 -// and advances through the text character by character until we reach the end -// of the text or the state machine transitions to state 0. We update our return -// value every time the state machine passes through an accepting state. +// handleNext() +// Run the state machine to find a boundary // //----------------------------------------------------------------------------------- -int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { +int32_t RuleBasedBreakIterator::handleNext() { int32_t state; uint16_t category = 0; RBBIRunMode mode; @@ -1038,25 +772,29 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { LookAheadResults lookAheadMatches; int32_t result = 0; int32_t initialPosition = 0; + const RBBIStateTable *statetable = fData->fForwardTable; const char *tableData = statetable->fTableData; uint32_t tableRowLen = statetable->fRowLen; - #ifdef RBBI_DEBUG - if (fTrace) { + if (gTrace) { RBBIDebugPuts("Handle Next pos char state category"); } #endif - // No matter what, handleNext alway correctly sets the break tag value. - fLastStatusIndexValid = TRUE; - fLastRuleStatusIndex = 0; + // handleNext alway sets the break tag value. + // Set the default for it. + fRuleStatusIndex = 0; + + fDictionaryCharCount = 0; // if we're already at the end of the text, return DONE. - initialPosition = (int32_t)UTEXT_GETNATIVEINDEX(fText); + initialPosition = fPosition; + UTEXT_SETNATIVEINDEX(fText, initialPosition); result = initialPosition; c = UTEXT_NEXT32(fText); - if (fData == NULL || c==U_SENTINEL) { - return BreakIterator::DONE; + if (c==U_SENTINEL) { + fDone = TRUE; + return UBRK_DONE; } // Set the initial state for the state machine @@ -1100,10 +838,10 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { // Note: the 16 in UTRIE_GET16 refers to the size of the data being returned, // not the size of the character going in, which is a UChar32. // - UTRIE_GET16(&fData->fTrie, c, category); + category = UTRIE2_GET16(fData->fTrie, c); // Check the dictionary bit in the character's category. - // Counter is only used by dictionary based iterators (subclasses). + // Counter is only used by dictionary based iteration. // Chars that need to be handled by a dictionary have a flag bit set // in their category values. // @@ -1115,7 +853,7 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { } #ifdef RBBI_DEBUG - if (fTrace) { + if (gTrace) { RBBIDebugPrintf(" %4ld ", utext_getNativeIndex(fText)); if (0x20<=c && c<0x7f) { RBBIDebugPrintf("\"%c\" ", c); @@ -1144,7 +882,7 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { if (mode != RBBI_START) { result = (int32_t)UTEXT_GETNATIVEINDEX(fText); } - fLastRuleStatusIndex = row->fTagIdx; // Remember the break status (tag) values. + fRuleStatusIndex = row->fTagIdx; // Remember the break status (tag) values. } int16_t completedRule = row->fAccepting; @@ -1152,8 +890,8 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { // Lookahead match is completed. int32_t lookaheadResult = lookAheadMatches.getPosition(completedRule); if (lookaheadResult >= 0) { - fLastRuleStatusIndex = row->fTagIdx; - UTEXT_SETNATIVEINDEX(fText, lookaheadResult); + fRuleStatusIndex = row->fTagIdx; + fPosition = lookaheadResult; return lookaheadResult; } } @@ -1182,8 +920,6 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { mode = RBBI_RUN; } } - - } // The state machine is done. Check whether it found a match... @@ -1192,15 +928,16 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { // (This really indicates a defect in the break rules. They should always match // at least one character.) if (result == initialPosition) { - UTEXT_SETNATIVEINDEX(fText, initialPosition); - UTEXT_NEXT32(fText); - result = (int32_t)UTEXT_GETNATIVEINDEX(fText); + utext_setNativeIndex(fText, initialPosition); + utext_next32(fText); + result = (int32_t)utext_getNativeIndex(fText); + fRuleStatusIndex = 0; } // Leave the iterator at our result position. - UTEXT_SETNATIVEINDEX(fText, result); + fPosition = result; #ifdef RBBI_DEBUG - if (fTrace) { + if (gTrace) { RBBIDebugPrintf("result = %d\n\n", result); } #endif @@ -1213,13 +950,11 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { // // handlePrevious() // -// Iterate backwards, according to the logic of the reverse rules. -// This version handles the exact style backwards rules. -// +// Iterate backwards using the safe reverse rules. // The logic of this function is very similar to handleNext(), above. // //----------------------------------------------------------------------------------- -int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) { +int32_t RuleBasedBreakIterator::handlePrevious(int32_t fromPosition) { int32_t state; uint16_t category = 0; RBBIRunMode mode; @@ -1229,19 +964,14 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) int32_t result = 0; int32_t initialPosition = 0; + const RBBIStateTable *stateTable = fData->fSafeRevTable; + UTEXT_SETNATIVEINDEX(fText, fromPosition); #ifdef RBBI_DEBUG - if (fTrace) { + if (gTrace) { RBBIDebugPuts("Handle Previous pos char state category"); } #endif - // handlePrevious() never gets the rule status. - // Flag the status as invalid; if the user ever asks for status, we will need - // to back up, then re-find the break position using handleNext(), which does - // get the status value. - fLastStatusIndexValid = FALSE; - fLastRuleStatusIndex = 0; - // if we're already at the start of the text, return DONE. if (fText == NULL || fData == NULL || UTEXT_GETNATIVEINDEX(fText)==0) { return BreakIterator::DONE; @@ -1255,10 +985,10 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) // Set the initial state for the state machine state = START_STATE; row = (RBBIStateTableRow *) - (statetable->fTableData + (statetable->fRowLen * state)); + (stateTable->fTableData + (stateTable->fRowLen * state)); category = 3; mode = RBBI_RUN; - if (statetable->fFlags & RBBI_BOF_REQUIRED) { + if (stateTable->fFlags & RBBI_BOF_REQUIRED) { category = 2; mode = RBBI_START; } @@ -1273,12 +1003,6 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) // We have already run the loop one last time with the // character set to the psueudo {eof} value. Now it is time // to unconditionally bail out. - if (result == initialPosition) { - // Ran off start, no match found. - // move one index one (towards the start, since we are doing a previous()) - UTEXT_SETNATIVEINDEX(fText, initialPosition); - (void)UTEXT_PREVIOUS32(fText); // TODO: shouldn't be necessary. We're already at beginning. Check. - } break; } // Run the loop one last time with the fake end-of-input character category. @@ -1297,22 +1021,13 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) // Note: the 16 in UTRIE_GET16 refers to the size of the data being returned, // not the size of the character going in, which is a UChar32. // - UTRIE_GET16(&fData->fTrie, c, category); - - // Check the dictionary bit in the character's category. - // Counter is only used by dictionary based iterators (subclasses). - // Chars that need to be handled by a dictionary have a flag bit set - // in their category values. - // - if ((category & 0x4000) != 0) { - fDictionaryCharCount++; - // And off the dictionary flag bit. - category &= ~0x4000; - } + // And off the dictionary flag bit. For reverse iteration it is not used. + category = UTRIE2_GET16(fData->fTrie, c); + category &= ~0x4000; } #ifdef RBBI_DEBUG - if (fTrace) { + if (gTrace) { RBBIDebugPrintf(" %4d ", (int32_t)utext_getNativeIndex(fText)); if (0x20<=c && c<0x7f) { RBBIDebugPrintf("\"%c\" ", c); @@ -1332,7 +1047,7 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) U_ASSERT(categoryfHeader->fCatCount); state = row->fNextState[category]; /*Not accessing beyond memory*/ row = (RBBIStateTableRow *) - (statetable->fTableData + (statetable->fRowLen * state)); + (stateTable->fTableData + (stateTable->fRowLen * state)); if (row->fAccepting == -1) { // Match found, common case. @@ -1386,10 +1101,8 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) result = (int32_t)UTEXT_GETNATIVEINDEX(fText); } - // Leave the iterator at our result position. - UTEXT_SETNATIVEINDEX(fText, result); #ifdef RBBI_DEBUG - if (fTrace) { + if (gTrace) { RBBIDebugPrintf("result = %d\n\n", result); } #endif @@ -1397,20 +1110,6 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) } -void -RuleBasedBreakIterator::reset() -{ - if (fCachedBreakPositions) { - uprv_free(fCachedBreakPositions); - } - fCachedBreakPositions = NULL; - fNumCachedBreakPositions = 0; - fDictionaryCharCount = 0; - fPositionInCache = 0; -} - - - //------------------------------------------------------------------------------- // // getRuleStatus() Return the break rule tag associated with the current @@ -1418,64 +1117,27 @@ RuleBasedBreakIterator::reset() // position by iterating forwards, the value will have been // cached by the handleNext() function. // -// If no cached status value is available, the status is -// found by doing a previous() followed by a next(), which -// leaves the iterator where it started, and computes the -// status while doing the next(). -// //------------------------------------------------------------------------------- -void RuleBasedBreakIterator::makeRuleStatusValid() { - if (fLastStatusIndexValid == FALSE) { - // No cached status is available. - if (fText == NULL || current() == 0) { - // At start of text, or there is no text. Status is always zero. - fLastRuleStatusIndex = 0; - fLastStatusIndexValid = TRUE; - } else { - // Not at start of text. Find status the tedious way. - int32_t pa = current(); - previous(); - if (fNumCachedBreakPositions > 0) { - reset(); // Blow off the dictionary cache - } - int32_t pb = next(); - if (pa != pb) { - // note: the if (pa != pb) test is here only to eliminate warnings for - // unused local variables on gcc. Logically, it isn't needed. - U_ASSERT(pa == pb); - } - } - } - U_ASSERT(fLastRuleStatusIndex >= 0 && fLastRuleStatusIndex < fData->fStatusMaxIdx); -} - int32_t RuleBasedBreakIterator::getRuleStatus() const { - RuleBasedBreakIterator *nonConstThis = (RuleBasedBreakIterator *)this; - nonConstThis->makeRuleStatusValid(); // fLastRuleStatusIndex indexes to the start of the appropriate status record // (the number of status values.) // This function returns the last (largest) of the array of status values. - int32_t idx = fLastRuleStatusIndex + fData->fRuleStatusTable[fLastRuleStatusIndex]; + int32_t idx = fRuleStatusIndex + fData->fRuleStatusTable[fRuleStatusIndex]; int32_t tagVal = fData->fRuleStatusTable[idx]; return tagVal; } - - int32_t RuleBasedBreakIterator::getRuleStatusVec( - int32_t *fillInVec, int32_t capacity, UErrorCode &status) -{ + int32_t *fillInVec, int32_t capacity, UErrorCode &status) { if (U_FAILURE(status)) { return 0; } - RuleBasedBreakIterator *nonConstThis = (RuleBasedBreakIterator *)this; - nonConstThis->makeRuleStatusValid(); - int32_t numVals = fData->fRuleStatusTable[fLastRuleStatusIndex]; + int32_t numVals = fData->fRuleStatusTable[fRuleStatusIndex]; int32_t numValsToCopy = numVals; if (numVals > capacity) { status = U_BUFFER_OVERFLOW_ERROR; @@ -1483,7 +1145,7 @@ int32_t RuleBasedBreakIterator::getRuleStatusVec( } int i; for (i=0; ifRuleStatusTable[fLastRuleStatusIndex + i + 1]; + fillInVec[i] = fData->fRuleStatusTable[fRuleStatusIndex + i + 1]; } return numVals; } @@ -1531,205 +1193,25 @@ BreakIterator * RuleBasedBreakIterator::createBufferClone(void * /*stackBuffer* return (RuleBasedBreakIterator *)clonedBI; } - -//------------------------------------------------------------------------------- -// -// isDictionaryChar Return true if the category lookup for this char -// indicates that it is in the set of dictionary lookup -// chars. -// -// This function is intended for use by dictionary based -// break iterators. -// -//------------------------------------------------------------------------------- -/*UBool RuleBasedBreakIterator::isDictionaryChar(UChar32 c) { - if (fData == NULL) { - return FALSE; - } - uint16_t category; - UTRIE_GET16(&fData->fTrie, c, category); - return (category & 0x4000) != 0; -}*/ - - -//------------------------------------------------------------------------------- -// -// checkDictionary This function handles all processing of characters in -// the "dictionary" set. It will determine the appropriate -// course of action, and possibly set up a cache in the -// process. -// -//------------------------------------------------------------------------------- -int32_t RuleBasedBreakIterator::checkDictionary(int32_t startPos, - int32_t endPos, - UBool reverse) { - // Reset the old break cache first. - reset(); - - // note: code segment below assumes that dictionary chars are in the - // startPos-endPos range - // value returned should be next character in sequence - if ((endPos - startPos) <= 1) { - return (reverse ? startPos : endPos); - } - - // Starting from the starting point, scan towards the proposed result, - // looking for the first dictionary character (which may be the one - // we're on, if we're starting in the middle of a range). - utext_setNativeIndex(fText, reverse ? endPos : startPos); - if (reverse) { - UTEXT_PREVIOUS32(fText); - } - - int32_t rangeStart = startPos; - int32_t rangeEnd = endPos; - - uint16_t category; - int32_t current; - UErrorCode status = U_ZERO_ERROR; - UStack breaks(status); - int32_t foundBreakCount = 0; - UChar32 c = utext_current32(fText); - - UTRIE_GET16(&fData->fTrie, c, category); - - // Is the character we're starting on a dictionary character? If so, we - // need to back up to include the entire run; otherwise the results of - // the break algorithm will differ depending on where we start. Since - // the result is cached and there is typically a non-dictionary break - // within a small number of words, there should be little performance impact. - if (category & 0x4000) { - if (reverse) { - do { - utext_next32(fText); // TODO: recast to work directly with postincrement. - c = utext_current32(fText); - UTRIE_GET16(&fData->fTrie, c, category); - } while (c != U_SENTINEL && (category & 0x4000)); - // Back up to the last dictionary character - rangeEnd = (int32_t)UTEXT_GETNATIVEINDEX(fText); - if (c == U_SENTINEL) { - // c = fText->last32(); - // TODO: why was this if needed? - c = UTEXT_PREVIOUS32(fText); - } - else { - c = UTEXT_PREVIOUS32(fText); - } - } - else { - do { - c = UTEXT_PREVIOUS32(fText); - UTRIE_GET16(&fData->fTrie, c, category); - } - while (c != U_SENTINEL && (category & 0x4000)); - // Back up to the last dictionary character - if (c == U_SENTINEL) { - // c = fText->first32(); - c = utext_current32(fText); - } - else { - utext_next32(fText); - c = utext_current32(fText); - } - rangeStart = (int32_t)UTEXT_GETNATIVEINDEX(fText);; - } - UTRIE_GET16(&fData->fTrie, c, category); - } - - // Loop through the text, looking for ranges of dictionary characters. - // For each span, find the appropriate break engine, and ask it to find - // any breaks within the span. - // Note: we always do this in the forward direction, so that the break - // cache is built in the right order. - if (reverse) { - utext_setNativeIndex(fText, rangeStart); - c = utext_current32(fText); - UTRIE_GET16(&fData->fTrie, c, category); - } - while(U_SUCCESS(status)) { - while((current = (int32_t)UTEXT_GETNATIVEINDEX(fText)) < rangeEnd && (category & 0x4000) == 0) { - utext_next32(fText); // TODO: tweak for post-increment operation - c = utext_current32(fText); - UTRIE_GET16(&fData->fTrie, c, category); - } - if (current >= rangeEnd) { - break; - } - - // We now have a dictionary character. Get the appropriate language object - // to deal with it. - const LanguageBreakEngine *lbe = getLanguageBreakEngine(c); - - // Ask the language object if there are any breaks. It will leave the text - // pointer on the other side of its range, ready to search for the next one. - if (lbe != NULL) { - foundBreakCount += lbe->findBreaks(fText, rangeStart, rangeEnd, FALSE, fBreakType, breaks); - } - - // Reload the loop variables for the next go-round - c = utext_current32(fText); - UTRIE_GET16(&fData->fTrie, c, category); - } - - // If we found breaks, build a new break cache. The first and last entries must - // be the original starting and ending position. - if (foundBreakCount > 0) { - U_ASSERT(foundBreakCount == breaks.size()); - int32_t totalBreaks = foundBreakCount; - if (startPos < breaks.elementAti(0)) { - totalBreaks += 1; - } - if (endPos > breaks.peeki()) { - totalBreaks += 1; - } - fCachedBreakPositions = (int32_t *)uprv_malloc(totalBreaks * sizeof(int32_t)); - if (fCachedBreakPositions != NULL) { - int32_t out = 0; - fNumCachedBreakPositions = totalBreaks; - if (startPos < breaks.elementAti(0)) { - fCachedBreakPositions[out++] = startPos; - } - for (int32_t i = 0; i < foundBreakCount; ++i) { - fCachedBreakPositions[out++] = breaks.elementAti(i); - } - if (endPos > fCachedBreakPositions[out-1]) { - fCachedBreakPositions[out] = endPos; - } - // If there are breaks, then by definition, we are replacing the original - // proposed break by one of the breaks we found. Use following() and - // preceding() to do the work. They should never recurse in this case. - if (reverse) { - return preceding(endPos); - } - else { - return following(startPos); - } - } - // If the allocation failed, just fall through to the "no breaks found" case. - } - - // If we get here, there were no language-based breaks. Set the text pointer - // to the original proposed break. - utext_setNativeIndex(fText, reverse ? startPos : endPos); - return (reverse ? startPos : endPos); -} - U_NAMESPACE_END -static icu::UStack *gLanguageBreakFactories = NULL; +static icu::UStack *gLanguageBreakFactories = nullptr; +static const icu::UnicodeString *gEmptyString = nullptr; static icu::UInitOnce gLanguageBreakFactoriesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gRBBIInitOnce = U_INITONCE_INITIALIZER; /** * Release all static memory held by breakiterator. */ U_CDECL_BEGIN -static UBool U_CALLCONV breakiterator_cleanup_dict(void) { - if (gLanguageBreakFactories) { - delete gLanguageBreakFactories; - gLanguageBreakFactories = NULL; - } +static UBool U_CALLCONV rbbi_cleanup(void) { + delete gLanguageBreakFactories; + gLanguageBreakFactories = nullptr; + delete gEmptyString; + gEmptyString = nullptr; gLanguageBreakFactoriesInitOnce.reset(); + gRBBIInitOnce.reset(); return TRUE; } U_CDECL_END @@ -1741,6 +1223,11 @@ static void U_CALLCONV _deleteFactory(void *obj) { U_CDECL_END U_NAMESPACE_BEGIN +static void U_CALLCONV rbbiInit() { + gEmptyString = new UnicodeString(); + ucln_common_registerCleanup(UCLN_COMMON_RBBI, rbbi_cleanup); +} + static void U_CALLCONV initLanguageFactories() { UErrorCode status = U_ZERO_ERROR; U_ASSERT(gLanguageBreakFactories == NULL); @@ -1755,7 +1242,7 @@ static void U_CALLCONV initLanguageFactories() { } #endif } - ucln_common_registerCleanup(UCLN_COMMON_BREAKITERATOR_DICT, breakiterator_cleanup_dict); + ucln_common_registerCleanup(UCLN_COMMON_RBBI, rbbi_cleanup); } @@ -1853,7 +1340,24 @@ RuleBasedBreakIterator::getLanguageBreakEngine(UChar32 c) { void RuleBasedBreakIterator::setBreakType(int32_t type) { fBreakType = type; - reset(); +} + +void RuleBasedBreakIterator::dumpCache() { + fBreakCache->dumpCache(); +} + +/** + * Returns the description used to create this iterator + */ + +const UnicodeString& +RuleBasedBreakIterator::getRules() const { + if (fData != NULL) { + return fData->getRuleSourceString(); + } else { + umtx_initOnce(gRBBIInitOnce, &rbbiInit); + return *gEmptyString; + } } U_NAMESPACE_END diff --git a/deps/icu-small/source/common/rbbi_cache.cpp b/deps/icu-small/source/common/rbbi_cache.cpp new file mode 100644 index 00000000000000..9d716bb34274c4 --- /dev/null +++ b/deps/icu-small/source/common/rbbi_cache.cpp @@ -0,0 +1,630 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// file: rbbi_cache.cpp + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_BREAK_ITERATION + +#include "unicode/ubrk.h" +#include "unicode/rbbi.h" + +#include "rbbi_cache.h" + +#include "brkeng.h" +#include "cmemory.h" +#include "rbbidata.h" +#include "rbbirb.h" +#include "uassert.h" +#include "uvectr32.h" + +U_NAMESPACE_BEGIN + +/* + * DictionaryCache implementation + */ + +RuleBasedBreakIterator::DictionaryCache::DictionaryCache(RuleBasedBreakIterator *bi, UErrorCode &status) : + fBI(bi), fBreaks(NULL), fPositionInCache(-1), + fStart(0), fLimit(0), fFirstRuleStatusIndex(0), fOtherRuleStatusIndex(0) { + fBreaks = new UVector32(status); +} + +RuleBasedBreakIterator::DictionaryCache::~DictionaryCache() { + delete fBreaks; + fBreaks = NULL; +} + +void RuleBasedBreakIterator::DictionaryCache::reset() { + fPositionInCache = -1; + fStart = 0; + fLimit = 0; + fFirstRuleStatusIndex = 0; + fOtherRuleStatusIndex = 0; + fBreaks->removeAllElements(); +} + +UBool RuleBasedBreakIterator::DictionaryCache::following(int32_t fromPos, int32_t *result, int32_t *statusIndex) { + if (fromPos >= fLimit || fromPos < fStart) { + fPositionInCache = -1; + return FALSE; + } + + // Sequential iteration, move from previous boundary to the following + + int32_t r = 0; + if (fPositionInCache >= 0 && fPositionInCache < fBreaks->size() && fBreaks->elementAti(fPositionInCache) == fromPos) { + ++fPositionInCache; + if (fPositionInCache >= fBreaks->size()) { + fPositionInCache = -1; + return FALSE; + } + r = fBreaks->elementAti(fPositionInCache); + U_ASSERT(r > fromPos); + *result = r; + *statusIndex = fOtherRuleStatusIndex; + return TRUE; + } + + // Random indexing. Linear search for the boundary following the given position. + + for (fPositionInCache = 0; fPositionInCache < fBreaks->size(); ++fPositionInCache) { + r= fBreaks->elementAti(fPositionInCache); + if (r > fromPos) { + *result = r; + *statusIndex = fOtherRuleStatusIndex; + return TRUE; + } + } + U_ASSERT(FALSE); + fPositionInCache = -1; + return FALSE; +} + + +UBool RuleBasedBreakIterator::DictionaryCache::preceding(int32_t fromPos, int32_t *result, int32_t *statusIndex) { + if (fromPos <= fStart || fromPos > fLimit) { + fPositionInCache = -1; + return FALSE; + } + + if (fromPos == fLimit) { + fPositionInCache = fBreaks->size() - 1; + if (fPositionInCache >= 0) { + U_ASSERT(fBreaks->elementAti(fPositionInCache) == fromPos); + } + } + + int32_t r; + if (fPositionInCache > 0 && fPositionInCache < fBreaks->size() && fBreaks->elementAti(fPositionInCache) == fromPos) { + --fPositionInCache; + r = fBreaks->elementAti(fPositionInCache); + U_ASSERT(r < fromPos); + *result = r; + *statusIndex = ( r== fStart) ? fFirstRuleStatusIndex : fOtherRuleStatusIndex; + return TRUE; + } + + if (fPositionInCache == 0) { + fPositionInCache = -1; + return FALSE; + } + + for (fPositionInCache = fBreaks->size()-1; fPositionInCache >= 0; --fPositionInCache) { + r = fBreaks->elementAti(fPositionInCache); + if (r < fromPos) { + *result = r; + *statusIndex = ( r == fStart) ? fFirstRuleStatusIndex : fOtherRuleStatusIndex; + return TRUE; + } + } + U_ASSERT(FALSE); + fPositionInCache = -1; + return FALSE; +} + +void RuleBasedBreakIterator::DictionaryCache::populateDictionary(int32_t startPos, int32_t endPos, + int32_t firstRuleStatus, int32_t otherRuleStatus) { + if ((endPos - startPos) <= 1) { + return; + } + + reset(); + fFirstRuleStatusIndex = firstRuleStatus; + fOtherRuleStatusIndex = otherRuleStatus; + + int32_t rangeStart = startPos; + int32_t rangeEnd = endPos; + + uint16_t category; + int32_t current; + UErrorCode status = U_ZERO_ERROR; + int32_t foundBreakCount = 0; + UText *text = fBI->fText; + + // Loop through the text, looking for ranges of dictionary characters. + // For each span, find the appropriate break engine, and ask it to find + // any breaks within the span. + + utext_setNativeIndex(text, rangeStart); + UChar32 c = utext_current32(text); + category = UTRIE2_GET16(fBI->fData->fTrie, c); + + while(U_SUCCESS(status)) { + while((current = (int32_t)UTEXT_GETNATIVEINDEX(text)) < rangeEnd && (category & 0x4000) == 0) { + utext_next32(text); // TODO: cleaner loop structure. + c = utext_current32(text); + category = UTRIE2_GET16(fBI->fData->fTrie, c); + } + if (current >= rangeEnd) { + break; + } + + // We now have a dictionary character. Get the appropriate language object + // to deal with it. + const LanguageBreakEngine *lbe = fBI->getLanguageBreakEngine(c); + + // Ask the language object if there are any breaks. It will add them to the cache and + // leave the text pointer on the other side of its range, ready to search for the next one. + if (lbe != NULL) { + foundBreakCount += lbe->findBreaks(text, rangeStart, rangeEnd, fBI->fBreakType, *fBreaks); + } + + // Reload the loop variables for the next go-round + c = utext_current32(text); + category = UTRIE2_GET16(fBI->fData->fTrie, c); + } + + // If we found breaks, ensure that the first and last entries are + // the original starting and ending position. And initialize the + // cache iteration position to the first entry. + + // printf("foundBreakCount = %d\n", foundBreakCount); + if (foundBreakCount > 0) { + U_ASSERT(foundBreakCount == fBreaks->size()); + if (startPos < fBreaks->elementAti(0)) { + // The dictionary did not place a boundary at the start of the segment of text. + // Add one now. This should not commonly happen, but it would be easy for interactions + // of the rules for dictionary segments and the break engine implementations to + // inadvertently cause it. Cover it here, just in case. + fBreaks->insertElementAt(startPos, 0, status); + } + if (endPos > fBreaks->peeki()) { + fBreaks->push(endPos, status); + } + fPositionInCache = 0; + // Note: Dictionary matching may extend beyond the original limit. + fStart = fBreaks->elementAti(0); + fLimit = fBreaks->peeki(); + } else { + // there were no language-based breaks, even though the segment contained + // dictionary characters. Subsequent attempts to fetch boundaries from the dictionary cache + // for this range will fail, and the calling code will fall back to the rule based boundaries. + } +} + + +/* + * BreakCache implemetation + */ + +RuleBasedBreakIterator::BreakCache::BreakCache(RuleBasedBreakIterator *bi, UErrorCode &status) : + fBI(bi), fSideBuffer(status) { + reset(); +} + + +RuleBasedBreakIterator::BreakCache::~BreakCache() { +} + + +void RuleBasedBreakIterator::BreakCache::reset(int32_t pos, int32_t ruleStatus) { + fStartBufIdx = 0; + fEndBufIdx = 0; + fTextIdx = pos; + fBufIdx = 0; + fBoundaries[0] = pos; + fStatuses[0] = (uint16_t)ruleStatus; +} + + +int32_t RuleBasedBreakIterator::BreakCache::current() { + fBI->fPosition = fTextIdx; + fBI->fRuleStatusIndex = fStatuses[fBufIdx]; + fBI->fDone = FALSE; + return fTextIdx; +} + + +void RuleBasedBreakIterator::BreakCache::following(int32_t startPos, UErrorCode &status) { + if (U_FAILURE(status)) { + return; + } + if (startPos == fTextIdx || seek(startPos) || populateNear(startPos, status)) { + // startPos is in the cache. Do a next() from that position. + // TODO: an awkward set of interactions with bi->fDone + // seek() does not clear it; it can't because of interactions with populateNear(). + // next() does not clear it in the fast-path case, where everything matters. Maybe it should. + // So clear it here, for the case where seek() succeeded on an iterator that had previously run off the end. + fBI->fDone = false; + next(); + } + return; +} + + +void RuleBasedBreakIterator::BreakCache::preceding(int32_t startPos, UErrorCode &status) { + if (U_FAILURE(status)) { + return; + } + if (startPos == fTextIdx || seek(startPos) || populateNear(startPos, status)) { + if (startPos == fTextIdx) { + previous(status); + } else { + // seek() leaves the BreakCache positioned at the preceding boundary + // if the requested position is between two bounaries. + // current() pushes the BreakCache position out to the BreakIterator itself. + U_ASSERT(startPos > fTextIdx); + current(); + } + } + return; +} + + +/* + * Out-of-line code for BreakCache::next(). + * Cache does not already contain the boundary + */ +void RuleBasedBreakIterator::BreakCache::nextOL() { + fBI->fDone = !populateFollowing(); + fBI->fPosition = fTextIdx; + fBI->fRuleStatusIndex = fStatuses[fBufIdx]; + return; +} + + +void RuleBasedBreakIterator::BreakCache::previous(UErrorCode &status) { + if (U_FAILURE(status)) { + return; + } + int32_t initialBufIdx = fBufIdx; + if (fBufIdx == fStartBufIdx) { + // At start of cache. Prepend to it. + populatePreceding(status); + } else { + // Cache already holds the next boundary + fBufIdx = modChunkSize(fBufIdx - 1); + fTextIdx = fBoundaries[fBufIdx]; + } + fBI->fDone = (fBufIdx == initialBufIdx); + fBI->fPosition = fTextIdx; + fBI->fRuleStatusIndex = fStatuses[fBufIdx]; + return; +} + + +UBool RuleBasedBreakIterator::BreakCache::seek(int32_t pos) { + if (pos < fBoundaries[fStartBufIdx] || pos > fBoundaries[fEndBufIdx]) { + return FALSE; + } + if (pos == fBoundaries[fStartBufIdx]) { + // Common case: seek(0), from BreakIterator::first() + fBufIdx = fStartBufIdx; + fTextIdx = fBoundaries[fBufIdx]; + return TRUE; + } + if (pos == fBoundaries[fEndBufIdx]) { + fBufIdx = fEndBufIdx; + fTextIdx = fBoundaries[fBufIdx]; + return TRUE; + } + + int32_t min = fStartBufIdx; + int32_t max = fEndBufIdx; + while (min != max) { + int32_t probe = (min + max + (min>max ? CACHE_SIZE : 0)) / 2; + probe = modChunkSize(probe); + if (fBoundaries[probe] > pos) { + max = probe; + } else { + min = modChunkSize(probe + 1); + } + } + U_ASSERT(fBoundaries[max] > pos); + fBufIdx = modChunkSize(max - 1); + fTextIdx = fBoundaries[fBufIdx]; + U_ASSERT(fTextIdx <= pos); + return TRUE; +} + + +UBool RuleBasedBreakIterator::BreakCache::populateNear(int32_t position, UErrorCode &status) { + if (U_FAILURE(status)) { + return FALSE; + } + U_ASSERT(position < fBoundaries[fStartBufIdx] || position > fBoundaries[fEndBufIdx]); + + // Find a boundary somewhere in the vicinity of the requested position. + // Depending on the safe rules and the text data, it could be either before, at, or after + // the requested position. + + + // If the requested position is not near already cached positions, clear the existing cache, + // find a near-by boundary and begin new cache contents there. + + if ((position < fBoundaries[fStartBufIdx] - 15) || position > (fBoundaries[fEndBufIdx] + 15)) { + int32_t aBoundary = 0; + int32_t ruleStatusIndex = 0; + // TODO: check for position == length of text. Although may still need to back up to get rule status. + if (position > 20) { + int32_t backupPos = fBI->handlePrevious(position); + fBI->fPosition = backupPos; + aBoundary = fBI->handleNext(); // Ignore dictionary, just finding a rule based boundary. + ruleStatusIndex = fBI->fRuleStatusIndex; + } + reset(aBoundary, ruleStatusIndex); // Reset cache to hold aBoundary as a single starting point. + } + + // Fill in boundaries between existing cache content and the new requested position. + + if (fBoundaries[fEndBufIdx] < position) { + // The last position in the cache precedes the requested position. + // Add following position(s) to the cache. + while (fBoundaries[fEndBufIdx] < position) { + if (!populateFollowing()) { + U_ASSERT(false); + return false; + } + } + fBufIdx = fEndBufIdx; // Set iterator position to the end of the buffer. + fTextIdx = fBoundaries[fBufIdx]; // Required because populateFollowing may add extra boundaries. + while (fTextIdx > position) { // Move backwards to a position at or preceding the requested pos. + previous(status); + } + return true; + } + + if (fBoundaries[fStartBufIdx] > position) { + // The first position in the cache is beyond the requested position. + // back up more until we get a boundary <= the requested position. + while (fBoundaries[fStartBufIdx] > position) { + populatePreceding(status); + } + fBufIdx = fStartBufIdx; // Set iterator position to the start of the buffer. + fTextIdx = fBoundaries[fBufIdx]; // Required because populatePreceding may add extra boundaries. + while (fTextIdx < position) { // Move forwards to a position at or following the requested pos. + next(); + } + if (fTextIdx > position) { + // If position is not itself a boundary, the next() loop above will overshoot. + // Back up one, leaving cache position at the boundary preceding the requested position. + previous(status); + } + return true; + } + + U_ASSERT(fTextIdx == position); + return true; +} + + + +UBool RuleBasedBreakIterator::BreakCache::populateFollowing() { + int32_t fromPosition = fBoundaries[fEndBufIdx]; + int32_t fromRuleStatusIdx = fStatuses[fEndBufIdx]; + int32_t pos = 0; + int32_t ruleStatusIdx = 0; + + if (fBI->fDictionaryCache->following(fromPosition, &pos, &ruleStatusIdx)) { + addFollowing(pos, ruleStatusIdx, UpdateCachePosition); + return TRUE; + } + + fBI->fPosition = fromPosition; + pos = fBI->handleNext(); + if (pos == UBRK_DONE) { + return FALSE; + } + + ruleStatusIdx = fBI->fRuleStatusIndex; + if (fBI->fDictionaryCharCount > 0) { + // The text segment obtained from the rules includes dictionary characters. + // Subdivide it, with subdivided results going into the dictionary cache. + fBI->fDictionaryCache->populateDictionary(fromPosition, pos, fromRuleStatusIdx, ruleStatusIdx); + if (fBI->fDictionaryCache->following(fromPosition, &pos, &ruleStatusIdx)) { + addFollowing(pos, ruleStatusIdx, UpdateCachePosition); + return TRUE; + // TODO: may want to move a sizable chunk of dictionary cache to break cache at this point. + // But be careful with interactions with populateNear(). + } + } + + // Rule based segment did not include dictionary characters. + // Or, it did contain dictionary chars, but the dictionary segmenter didn't handle them, + // meaning that we didn't take the return, above. + // Add its end point to the cache. + addFollowing(pos, ruleStatusIdx, UpdateCachePosition); + + // Add several non-dictionary boundaries at this point, to optimize straight forward iteration. + // (subsequent calls to BreakIterator::next() will take the fast path, getting cached results. + // + for (int count=0; count<6; ++count) { + pos = fBI->handleNext(); + if (pos == UBRK_DONE || fBI->fDictionaryCharCount > 0) { + break; + } + addFollowing(pos, fBI->fRuleStatusIndex, RetainCachePosition); + } + + return TRUE; +} + + +UBool RuleBasedBreakIterator::BreakCache::populatePreceding(UErrorCode &status) { + if (U_FAILURE(status)) { + return FALSE; + } + + int32_t fromPosition = fBoundaries[fStartBufIdx]; + if (fromPosition == 0) { + return FALSE; + } + + int32_t position = 0; + int32_t positionStatusIdx = 0; + + if (fBI->fDictionaryCache->preceding(fromPosition, &position, &positionStatusIdx)) { + addPreceding(position, positionStatusIdx, UpdateCachePosition); + return TRUE; + } + + int32_t backupPosition = fromPosition; + + // Find a boundary somewhere preceding the first already-cached boundary + do { + backupPosition = backupPosition - 30; + if (backupPosition <= 0) { + backupPosition = 0; + } else { + backupPosition = fBI->handlePrevious(backupPosition); + } + if (backupPosition == UBRK_DONE || backupPosition == 0) { + position = 0; + positionStatusIdx = 0; + } else { + fBI->fPosition = backupPosition; // TODO: pass starting position in a clearer way. + position = fBI->handleNext(); + positionStatusIdx = fBI->fRuleStatusIndex; + + } + } while (position >= fromPosition); + + // Find boundaries between the one we just located and the first already-cached boundary + // Put them in a side buffer, because we don't yet know where they will fall in the circular cache buffer.. + + fSideBuffer.removeAllElements(); + fSideBuffer.addElement(position, status); + fSideBuffer.addElement(positionStatusIdx, status); + + do { + int32_t prevPosition = fBI->fPosition = position; + int32_t prevStatusIdx = positionStatusIdx; + position = fBI->handleNext(); + positionStatusIdx = fBI->fRuleStatusIndex; + if (position == UBRK_DONE) { + break; + } + + UBool segmentHandledByDictionary = FALSE; + if (fBI->fDictionaryCharCount != 0) { + // Segment from the rules includes dictionary characters. + // Subdivide it, with subdivided results going into the dictionary cache. + int32_t dictSegEndPosition = position; + fBI->fDictionaryCache->populateDictionary(prevPosition, dictSegEndPosition, prevStatusIdx, positionStatusIdx); + while (fBI->fDictionaryCache->following(prevPosition, &position, &positionStatusIdx)) { + segmentHandledByDictionary = true; + U_ASSERT(position > prevPosition); + if (position >= fromPosition) { + break; + } + U_ASSERT(position <= dictSegEndPosition); + fSideBuffer.addElement(position, status); + fSideBuffer.addElement(positionStatusIdx, status); + prevPosition = position; + } + U_ASSERT(position==dictSegEndPosition || position>=fromPosition); + } + + if (!segmentHandledByDictionary && position < fromPosition) { + fSideBuffer.addElement(position, status); + fSideBuffer.addElement(positionStatusIdx, status); + } + } while (position < fromPosition); + + // Move boundaries from the side buffer to the main circular buffer. + UBool success = FALSE; + if (!fSideBuffer.isEmpty()) { + positionStatusIdx = fSideBuffer.popi(); + position = fSideBuffer.popi(); + addPreceding(position, positionStatusIdx, UpdateCachePosition); + success = TRUE; + } + + while (!fSideBuffer.isEmpty()) { + positionStatusIdx = fSideBuffer.popi(); + position = fSideBuffer.popi(); + if (!addPreceding(position, positionStatusIdx, RetainCachePosition)) { + // No space in circular buffer to hold a new preceding result while + // also retaining the current cache (iteration) position. + // Bailing out is safe; the cache will refill again if needed. + break; + } + } + + return success; +} + + +void RuleBasedBreakIterator::BreakCache::addFollowing(int32_t position, int32_t ruleStatusIdx, UpdatePositionValues update) { + U_ASSERT(position > fBoundaries[fEndBufIdx]); + U_ASSERT(ruleStatusIdx <= UINT16_MAX); + int32_t nextIdx = modChunkSize(fEndBufIdx + 1); + if (nextIdx == fStartBufIdx) { + fStartBufIdx = modChunkSize(fStartBufIdx + 6); // TODO: experiment. Probably revert to 1. + } + fBoundaries[nextIdx] = position; + fStatuses[nextIdx] = ruleStatusIdx; + fEndBufIdx = nextIdx; + if (update == UpdateCachePosition) { + // Set current position to the newly added boundary. + fBufIdx = nextIdx; + fTextIdx = position; + } else { + // Retaining the original cache position. + // Check if the added boundary wraps around the buffer, and would over-write the original position. + // It's the responsibility of callers of this function to not add too many. + U_ASSERT(nextIdx != fBufIdx); + } +} + +bool RuleBasedBreakIterator::BreakCache::addPreceding(int32_t position, int32_t ruleStatusIdx, UpdatePositionValues update) { + U_ASSERT(position < fBoundaries[fStartBufIdx]); + U_ASSERT(ruleStatusIdx <= UINT16_MAX); + int32_t nextIdx = modChunkSize(fStartBufIdx - 1); + if (nextIdx == fEndBufIdx) { + if (fBufIdx == fEndBufIdx && update == RetainCachePosition) { + // Failure. The insertion of the new boundary would claim the buffer position that is the + // current iteration position. And we also want to retain the current iteration position. + // (The buffer is already completely full of entries that precede the iteration position.) + return false; + } + fEndBufIdx = modChunkSize(fEndBufIdx - 1); + } + fBoundaries[nextIdx] = position; + fStatuses[nextIdx] = ruleStatusIdx; + fStartBufIdx = nextIdx; + if (update == UpdateCachePosition) { + fBufIdx = nextIdx; + fTextIdx = position; + } + return true; +} + + +void RuleBasedBreakIterator::BreakCache::dumpCache() { +#ifdef RBBI_DEBUG + RBBIDebugPrintf("fTextIdx:%d fBufIdx:%d\n", fTextIdx, fBufIdx); + for (int32_t i=fStartBufIdx; ; i=modChunkSize(i+1)) { + RBBIDebugPrintf("%d %d\n", i, fBoundaries[i]); + if (i == fEndBufIdx) { + break; + } + } +#endif +} + +U_NAMESPACE_END + +#endif // #if !UCONFIG_NO_BREAK_ITERATION diff --git a/deps/icu-small/source/common/rbbi_cache.h b/deps/icu-small/source/common/rbbi_cache.h new file mode 100644 index 00000000000000..8dc7320db90a9e --- /dev/null +++ b/deps/icu-small/source/common/rbbi_cache.h @@ -0,0 +1,203 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// file: rbbi_cache.h +// +#ifndef RBBI_CACHE_H +#define RBBI_CACHE_H + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_BREAK_ITERATION + +#include "unicode/rbbi.h" +#include "unicode/uobject.h" + +#include "uvectr32.h" + +U_NAMESPACE_BEGIN + +/* DictionaryCache stores the boundaries obtained from a run of dictionary characters. + * Dictionary boundaries are moved first to this cache, then from here + * to the main BreakCache, where they may inter-leave with non-dictionary + * boundaries. The public BreakIterator API always fetches directly + * from the main BreakCache, not from here. + * + * In common situations, the number of boundaries in a single dictionary run + * should be quite small, it will be terminated by punctuation, spaces, + * or any other non-dictionary characters. The main BreakCache may end + * up with boundaries from multiple dictionary based runs. + * + * The boundaries are stored in a simple ArrayList (vector), with the + * assumption that they will be accessed sequentially. + */ +class RuleBasedBreakIterator::DictionaryCache: public UMemory { + public: + DictionaryCache(RuleBasedBreakIterator *bi, UErrorCode &status); + ~DictionaryCache(); + + void reset(); + + UBool following(int32_t fromPos, int32_t *pos, int32_t *statusIndex); + UBool preceding(int32_t fromPos, int32_t *pos, int32_t *statusIndex); + + /** + * Populate the cache with the dictionary based boundaries within a region of text. + * @param startPos The start position of a range of text + * @param endPos The end position of a range of text + * @param firstRuleStatus The rule status index that applies to the break at startPos + * @param otherRuleStatus The rule status index that applies to boundaries other than startPos + * @internal + */ + void populateDictionary(int32_t startPos, int32_t endPos, + int32_t firstRuleStatus, int32_t otherRuleStatus); + + + + RuleBasedBreakIterator *fBI; + + UVector32 *fBreaks; // A vector containing the boundaries. + int32_t fPositionInCache; // Index in fBreaks of last boundary returned by following() + // or preceding(). Optimizes sequential access. + int32_t fStart; // Text position of first boundary in cache. + int32_t fLimit; // Last boundary in cache. Which is the limit of the + // text segment being handled by the dictionary. + int32_t fFirstRuleStatusIndex; // Rule status info for first boundary. + int32_t fOtherRuleStatusIndex; // Rule status info for 2nd through last boundaries. +}; + + +/* + * class BreakCache + * + * Cache of break boundary positions and rule status values. + * Break iterator API functions, next(), previous(), etc., will use cached results + * when possible, and otherwise cache new results as they are obtained. + * + * Uniformly caches both dictionary and rule based (non-dictionary) boundaries. + * + * The cache is implemented as a single circular buffer. + */ + +/* + * size of the circular cache buffer. + */ + +class RuleBasedBreakIterator::BreakCache: public UMemory { + public: + BreakCache(RuleBasedBreakIterator *bi, UErrorCode &status); + virtual ~BreakCache(); + void reset(int32_t pos = 0, int32_t ruleStatus = 0); + void next() { if (fBufIdx == fEndBufIdx) { + nextOL(); + } else { + fBufIdx = modChunkSize(fBufIdx + 1); + fTextIdx = fBI->fPosition = fBoundaries[fBufIdx]; + fBI->fRuleStatusIndex = fStatuses[fBufIdx]; + } + }; + + + void nextOL(); + void previous(UErrorCode &status); + + // Move the iteration state to the position following the startPosition. + // Input position must be pinned to the input length. + void following(int32_t startPosition, UErrorCode &status); + + void preceding(int32_t startPosition, UErrorCode &status); + + /* + * Update the state of the public BreakIterator (fBI) to reflect the + * current state of the break iterator cache (this). + */ + int32_t current(); + + /** + * Add boundaries to the cache near the specified position. + * The given position need not be a boundary itself. + * The input position must be within the range of the text, and + * on a code point boundary. + * If the requested position is a break boundary, leave the iteration + * position on it. + * If the requested position is not a boundary, leave the iteration + * position on the preceding boundary and include both the + * preceding and following boundaries in the cache. + * Additional boundaries, either preceding or following, may be added + * to the cache as a side effect. + * + * Return FALSE if the operation failed. + */ + UBool populateNear(int32_t position, UErrorCode &status); + + /** + * Add boundary(s) to the cache following the current last boundary. + * Return FALSE if at the end of the text, and no more boundaries can be added. + * Leave iteration position at the first newly added boundary, or unchanged if no boundary was added. + */ + UBool populateFollowing(); + + /** + * Add one or more boundaries to the cache preceding the first currently cached boundary. + * Leave the iteration position on the first added boundary. + * Return false if no boundaries could be added (if at the start of the text.) + */ + UBool populatePreceding(UErrorCode &status); + + enum UpdatePositionValues { + RetainCachePosition = 0, + UpdateCachePosition = 1 + }; + + /* + * Add the boundary following the current position. + * The current position can be left as it was, or changed to the newly added boundary, + * as specified by the update parameter. + */ + void addFollowing(int32_t position, int32_t ruleStatusIdx, UpdatePositionValues update); + + + /* + * Add the boundary preceding the current position. + * The current position can be left as it was, or changed to the newly added boundary, + * as specified by the update parameter. + */ + bool addPreceding(int32_t position, int32_t ruleStatusIdx, UpdatePositionValues update); + + /** + * Set the cache position to the specified position, or, if the position + * falls between to cached boundaries, to the preceding boundary. + * Fails if the requested position is outside of the range of boundaries currently held by the cache. + * The startPosition must be on a code point boundary. + * + * Return TRUE if successful, FALSE if the specified position is after + * the last cached boundary or before the first. + */ + UBool seek(int32_t startPosition); + + void dumpCache(); + + private: + static inline int32_t modChunkSize(int index) { return index & (CACHE_SIZE - 1); }; + + static constexpr int32_t CACHE_SIZE = 128; + static_assert((CACHE_SIZE & (CACHE_SIZE-1)) == 0, "CACHE_SIZE must be power of two."); + + RuleBasedBreakIterator *fBI; + int32_t fStartBufIdx; + int32_t fEndBufIdx; // inclusive + + int32_t fTextIdx; + int32_t fBufIdx; + + int32_t fBoundaries[CACHE_SIZE]; + uint16_t fStatuses[CACHE_SIZE]; + + UVector32 fSideBuffer; +}; + +U_NAMESPACE_END + +#endif // #if !UCONFIG_NO_BREAK_ITERATION + +#endif // RBBI_CACHE_H diff --git a/deps/icu-small/source/common/rbbidata.cpp b/deps/icu-small/source/common/rbbidata.cpp index afa87eb6a83f6b..d66eca82f80b39 100644 --- a/deps/icu-small/source/common/rbbidata.cpp +++ b/deps/icu-small/source/common/rbbidata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -14,7 +14,7 @@ #include "unicode/utypes.h" #include "rbbidata.h" #include "rbbirb.h" -#include "utrie.h" +#include "utrie2.h" #include "udatamem.h" #include "cmemory.h" #include "cstring.h" @@ -23,23 +23,6 @@ #include "uassert.h" -//----------------------------------------------------------------------------------- -// -// Trie access folding function. Copied as-is from properties code in uchar.c -// -//----------------------------------------------------------------------------------- -U_CDECL_BEGIN -static int32_t U_CALLCONV -getFoldingOffset(uint32_t data) { - /* if bit 15 is set, then the folding offset is in bits 14..0 of the 16-bit trie result */ - if(data&0x8000) { - return (int32_t)(data&0x7fff); - } else { - return 0; - } -} -U_CDECL_END - U_NAMESPACE_BEGIN //----------------------------------------------------------------------------- @@ -71,9 +54,8 @@ RBBIDataWrapper::RBBIDataWrapper(UDataMemory* udm, UErrorCode &status) { dh->info.dataFormat[0] == 0x42 && // dataFormat="Brk " dh->info.dataFormat[1] == 0x72 && dh->info.dataFormat[2] == 0x6b && - dh->info.dataFormat[3] == 0x20) - // Note: info.fFormatVersion is duplicated in the RBBIDataHeader, and is - // validated when checking that. + dh->info.dataFormat[3] == 0x20 && + isDataVersionAcceptable(dh->info.formatVersion)) ) { status = U_INVALID_FORMAT_ERROR; return; @@ -84,6 +66,11 @@ RBBIDataWrapper::RBBIDataWrapper(UDataMemory* udm, UErrorCode &status) { fUDataMem = udm; } +UBool RBBIDataWrapper::isDataVersionAcceptable(const UVersionInfo version) { + return RBBI_DATA_FORMAT_VERSION[0] == version[0]; +} + + //----------------------------------------------------------------------------- // // init(). Does most of the work of construction, shared between the @@ -96,10 +83,11 @@ void RBBIDataWrapper::init0() { fReverseTable = NULL; fSafeFwdTable = NULL; fSafeRevTable = NULL; - fRuleSource = NULL; + fRuleSource = NULL; fRuleStatusTable = NULL; - fUDataMem = NULL; - fRefCount = 0; + fTrie = NULL; + fUDataMem = NULL; + fRefCount = 0; fDontFreeData = TRUE; } @@ -108,8 +96,7 @@ void RBBIDataWrapper::init(const RBBIDataHeader *data, UErrorCode &status) { return; } fHeader = data; - if (fHeader->fMagic != 0xb1a0 || fHeader->fFormatVersion[0] != 3) - { + if (fHeader->fMagic != 0xb1a0 || !isDataVersionAcceptable(fHeader->fFormatVersion)) { status = U_INVALID_FORMAT_ERROR; return; } @@ -131,16 +118,23 @@ void RBBIDataWrapper::init(const RBBIDataHeader *data, UErrorCode &status) { fSafeRevTable = (RBBIStateTable *)((char *)data + fHeader->fSRTable); } + // Rule Compatibility Hacks + // If a rule set includes reverse rules but does not explicitly include safe reverse rules, + // the reverse rules are to be treated as safe reverse rules. + + if (fSafeRevTable == NULL && fReverseTable != NULL) { + fSafeRevTable = fReverseTable; + fReverseTable = NULL; + } - utrie_unserialize(&fTrie, - (uint8_t *)data + fHeader->fTrie, - fHeader->fTrieLen, - &status); + fTrie = utrie2_openFromSerialized(UTRIE2_16_VALUE_BITS, + (uint8_t *)data + fHeader->fTrie, + fHeader->fTrieLen, + NULL, // *actual length + &status); if (U_FAILURE(status)) { return; } - fTrie.getFoldingOffset=getFoldingOffset; - fRuleSource = (UChar *)((char *)data + fHeader->fRuleSource); fRuleString.setTo(TRUE, fRuleSource, -1); @@ -165,6 +159,8 @@ void RBBIDataWrapper::init(const RBBIDataHeader *data, UErrorCode &status) { //----------------------------------------------------------------------------- RBBIDataWrapper::~RBBIDataWrapper() { U_ASSERT(fRefCount == 0); + utrie2_close(fTrie); + fTrie = NULL; if (fUDataMem) { udata_close(fUDataMem); } else if (!fDontFreeData) { @@ -323,7 +319,7 @@ ubrk_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outD pInfo->dataFormat[1]==0x72 && pInfo->dataFormat[2]==0x6b && pInfo->dataFormat[3]==0x20 && - pInfo->formatVersion[0]==3 )) { + RBBIDataWrapper::isDataVersionAcceptable(pInfo->formatVersion) )) { udata_printError(ds, "ubrk_swap(): data format %02x.%02x.%02x.%02x (format version %02x) is not recognized\n", pInfo->dataFormat[0], pInfo->dataFormat[1], pInfo->dataFormat[2], pInfo->dataFormat[3], @@ -344,17 +340,11 @@ ubrk_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outD // // Get the RRBI Data Header, and check that it appears to be OK. // - // Note: ICU 3.2 and earlier, RBBIDataHeader::fDataFormat was actually - // an int32_t with a value of 1. Starting with ICU 3.4, - // RBBI's fDataFormat matches the dataFormat field from the - // UDataInfo header, four int8_t bytes. The value is {3,1,0,0} - // const uint8_t *inBytes =(const uint8_t *)inData+headerSize; RBBIDataHeader *rbbiDH = (RBBIDataHeader *)inBytes; if (ds->readUInt32(rbbiDH->fMagic) != 0xb1a0 || - rbbiDH->fFormatVersion[0] != 3 || - ds->readUInt32(rbbiDH->fLength) < sizeof(RBBIDataHeader)) - { + !RBBIDataWrapper::isDataVersionAcceptable(rbbiDH->fFormatVersion) || + ds->readUInt32(rbbiDH->fLength) < sizeof(RBBIDataHeader)) { udata_printError(ds, "ubrk_swap(): RBBI Data header is invalid.\n"); *status=U_UNSUPPORTED_ERROR; return 0; @@ -451,8 +441,8 @@ ubrk_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outD } // Trie table for character categories - utrie_swap(ds, inBytes+ds->readUInt32(rbbiDH->fTrie), ds->readUInt32(rbbiDH->fTrieLen), - outBytes+ds->readUInt32(rbbiDH->fTrie), status); + utrie2_swap(ds, inBytes+ds->readUInt32(rbbiDH->fTrie), ds->readUInt32(rbbiDH->fTrieLen), + outBytes+ds->readUInt32(rbbiDH->fTrie), status); // Source Rules Text. It's UChar data ds->swapArray16(ds, inBytes+ds->readUInt32(rbbiDH->fRuleSource), ds->readUInt32(rbbiDH->fRuleSourceLen), diff --git a/deps/icu-small/source/common/rbbidata.h b/deps/icu-small/source/common/rbbidata.h index 0d6cde2d942284..75427863d9fa2a 100644 --- a/deps/icu-small/source/common/rbbidata.h +++ b/deps/icu-small/source/common/rbbidata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: rbbidata.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -51,22 +51,23 @@ ubrk_swap(const UDataSwapper *ds, #include "unicode/uobject.h" #include "unicode/unistr.h" +#include "unicode/uversion.h" #include "umutex.h" -#include "utrie.h" +#include "utrie2.h" U_NAMESPACE_BEGIN +// The current RBBI data format version. +static const uint8_t RBBI_DATA_FORMAT_VERSION[] = {4, 0, 0, 0}; + /* * The following structs map exactly onto the raw data from ICU common data file. */ struct RBBIDataHeader { uint32_t fMagic; /* == 0xbla0 */ - uint8_t fFormatVersion[4]; /* Data Format. Same as the value in struct UDataInfo */ + UVersionInfo fFormatVersion; /* Data Format. Same as the value in struct UDataInfo */ /* if there is one associated with this data. */ /* (version originates in rbbi, is copied to UDataInfo) */ - /* For ICU 3.2 and earlier, this field was */ - /* uint32_t fVersion */ - /* with a value of 1. */ uint32_t fLength; /* Total length in bytes of this RBBI Data, */ /* including all sections, not just the header. */ uint32_t fCatCount; /* Number of character categories. */ @@ -152,6 +153,8 @@ class RBBIDataWrapper : public UMemory { RBBIDataWrapper(UDataMemory* udm, UErrorCode &status); ~RBBIDataWrapper(); + static UBool isDataVersionAcceptable(const UVersionInfo version); + void init0(); void init(const RBBIDataHeader *data, UErrorCode &status); RBBIDataWrapper *addReference(); @@ -181,11 +184,11 @@ class RBBIDataWrapper : public UMemory { /* number of int32_t values in the rule status table. Used to sanity check indexing */ int32_t fStatusMaxIdx; - UTrie fTrie; + UTrie2 *fTrie; private: u_atomic_int32_t fRefCount; - UDataMemory *fUDataMem; + UDataMemory *fUDataMem; UnicodeString fRuleString; UBool fDontFreeData; diff --git a/deps/icu-small/source/common/rbbinode.cpp b/deps/icu-small/source/common/rbbinode.cpp index d0949a3f7f045a..2181d81acad2f2 100644 --- a/deps/icu-small/source/common/rbbinode.cpp +++ b/deps/icu-small/source/common/rbbinode.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** diff --git a/deps/icu-small/source/common/rbbinode.h b/deps/icu-small/source/common/rbbinode.h index ac26ceefaf449f..e33662167fe3fd 100644 --- a/deps/icu-small/source/common/rbbinode.h +++ b/deps/icu-small/source/common/rbbinode.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/common/rbbirb.cpp b/deps/icu-small/source/common/rbbirb.cpp index 475fdd7f8369e7..c67f6f8166c0a0 100644 --- a/deps/icu-small/source/common/rbbirb.cpp +++ b/deps/icu-small/source/common/rbbirb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // file: rbbirb.cpp @@ -24,16 +24,16 @@ #include "unicode/uchriter.h" #include "unicode/parsepos.h" #include "unicode/parseerr.h" + #include "cmemory.h" #include "cstring.h" - #include "rbbirb.h" #include "rbbinode.h" - #include "rbbiscan.h" #include "rbbisetb.h" #include "rbbitblb.h" #include "rbbidata.h" +#include "uassert.h" U_NAMESPACE_BEGIN @@ -164,8 +164,13 @@ RBBIDataHeader *RBBIRuleBuilder::flattenData() { int32_t statusTableSize = align8(fRuleStatusVals->size() * sizeof(int32_t)); int32_t rulesSize = align8((strippedRules.length()+1) * sizeof(UChar)); - int32_t totalSize = headerSize + forwardTableSize + reverseTableSize - + safeFwdTableSize + safeRevTableSize + (void)safeFwdTableSize; + + int32_t totalSize = headerSize + + forwardTableSize + + /* reverseTableSize */ 0 + + /* safeFwdTableSize */ 0 + + (safeRevTableSize ? safeRevTableSize : reverseTableSize) + statusTableSize + trieSize + rulesSize; RBBIDataHeader *data = (RBBIDataHeader *)uprv_malloc(totalSize); @@ -177,23 +182,45 @@ RBBIDataHeader *RBBIRuleBuilder::flattenData() { data->fMagic = 0xb1a0; - data->fFormatVersion[0] = 3; - data->fFormatVersion[1] = 1; - data->fFormatVersion[2] = 0; - data->fFormatVersion[3] = 0; + data->fFormatVersion[0] = RBBI_DATA_FORMAT_VERSION[0]; + data->fFormatVersion[1] = RBBI_DATA_FORMAT_VERSION[1]; + data->fFormatVersion[2] = RBBI_DATA_FORMAT_VERSION[2]; + data->fFormatVersion[3] = RBBI_DATA_FORMAT_VERSION[3]; data->fLength = totalSize; data->fCatCount = fSetBuilder->getNumCharCategories(); + // Only save the forward table and the safe reverse table, + // because these are the only ones used at run-time. + // + // For the moment, we still build the other tables if they are present in the rule source files, + // for backwards compatibility. Old rule files need to work, and this is the simplest approach. + // + // Additional backwards compatibility consideration: if no safe rules are provided, consider the + // reverse rules to actually be the safe reverse rules. + data->fFTable = headerSize; data->fFTableLen = forwardTableSize; + + // Do not save Reverse Table. data->fRTable = data->fFTable + forwardTableSize; - data->fRTableLen = reverseTableSize; - data->fSFTable = data->fRTable + reverseTableSize; - data->fSFTableLen = safeFwdTableSize; - data->fSRTable = data->fSFTable + safeFwdTableSize; - data->fSRTableLen = safeRevTableSize; + data->fRTableLen = 0; + + // Do not save the Safe Forward table. + data->fSFTable = data->fRTable + 0; + data->fSFTableLen = 0; + + data->fSRTable = data->fSFTable + 0; + if (safeRevTableSize > 0) { + data->fSRTableLen = safeRevTableSize; + } else if (reverseTableSize > 0) { + data->fSRTableLen = reverseTableSize; + } else { + U_ASSERT(FALSE); // Rule build should have failed for lack of a reverse table + // before reaching this point. + } - data->fTrie = data->fSRTable + safeRevTableSize; + + data->fTrie = data->fSRTable + data->fSRTableLen; data->fTrieLen = fSetBuilder->getTrieSize(); data->fStatusTable = data->fTrie + trieSize; data->fStatusTableLen= statusTableSize; @@ -203,9 +230,14 @@ RBBIDataHeader *RBBIRuleBuilder::flattenData() { uprv_memset(data->fReserved, 0, sizeof(data->fReserved)); fForwardTables->exportTable((uint8_t *)data + data->fFTable); - fReverseTables->exportTable((uint8_t *)data + data->fRTable); - fSafeFwdTables->exportTable((uint8_t *)data + data->fSFTable); - fSafeRevTables->exportTable((uint8_t *)data + data->fSRTable); + // fReverseTables->exportTable((uint8_t *)data + data->fRTable); + // fSafeFwdTables->exportTable((uint8_t *)data + data->fSFTable); + if (safeRevTableSize > 0) { + fSafeRevTables->exportTable((uint8_t *)data + data->fSRTable); + } else { + fReverseTables->exportTable((uint8_t *)data + data->fSRTable); + } + fSetBuilder->serializeTrie ((uint8_t *)data + data->fTrie); int32_t *ruleStatusTable = (int32_t *)((uint8_t *)data + data->fStatusTable); diff --git a/deps/icu-small/source/common/rbbirb.h b/deps/icu-small/source/common/rbbirb.h index 1a9d3023254139..6fbdbff7449a9f 100644 --- a/deps/icu-small/source/common/rbbirb.h +++ b/deps/icu-small/source/common/rbbirb.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // rbbirb.h @@ -15,6 +15,9 @@ #define RBBIRB_H #include "unicode/utypes.h" + +#if !UCONFIG_NO_BREAK_ITERATION + #include "unicode/uobject.h" #include "unicode/rbbi.h" #include "unicode/uniset.h" @@ -207,4 +210,7 @@ struct RBBISetTableEl { #endif U_NAMESPACE_END + +#endif /* #if !UCONFIG_NO_BREAK_ITERATION */ + #endif diff --git a/deps/icu-small/source/common/rbbirpt.h b/deps/icu-small/source/common/rbbirpt.h index 542a396df089b7..b94c4c25cbfb8c 100644 --- a/deps/icu-small/source/common/rbbirpt.h +++ b/deps/icu-small/source/common/rbbirpt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html //--------------------------------------------------------------------------------- // diff --git a/deps/icu-small/source/common/rbbiscan.cpp b/deps/icu-small/source/common/rbbiscan.cpp index 57432509454057..1653a0c7bc7fe2 100644 --- a/deps/icu-small/source/common/rbbiscan.cpp +++ b/deps/icu-small/source/common/rbbiscan.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // file: rbbiscan.cpp @@ -47,6 +47,7 @@ // //------------------------------------------------------------------------------ static const UChar 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, // - \ u 0 0 7 f ] - [ \ p @@ -558,6 +559,10 @@ UBool RBBIRuleScanner::doParseActions(int32_t action) fRB->fDefaultTree = &fRB->fSafeRevTree; } else if (opt == UNICODE_STRING("lookAheadHardBreak", 18)) { fRB->fLookAheadHardBreak = TRUE; + } else if (opt == UNICODE_STRING("quoted_literals_only", 20)) { + fRuleSets[kRuleSet_rule_char-128].clear(); + } else if (opt == UNICODE_STRING("unquoted_literals", 17)) { + fRuleSets[kRuleSet_rule_char-128].applyPattern(UnicodeString(gRuleSet_rule_char_pattern), *fRB->fStatus); } else { error(U_BRK_UNRECOGNIZED_OPTION); } @@ -1179,13 +1184,12 @@ RBBINode *RBBIRuleScanner::pushNewNode(RBBINode::NodeType t) { if (U_FAILURE(*fRB->fStatus)) { return NULL; } - fNodeStackPtr++; - if (fNodeStackPtr >= kStackSize) { - error(U_BRK_INTERNAL_ERROR); + if (fNodeStackPtr >= kStackSize - 1) { + error(U_BRK_RULE_SYNTAX); RBBIDebugPuts("RBBIRuleScanner::pushNewNode - stack overflow."); - *fRB->fStatus = U_BRK_INTERNAL_ERROR; return NULL; } + fNodeStackPtr++; fNodeStack[fNodeStackPtr] = new RBBINode(t); if (fNodeStack[fNodeStackPtr] == NULL) { *fRB->fStatus = U_MEMORY_ALLOCATION_ERROR; diff --git a/deps/icu-small/source/common/rbbiscan.h b/deps/icu-small/source/common/rbbiscan.h index 6be2f9668ff6cf..3d484db0e9be5d 100644 --- a/deps/icu-small/source/common/rbbiscan.h +++ b/deps/icu-small/source/common/rbbiscan.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // rbbiscan.h diff --git a/deps/icu-small/source/common/rbbisetb.cpp b/deps/icu-small/source/common/rbbisetb.cpp index 22ec28c1350638..c172da00df7964 100644 --- a/deps/icu-small/source/common/rbbisetb.cpp +++ b/deps/icu-small/source/common/rbbisetb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // rbbisetb.cpp @@ -35,7 +35,7 @@ #if !UCONFIG_NO_BREAK_ITERATION #include "unicode/uniset.h" -#include "utrie.h" +#include "utrie2.h" #include "uvector.h" #include "uassert.h" #include "cmemory.h" @@ -44,43 +44,6 @@ #include "rbbisetb.h" #include "rbbinode.h" - -//------------------------------------------------------------------------ -// -// getFoldedRBBIValue Call-back function used during building of Trie table. -// Folding value: just store the offset (16 bits) -// if there is any non-0 entry. -// (It'd really be nice if the Trie builder would provide a -// simple default, so this function could go away from here.) -// -//------------------------------------------------------------------------ -/* folding value: just store the offset (16 bits) if there is any non-0 entry */ -U_CDECL_BEGIN -static uint32_t U_CALLCONV -getFoldedRBBIValue(UNewTrie *trie, UChar32 start, int32_t offset) { - uint32_t value; - UChar32 limit; - UBool inBlockZero; - - limit=start+0x400; - while(startfNext) { - utrie_setRange32(fTrie, rlRange->fStartChar, rlRange->fEndChar+1, rlRange->fNum, TRUE); + fTrie = utrie2_open(0, // Initial value for all code points. + 0, // Error value for out-of-range input. + fStatus); + + for (rlRange = fRangeList; rlRange!=0 && U_SUCCESS(*fStatus); rlRange=rlRange->fNext) { + utrie2_setRange32(fTrie, + rlRange->fStartChar, // Range start + rlRange->fEndChar, // Range end (inclusive) + rlRange->fNum, // value for range + TRUE, // Overwrite previously written values + fStatus); } } - //----------------------------------------------------------------------------------- // // getTrieSize() Return the size that will be required to serialize the Trie. // //----------------------------------------------------------------------------------- -int32_t RBBISetBuilder::getTrieSize() /*const*/ { - fTrieSize = utrie_serialize(fTrie, - NULL, // Buffer - 0, // Capacity - getFoldedRBBIValue, - TRUE, // Reduce to 16 bits - fStatus); +int32_t RBBISetBuilder::getTrieSize() { + if (U_FAILURE(*fStatus)) { + return 0; + } + utrie2_freeze(fTrie, UTRIE2_16_VALUE_BITS, fStatus); + fTrieSize = utrie2_serialize(fTrie, + NULL, // Buffer + 0, // Capacity + fStatus); + if (*fStatus == U_BUFFER_OVERFLOW_ERROR) { + *fStatus = U_ZERO_ERROR; + } // RBBIDebugPrintf("Trie table size is %d\n", trieSize); return fTrieSize; } @@ -327,12 +295,10 @@ int32_t RBBISetBuilder::getTrieSize() /*const*/ { // //----------------------------------------------------------------------------------- void RBBISetBuilder::serializeTrie(uint8_t *where) { - utrie_serialize(fTrie, - where, // Buffer - fTrieSize, // Capacity - getFoldedRBBIValue, - TRUE, // Reduce to 16 bits - fStatus); + utrie2_serialize(fTrie, + where, // Buffer + fTrieSize, // Capacity + fStatus); } //------------------------------------------------------------------------ diff --git a/deps/icu-small/source/common/rbbisetb.h b/deps/icu-small/source/common/rbbisetb.h index 89bfb9865cda15..7cedb45b33550f 100644 --- a/deps/icu-small/source/common/rbbisetb.h +++ b/deps/icu-small/source/common/rbbisetb.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // rbbisetb.h @@ -13,12 +13,14 @@ #define RBBISETB_H #include "unicode/utypes.h" + +#if !UCONFIG_NO_BREAK_ITERATION + #include "unicode/uobject.h" #include "rbbirb.h" +#include "utrie2.h" #include "uvector.h" -struct UNewTrie; - U_NAMESPACE_BEGIN // @@ -109,8 +111,8 @@ class RBBISetBuilder : public UMemory { RangeDescriptor *fRangeList; // Head of the linked list of RangeDescriptors - UNewTrie *fTrie; // The mapping TRIE that is the end result of processing - uint32_t fTrieSize; // the Unicode Sets. + UTrie2 *fTrie; // The mapping TRIE that is the end result of processing + uint32_t fTrieSize; // the Unicode Sets. // Groups correspond to character categories - // groups of ranges that are in the same original UnicodeSets. @@ -129,4 +131,7 @@ class RBBISetBuilder : public UMemory { U_NAMESPACE_END + +#endif /* #if !UCONFIG_NO_BREAK_ITERATION */ + #endif diff --git a/deps/icu-small/source/common/rbbistbl.cpp b/deps/icu-small/source/common/rbbistbl.cpp index f48485868c81e0..d90992290c3e63 100644 --- a/deps/icu-small/source/common/rbbistbl.cpp +++ b/deps/icu-small/source/common/rbbistbl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // file: rbbistbl.cpp Implementation of the ICU RBBISymbolTable class diff --git a/deps/icu-small/source/common/rbbitblb.cpp b/deps/icu-small/source/common/rbbitblb.cpp index c765e610526552..b3e6ca51d159a5 100644 --- a/deps/icu-small/source/common/rbbitblb.cpp +++ b/deps/icu-small/source/common/rbbitblb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/rbbitblb.h b/deps/icu-small/source/common/rbbitblb.h index d71a0245874b5d..10415018785209 100644 --- a/deps/icu-small/source/common/rbbitblb.h +++ b/deps/icu-small/source/common/rbbitblb.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // rbbitblb.h diff --git a/deps/icu-small/source/common/resbund.cpp b/deps/icu-small/source/common/resbund.cpp index 2976791761f88f..29c3463ed59396 100644 --- a/deps/icu-small/source/common/resbund.cpp +++ b/deps/icu-small/source/common/resbund.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/resbund_cnv.cpp b/deps/icu-small/source/common/resbund_cnv.cpp index 80a4daa3b7f627..ae854fe739cd32 100644 --- a/deps/icu-small/source/common/resbund_cnv.cpp +++ b/deps/icu-small/source/common/resbund_cnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: resbund_cnv.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/resource.cpp b/deps/icu-small/source/common/resource.cpp index 62b3aa46a5c083..3d41a16029f24e 100644 --- a/deps/icu-small/source/common/resource.cpp +++ b/deps/icu-small/source/common/resource.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/resource.h b/deps/icu-small/source/common/resource.h index 43c3309b5e9917..3dbff785ef12a8 100644 --- a/deps/icu-small/source/common/resource.h +++ b/deps/icu-small/source/common/resource.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/ruleiter.cpp b/deps/icu-small/source/common/ruleiter.cpp index 6e27b4dd8c609e..41eea23c0dcb32 100644 --- a/deps/icu-small/source/common/ruleiter.cpp +++ b/deps/icu-small/source/common/ruleiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ruleiter.h b/deps/icu-small/source/common/ruleiter.h index b0b8e5435f49c6..b6edc657aff261 100644 --- a/deps/icu-small/source/common/ruleiter.h +++ b/deps/icu-small/source/common/ruleiter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/schriter.cpp b/deps/icu-small/source/common/schriter.cpp index cc413666f1a838..f852800aaae6bd 100644 --- a/deps/icu-small/source/common/schriter.cpp +++ b/deps/icu-small/source/common/schriter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/serv.cpp b/deps/icu-small/source/common/serv.cpp index 9f05c1943ae1b6..8913b21e69457d 100644 --- a/deps/icu-small/source/common/serv.cpp +++ b/deps/icu-small/source/common/serv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/serv.h b/deps/icu-small/source/common/serv.h index c82c6d1dd8197f..70695839a8f3ce 100644 --- a/deps/icu-small/source/common/serv.h +++ b/deps/icu-small/source/common/serv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servlk.cpp b/deps/icu-small/source/common/servlk.cpp index cdd4e3f7f0c1ab..27b046f1e504f5 100644 --- a/deps/icu-small/source/common/servlk.cpp +++ b/deps/icu-small/source/common/servlk.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servlkf.cpp b/deps/icu-small/source/common/servlkf.cpp index d8617cee489f21..6e46bd2079722a 100644 --- a/deps/icu-small/source/common/servlkf.cpp +++ b/deps/icu-small/source/common/servlkf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servloc.h b/deps/icu-small/source/common/servloc.h index 5a2b669d7f9d90..501989424423ea 100644 --- a/deps/icu-small/source/common/servloc.h +++ b/deps/icu-small/source/common/servloc.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servls.cpp b/deps/icu-small/source/common/servls.cpp index 10f3b88aa7ba4f..907fe7fecfe1fb 100644 --- a/deps/icu-small/source/common/servls.cpp +++ b/deps/icu-small/source/common/servls.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servnotf.cpp b/deps/icu-small/source/common/servnotf.cpp index 3d94c8690dcbf0..5159452f0a32da 100644 --- a/deps/icu-small/source/common/servnotf.cpp +++ b/deps/icu-small/source/common/servnotf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servnotf.h b/deps/icu-small/source/common/servnotf.h index 72ae93e6277000..cf92fc169e927f 100644 --- a/deps/icu-small/source/common/servnotf.h +++ b/deps/icu-small/source/common/servnotf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servrbf.cpp b/deps/icu-small/source/common/servrbf.cpp index f67ed026ee76e2..3f143afadf62bb 100644 --- a/deps/icu-small/source/common/servrbf.cpp +++ b/deps/icu-small/source/common/servrbf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/servslkf.cpp b/deps/icu-small/source/common/servslkf.cpp index c01a2ad4c1c153..4aa10414a038d3 100644 --- a/deps/icu-small/source/common/servslkf.cpp +++ b/deps/icu-small/source/common/servslkf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** ******************************************************************************* diff --git a/deps/icu-small/source/common/sharedobject.cpp b/deps/icu-small/source/common/sharedobject.cpp index 8e5095e129255a..37aa458e00f98f 100644 --- a/deps/icu-small/source/common/sharedobject.cpp +++ b/deps/icu-small/source/common/sharedobject.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/sharedobject.h b/deps/icu-small/source/common/sharedobject.h index 6e205b14ba9798..783b55948a8248 100644 --- a/deps/icu-small/source/common/sharedobject.h +++ b/deps/icu-small/source/common/sharedobject.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/simpleformatter.cpp b/deps/icu-small/source/common/simpleformatter.cpp index eaeb60de143367..f866e0a1a120e2 100644 --- a/deps/icu-small/source/common/simpleformatter.cpp +++ b/deps/icu-small/source/common/simpleformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/sprpimpl.h b/deps/icu-small/source/common/sprpimpl.h index 56c2f86eeff74f..aff40ad0dab671 100644 --- a/deps/icu-small/source/common/sprpimpl.h +++ b/deps/icu-small/source/common/sprpimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: sprpimpl.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/stringpiece.cpp b/deps/icu-small/source/common/stringpiece.cpp index b032b474f65616..d4f7f310bafc7d 100644 --- a/deps/icu-small/source/common/stringpiece.cpp +++ b/deps/icu-small/source/common/stringpiece.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // Copyright (C) 2009-2013, International Business Machines // Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/common/stringtriebuilder.cpp b/deps/icu-small/source/common/stringtriebuilder.cpp index 075d7c4324b0e5..cf5b7b73ae2c1f 100644 --- a/deps/icu-small/source/common/stringtriebuilder.cpp +++ b/deps/icu-small/source/common/stringtriebuilder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: stringtriebuilder.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uarrsort.c b/deps/icu-small/source/common/uarrsort.cpp similarity index 98% rename from deps/icu-small/source/common/uarrsort.c rename to deps/icu-small/source/common/uarrsort.cpp index bb1b5bdd785feb..03c4d4e7fc44aa 100644 --- a/deps/icu-small/source/common/uarrsort.c +++ b/deps/icu-small/source/common/uarrsort.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uarrsort.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -38,16 +38,19 @@ enum { U_CAPI int32_t U_EXPORT2 uprv_uint16Comparator(const void *context, const void *left, const void *right) { + (void)context; return (int32_t)*(const uint16_t *)left - (int32_t)*(const uint16_t *)right; } U_CAPI int32_t U_EXPORT2 uprv_int32Comparator(const void *context, const void *left, const void *right) { + (void)context; return *(const int32_t *)left - *(const int32_t *)right; } U_CAPI int32_t U_EXPORT2 uprv_uint32Comparator(const void *context, const void *left, const void *right) { + (void)context; uint32_t l=*(const uint32_t *)left, r=*(const uint32_t *)right; /* compare directly because (l-r) would overflow the int32_t result */ diff --git a/deps/icu-small/source/common/uarrsort.h b/deps/icu-small/source/common/uarrsort.h index 8b25cc5d7f5e83..a55dca5b9eabfe 100644 --- a/deps/icu-small/source/common/uarrsort.h +++ b/deps/icu-small/source/common/uarrsort.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uarrsort.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uassert.h b/deps/icu-small/source/common/uassert.h index 10816dacf56c08..2c080eb402f07c 100644 --- a/deps/icu-small/source/common/uassert.h +++ b/deps/icu-small/source/common/uassert.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/ubidi.c b/deps/icu-small/source/common/ubidi.cpp similarity index 97% rename from deps/icu-small/source/common/ubidi.c rename to deps/icu-small/source/common/ubidi.cpp index 3c9497862639ba..8e2fc36e5f1753 100644 --- a/deps/icu-small/source/common/ubidi.c +++ b/deps/icu-small/source/common/ubidi.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ubidi.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -447,12 +447,12 @@ getDirProps(UBiDi *pBiDi) { UBool removeBiDiControls = (UBool)(pBiDi->reorderingOptions & UBIDI_OPTION_REMOVE_CONTROLS); - typedef enum { + enum State { NOT_SEEKING_STRONG, /* 0: not contextual paraLevel, not after FSI */ SEEKING_STRONG_FOR_PARA, /* 1: looking for first strong char in para */ SEEKING_STRONG_FOR_FSI, /* 2: looking for first strong after FSI */ LOOKING_FOR_PDI /* 3: found strong after FSI, looking for PDI */ - } State; + }; State state; DirProp lastStrong=ON; /* for default level & inverse BiDi */ /* The following stacks are used to manage isolate sequences. Those @@ -466,7 +466,7 @@ getDirProps(UBiDi *pBiDi) { int32_t isolateStartStack[UBIDI_MAX_EXPLICIT_LEVEL+1]; /* The following stack contains the last known state before encountering the initiator of an isolate sequence */ - int8_t previousStateStack[UBIDI_MAX_EXPLICIT_LEVEL+1]; + State previousStateStack[UBIDI_MAX_EXPLICIT_LEVEL+1]; int32_t stackLast=-1; if(pBiDi->reorderingOptions & UBIDI_OPTION_STREAMING) @@ -677,7 +677,9 @@ bracketInit(UBiDi *pBiDi, BracketData *bd) { bd->isoRuns[0].start=0; bd->isoRuns[0].limit=0; bd->isoRuns[0].level=GET_PARALEVEL(pBiDi, 0); - bd->isoRuns[0].lastStrong=bd->isoRuns[0].lastBase=bd->isoRuns[0].contextDir=GET_PARALEVEL(pBiDi, 0)&1; + UBiDiLevel t = GET_PARALEVEL(pBiDi, 0) & 1; + bd->isoRuns[0].lastStrong = bd->isoRuns[0].lastBase = t; + bd->isoRuns[0].contextDir = (UBiDiDirection)t; bd->isoRuns[0].contextPos=0; if(pBiDi->openingsMemory) { bd->openings=pBiDi->openingsMemory; @@ -696,7 +698,8 @@ bracketProcessB(BracketData *bd, UBiDiLevel level) { bd->isoRunLast=0; bd->isoRuns[0].limit=0; bd->isoRuns[0].level=level; - bd->isoRuns[0].lastStrong=bd->isoRuns[0].lastBase=bd->isoRuns[0].contextDir=level&1; + bd->isoRuns[0].lastStrong=bd->isoRuns[0].lastBase=level&1; + bd->isoRuns[0].contextDir=(UBiDiDirection)(level&1); bd->isoRuns[0].contextPos=0; } @@ -712,8 +715,9 @@ bracketProcessBoundary(BracketData *bd, int32_t lastCcPos, contextLevel=embeddingLevel; pLastIsoRun->limit=pLastIsoRun->start; pLastIsoRun->level=embeddingLevel; - pLastIsoRun->lastStrong=pLastIsoRun->lastBase=pLastIsoRun->contextDir=contextLevel&1; - pLastIsoRun->contextPos=lastCcPos; + pLastIsoRun->lastStrong=pLastIsoRun->lastBase=contextLevel&1; + pLastIsoRun->contextDir=(UBiDiDirection)(contextLevel&1); + pLastIsoRun->contextPos=(UBiDiDirection)lastCcPos; } /* LRI or RLI */ @@ -727,7 +731,8 @@ bracketProcessLRI_RLI(BracketData *bd, UBiDiLevel level) { pLastIsoRun++; pLastIsoRun->start=pLastIsoRun->limit=lastLimit; pLastIsoRun->level=level; - pLastIsoRun->lastStrong=pLastIsoRun->lastBase=pLastIsoRun->contextDir=level&1; + pLastIsoRun->lastStrong=pLastIsoRun->lastBase=level&1; + pLastIsoRun->contextDir=(UBiDiDirection)(level&1); pLastIsoRun->contextPos=0; } @@ -801,7 +806,7 @@ bracketProcessClosing(BracketData *bd, int32_t openIdx, int32_t position) { UBool stable; DirProp newProp; pOpening=&bd->openings[openIdx]; - direction=pLastIsoRun->level&1; + direction=(UBiDiDirection)(pLastIsoRun->level&1); stable=TRUE; /* assume stable until proved otherwise */ /* The stable flag is set when brackets are paired and their @@ -894,7 +899,7 @@ bracketProcessChar(BracketData *bd, int32_t position) { break; } pLastIsoRun->lastBase=ON; - pLastIsoRun->contextDir=newProp; + pLastIsoRun->contextDir=(UBiDiDirection)newProp; pLastIsoRun->contextPos=position; level=bd->pBiDi->levels[position]; if(level&UBIDI_LEVEL_OVERRIDE) { /* X4, X5 */ @@ -942,14 +947,14 @@ bracketProcessChar(BracketData *bd, int32_t position) { dirProps[position]=newProp; pLastIsoRun->lastBase=newProp; pLastIsoRun->lastStrong=newProp; - pLastIsoRun->contextDir=newProp; + pLastIsoRun->contextDir=(UBiDiDirection)newProp; pLastIsoRun->contextPos=position; } else if(dirProp<=R || dirProp==AL) { newProp=DIR_FROM_STRONG(dirProp); pLastIsoRun->lastBase=dirProp; pLastIsoRun->lastStrong=dirProp; - pLastIsoRun->contextDir=newProp; + pLastIsoRun->contextDir=(UBiDiDirection)newProp; pLastIsoRun->contextPos=position; } else if(dirProp==EN) { @@ -958,7 +963,7 @@ bracketProcessChar(BracketData *bd, int32_t position) { newProp=L; /* W7 */ if(!bd->isNumbersSpecial) dirProps[position]=ENL; - pLastIsoRun->contextDir=L; + pLastIsoRun->contextDir=(UBiDiDirection)L; pLastIsoRun->contextPos=position; } else { @@ -967,14 +972,14 @@ bracketProcessChar(BracketData *bd, int32_t position) { dirProps[position]=AN; /* W2 */ else dirProps[position]=ENR; - pLastIsoRun->contextDir=R; + pLastIsoRun->contextDir=(UBiDiDirection)R; pLastIsoRun->contextPos=position; } } else if(dirProp==AN) { newProp=R; /* N0 */ pLastIsoRun->lastBase=AN; - pLastIsoRun->contextDir=R; + pLastIsoRun->contextDir=(UBiDiDirection)R; pLastIsoRun->contextPos=position; } else if(dirProp==NSM) { @@ -1313,7 +1318,7 @@ resolveExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) { previousLevel=embeddingLevel; levels[i]=embeddingLevel; if(!bracketProcessChar(&bracketData, i)) - return -1; + return (UBiDiDirection)-1; /* the dirProp may have been changed in bracketProcessChar() */ flags|=DIRPROP_FLAG(dirProps[i]); break; @@ -1343,18 +1348,20 @@ resolveExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) { static UBiDiDirection checkExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) { DirProp *dirProps=pBiDi->dirProps; - DirProp dirProp; UBiDiLevel *levels=pBiDi->levels; int32_t isolateCount=0; - int32_t i, length=pBiDi->length; + int32_t length=pBiDi->length; Flags flags=0; /* collect all directionalities in the text */ - UBiDiLevel level; pBiDi->isolateCount=0; - for(i=0; iparas[0].limit; + int32_t currentParaLevel = pBiDi->paraLevel; + + for(int32_t i=0; ipBiDi->isolateCount) @@ -1364,21 +1371,41 @@ checkExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) { isolateCount--; else if(dirProp==B) isolateCount=0; - if(level&UBIDI_LEVEL_OVERRIDE) { + + // optimized version of int32_t currentParaLevel = GET_PARALEVEL(pBiDi, i); + if (pBiDi->defaultParaLevel != 0 && + i == currentParaLimit && (currentParaIndex + 1) < pBiDi->paraCount) { + currentParaLevel = pBiDi->paras[++currentParaIndex].level; + currentParaLimit = pBiDi->paras[currentParaIndex].limit; + } + + UBiDiLevel overrideFlag = level & UBIDI_LEVEL_OVERRIDE; + level &= ~UBIDI_LEVEL_OVERRIDE; + if (level < currentParaLevel || UBIDI_MAX_EXPLICIT_LEVEL < level) { + if (level == 0) { + if (dirProp == B) { + // Paragraph separators are ok with explicit level 0. + // Prevents reordering of paragraphs. + } else { + // Treat explicit level 0 as a wildcard for the paragraph level. + // Avoid making the caller guess what the paragraph level would be. + level = (UBiDiLevel)currentParaLevel; + levels[i] = level | overrideFlag; + } + } else { + // 1 <= level < currentParaLevel or UBIDI_MAX_EXPLICIT_LEVEL < level + /* level out of bounds */ + *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; + return UBIDI_LTR; + } + } + if (overrideFlag != 0) { /* keep the override flag in levels[i] but adjust the flags */ - level&=~UBIDI_LEVEL_OVERRIDE; /* make the range check below simpler */ flags|=DIRPROP_FLAG_O(level); } else { /* set the flags */ flags|=DIRPROP_FLAG_E(level)|DIRPROP_FLAG(dirProp); } - if((levelparaLevel); @@ -1772,7 +1799,7 @@ addPoint(UBiDi *pBiDi, int32_t pos, int32_t flag) if (pInsertPoints->capacity == 0) { - pInsertPoints->points=uprv_malloc(sizeof(Point)*FIRSTALLOC); + pInsertPoints->points=static_cast(uprv_malloc(sizeof(Point)*FIRSTALLOC)); if (pInsertPoints->points == NULL) { pInsertPoints->errorCode=U_MEMORY_ALLOCATION_ERROR; @@ -1782,9 +1809,9 @@ addPoint(UBiDi *pBiDi, int32_t pos, int32_t flag) } if (pInsertPoints->size >= pInsertPoints->capacity) /* no room for new point */ { - void * savePoints=pInsertPoints->points; - pInsertPoints->points=uprv_realloc(pInsertPoints->points, - pInsertPoints->capacity*2*sizeof(Point)); + Point * savePoints=pInsertPoints->points; + pInsertPoints->points=static_cast(uprv_realloc(pInsertPoints->points, + pInsertPoints->capacity*2*sizeof(Point))); if (pInsertPoints->points == NULL) { pInsertPoints->points=savePoints; @@ -2342,7 +2369,7 @@ setParaSuccess(UBiDi *pBiDi) { static void setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length, UBiDiLevel paraLevel, UErrorCode *pErrorCode) { - void *runsOnlyMemory = NULL; + int32_t *runsOnlyMemory = NULL; int32_t *visualMap; UChar *visualText; int32_t saveLength, saveTrailingWSStart; @@ -2363,7 +2390,7 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length, goto cleanup3; } /* obtain memory for mapping table and visual text */ - runsOnlyMemory=uprv_malloc(length*(sizeof(int32_t)+sizeof(UChar)+sizeof(UBiDiLevel))); + runsOnlyMemory=static_cast(uprv_malloc(length*(sizeof(int32_t)+sizeof(UChar)+sizeof(UBiDiLevel)))); if(runsOnlyMemory==NULL) { *pErrorCode=U_MEMORY_ALLOCATION_ERROR; goto cleanup3; @@ -2558,7 +2585,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length, pBiDi->text=text; pBiDi->length=pBiDi->originalLength=pBiDi->resultLength=length; pBiDi->paraLevel=paraLevel; - pBiDi->direction=paraLevel&1; + pBiDi->direction=(UBiDiDirection)(paraLevel&1); pBiDi->paraCount=1; pBiDi->dirProps=NULL; @@ -3009,7 +3036,7 @@ ubidi_getCustomizedClass(UBiDi *pBiDi, UChar32 c) dir = ubidi_getClass(pBiDi->bdp, c); } if(dir >= U_CHAR_DIRECTION_COUNT) { - dir = ON; + dir = (UCharDirection)ON; } return dir; } diff --git a/deps/icu-small/source/common/ubidi_props.c b/deps/icu-small/source/common/ubidi_props.cpp similarity index 98% rename from deps/icu-small/source/common/ubidi_props.c rename to deps/icu-small/source/common/ubidi_props.cpp index cba13ad6ea98b4..dcfb52c897d360 100644 --- a/deps/icu-small/source/common/ubidi_props.c +++ b/deps/icu-small/source/common/ubidi_props.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ubidi_props.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -55,6 +55,8 @@ ubidi_getSingleton() { static UBool U_CALLCONV _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32_t value) { + (void)end; + (void)value; /* add the start code point to the USet */ const USetAdder *sa=(const USetAdder *)context; sa->add(sa->set, start); diff --git a/deps/icu-small/source/common/ubidi_props.h b/deps/icu-small/source/common/ubidi_props.h index 4312230bc09b63..69e8853e69b1ca 100644 --- a/deps/icu-small/source/common/ubidi_props.h +++ b/deps/icu-small/source/common/ubidi_props.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ubidi_props.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ubidi_props_data.h b/deps/icu-small/source/common/ubidi_props_data.h index 685d2b1e844c61..98f21510e7d42c 100644 --- a/deps/icu-small/source/common/ubidi_props_data.h +++ b/deps/icu-small/source/common/ubidi_props_data.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // Copyright (C) 1999-2016, International Business Machines @@ -11,37 +11,37 @@ #ifdef INCLUDED_FROM_UBIDI_PROPS_C -static const UVersionInfo ubidi_props_dataVersion={9,0,0,0}; +static const UVersionInfo ubidi_props_dataVersion={0xa,0,0,0}; -static const int32_t ubidi_props_indexes[UBIDI_IX_TOP]={0x10,0x5df0,0x5a78,0x1a,0x620,0x8c0,0x10ac0,0x10af0,0,0,0,0,0,0,0,0x5802b6}; +static const int32_t ubidi_props_indexes[UBIDI_IX_TOP]={0x10,0x6028,0x5cb0,0x1a,0x620,0x8c0,0x10ac0,0x10af0,0,0,0,0,0,0,0,0x6302b6}; -static const uint16_t ubidi_props_trieIndex[11572]={ +static const uint16_t ubidi_props_trieIndex[11856]={ 0x36a,0x372,0x37a,0x382,0x39a,0x3a2,0x3aa,0x3b2,0x38a,0x392,0x38a,0x392,0x38a,0x392,0x38a,0x392, 0x38a,0x392,0x38a,0x392,0x3b8,0x3c0,0x3c8,0x3d0,0x3d8,0x3e0,0x3dc,0x3e4,0x3ec,0x3f4,0x3ef,0x3f7, 0x38a,0x392,0x38a,0x392,0x3ff,0x407,0x38a,0x392,0x38a,0x392,0x38a,0x392,0x40d,0x415,0x41d,0x425, 0x42d,0x435,0x43d,0x445,0x44b,0x453,0x45b,0x463,0x46b,0x473,0x479,0x481,0x489,0x491,0x499,0x4a1, -0x4ad,0x4a9,0x4b5,0x41f,0x41f,0x4c5,0x4cd,0x4bd,0x4d5,0x4d7,0x4df,0x4e7,0x4ef,0x4f0,0x4f8,0x500, -0x508,0x4f0,0x510,0x515,0x508,0x4f0,0x51d,0x525,0x4ef,0x52a,0x532,0x4e7,0x537,0x38a,0x53f,0x543, -0x54b,0x54c,0x554,0x55c,0x4ef,0x564,0x56c,0x4e7,0x4ef,0x38a,0x4f8,0x4e7,0x38a,0x38a,0x572,0x38a, -0x38a,0x578,0x580,0x38a,0x38a,0x584,0x58c,0x38a,0x590,0x597,0x38a,0x59f,0x5a7,0x5ae,0x536,0x38a, -0x38a,0x5b6,0x5be,0x5c6,0x5ce,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x5d6,0x38a,0x5de,0x38a,0x38a,0x38a, -0x5e6,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x5ee,0x38a,0x38a,0x38a,0x5f6,0x5f6,0x4fc,0x4fc,0x38a,0x5fc,0x604,0x5de, -0x61a,0x60c,0x60c,0x622,0x629,0x612,0x38a,0x38a,0x38a,0x631,0x639,0x38a,0x38a,0x38a,0x63b,0x643, -0x64b,0x38a,0x652,0x65a,0x38a,0x662,0x38a,0x38a,0x66a,0x66d,0x537,0x675,0x401,0x67d,0x38a,0x684, -0x38a,0x689,0x38a,0x38a,0x38a,0x38a,0x68f,0x697,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x3d8,0x69f, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x6a7,0x6af,0x6b3, -0x6cb,0x6d1,0x6bb,0x6c3,0x6d9,0x6e1,0x6e5,0x5b1,0x6ed,0x6f5,0x6fd,0x38a,0x705,0x643,0x643,0x643, -0x715,0x71d,0x725,0x72d,0x732,0x73a,0x742,0x70d,0x74a,0x752,0x38a,0x758,0x75f,0x643,0x643,0x765, -0x643,0x562,0x76a,0x643,0x772,0x38a,0x38a,0x640,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643, -0x643,0x643,0x643,0x643,0x643,0x77a,0x643,0x643,0x643,0x643,0x643,0x780,0x643,0x643,0x788,0x790, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x643,0x643,0x643,0x643,0x7a0,0x7a7,0x7af,0x798, -0x7bf,0x7c7,0x7cf,0x7d6,0x7de,0x7e6,0x7ed,0x7b7,0x643,0x643,0x643,0x7f5,0x7fb,0x801,0x809,0x80e, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x815,0x38a,0x38a,0x38a,0x81d,0x38a,0x38a,0x38a,0x3d8, -0x825,0x82d,0x834,0x38a,0x83c,0x643,0x643,0x646,0x643,0x643,0x643,0x643,0x643,0x643,0x843,0x849, -0x859,0x851,0x38a,0x38a,0x861,0x5e6,0x38a,0x3b1,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x643,0x81c, -0x3bf,0x38a,0x838,0x869,0x38a,0x871,0x80e,0x38a,0x38a,0x38a,0x38a,0x879,0x38a,0x38a,0x63b,0x3b0, +0x4ad,0x4a9,0x4b5,0x4bd,0x41f,0x4cd,0x4d5,0x4c5,0x4dd,0x4df,0x4e7,0x4ef,0x4f7,0x4f8,0x500,0x508, +0x510,0x4f8,0x518,0x51d,0x510,0x4f8,0x525,0x52d,0x4f7,0x535,0x53d,0x4ef,0x542,0x38a,0x54a,0x54e, +0x556,0x557,0x55f,0x567,0x4f7,0x56f,0x577,0x4ef,0x401,0x57b,0x500,0x4ef,0x38a,0x38a,0x583,0x38a, +0x38a,0x589,0x591,0x38a,0x38a,0x595,0x59d,0x38a,0x5a1,0x5a8,0x38a,0x5b0,0x5b8,0x5bf,0x541,0x38a, +0x38a,0x5c7,0x5cf,0x5d7,0x5df,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x5e7,0x38a,0x5ef,0x38a,0x38a,0x38a, +0x5f7,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x5ff,0x38a,0x38a,0x38a,0x607,0x607,0x504,0x504,0x38a,0x60d,0x615,0x5ef, +0x62b,0x61d,0x61d,0x633,0x63a,0x623,0x38a,0x38a,0x38a,0x642,0x64a,0x38a,0x38a,0x38a,0x64c,0x654, +0x65c,0x38a,0x663,0x66b,0x38a,0x673,0x38a,0x38a,0x534,0x67b,0x542,0x683,0x401,0x68b,0x38a,0x692, +0x38a,0x697,0x38a,0x38a,0x38a,0x38a,0x69d,0x6a5,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x3d8,0x6ad, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x6b5,0x6bd,0x6c1, +0x6d9,0x6df,0x6c9,0x6d1,0x6e7,0x6ef,0x6f3,0x5c2,0x6fb,0x703,0x70b,0x38a,0x713,0x654,0x654,0x654, +0x723,0x72b,0x733,0x73b,0x740,0x748,0x750,0x71b,0x758,0x760,0x38a,0x766,0x76d,0x654,0x654,0x654, +0x654,0x56d,0x773,0x654,0x77b,0x38a,0x38a,0x651,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654, +0x654,0x654,0x654,0x654,0x654,0x783,0x654,0x654,0x654,0x654,0x654,0x789,0x654,0x654,0x791,0x799, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x654,0x654,0x654,0x654,0x7a9,0x7b0,0x7b8,0x7a1, +0x7c8,0x7d0,0x7d8,0x7df,0x7e7,0x7ef,0x7f6,0x7c0,0x654,0x654,0x654,0x7fe,0x804,0x80a,0x812,0x817, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x81e,0x38a,0x38a,0x38a,0x826,0x38a,0x38a,0x38a,0x3d8, +0x82e,0x836,0x763,0x38a,0x839,0x654,0x654,0x657,0x654,0x654,0x654,0x654,0x654,0x654,0x840,0x846, +0x856,0x84e,0x38a,0x38a,0x85e,0x5f7,0x38a,0x3b1,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x654,0x825, +0x3bf,0x38a,0x866,0x86e,0x38a,0x876,0x817,0x38a,0x38a,0x38a,0x38a,0x87e,0x38a,0x38a,0x64c,0x3b0, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, @@ -54,7 +54,7 @@ static const uint16_t ubidi_props_trieIndex[11572]={ 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x643,0x643, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x654,0x654, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, @@ -98,10 +98,10 @@ static const uint16_t ubidi_props_trieIndex[11572]={ 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x838,0x643,0x562,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x880,0x38a,0x38a,0x885,0x54c,0x38a,0x38a,0x592,0x643,0x63a,0x38a,0x38a,0x88d,0x38a,0x38a,0x38a, -0x895,0x89c,0x60c,0x8a4,0x38a,0x38a,0x8ab,0x8b3,0x38a,0x8ba,0x8c1,0x38a,0x4d5,0x8c6,0x38a,0x4ee, -0x38a,0x8ce,0x8d6,0x4f0,0x38a,0x8da,0x4ef,0x8e2,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x8e9, +0x38a,0x38a,0x38a,0x38a,0x866,0x654,0x56d,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x885,0x38a,0x38a,0x88a,0x557,0x38a,0x38a,0x5a3,0x654,0x64b,0x38a,0x38a,0x892,0x38a,0x38a,0x38a, +0x89a,0x8a1,0x61d,0x8a9,0x38a,0x38a,0x579,0x8b1,0x38a,0x8b8,0x8bf,0x38a,0x4dd,0x8c4,0x38a,0x4f6, +0x38a,0x8cc,0x8d4,0x4f8,0x38a,0x8d8,0x4f7,0x8e0,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x8e7, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, @@ -141,100 +141,100 @@ static const uint16_t ubidi_props_trieIndex[11572]={ 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x8fd,0x8f1,0x8f5,0x489,0x489,0x489,0x489,0x489, -0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x905,0x489,0x489,0x489,0x489,0x90d,0x911, -0x919,0x921,0x925,0x92d,0x489,0x489,0x489,0x931,0x939,0x37a,0x941,0x949,0x38a,0x38a,0x38a,0x951, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x8fb,0x8ef,0x8f3,0x489,0x489,0x489,0x489,0x489, +0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x903,0x489,0x489,0x489,0x489,0x90b,0x90f, +0x917,0x91f,0x923,0x92b,0x489,0x489,0x489,0x92f,0x937,0x37a,0x93f,0x947,0x38a,0x38a,0x38a,0x94f, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0xe28,0xe28,0xe68,0xea8,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xee0,0xf20,0xf60,0xf70,0xfb0,0xfbc, 0xe28,0xe28,0xffc,0xe28,0xe28,0xe28,0x1034,0x1074,0x10b4,0x10f4,0x112c,0x116c,0x11ac,0x11e4,0x1224,0x1264, -0xa40,0xa80,0xac0,0xafa,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xb23,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xb60,0x1a0,0x1a0,0xb95,0xbd5,0xc15,0xc55,0xc95,0xcd5, +0xa40,0xa80,0xac0,0xafa,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xb25,0x1a0,0x1a0, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xb62,0x1a0,0x1a0,0xb97,0xbd7,0xc17,0xc57,0xc97,0xcd7, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, -0xd55,0xd65,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, +0xd57,0xd67,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, 0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0, -0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd15, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x959,0x38a,0x643,0x643,0x961,0x5e6,0x38a,0x4e8, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x969,0x38a,0x38a,0x38a,0x970,0x38a,0x38a,0x38a,0x38a, +0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xd17, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x957,0x38a,0x654,0x654,0x95f,0x5f7,0x38a,0x4f0, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x967,0x38a,0x38a,0x38a,0x96e,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x978,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, -0x980,0x984,0x41f,0x41f,0x41f,0x41f,0x994,0x98c,0x41f,0x99c,0x41f,0x41f,0x9a4,0x9aa,0x41f,0x41f, +0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x976,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, +0x97e,0x982,0x41f,0x41f,0x41f,0x41f,0x992,0x98a,0x41f,0x99a,0x41f,0x41f,0x9a2,0x9a8,0x41f,0x41f, 0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, -0x41f,0x41f,0x41f,0x9b2,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, -0x4ef,0x8ad,0x9ba,0x9c1,0x401,0x9c4,0x38a,0x38a,0x4d5,0x9cc,0x38a,0x9d2,0x401,0x9d7,0x5f8,0x38a, -0x38a,0x9df,0x38a,0x38a,0x38a,0x38a,0x81d,0x9e7,0x401,0x4f0,0x54b,0x9ee,0x38a,0x38a,0x38a,0x38a, -0x38a,0x8ad,0x9f6,0x38a,0x38a,0x9fa,0xa02,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa06,0xa0e,0x38a, -0x38a,0xa16,0x54b,0x832,0x38a,0xa1e,0x38a,0x38a,0x5d6,0xa26,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x41f,0x41f,0x41f,0x9b0,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, +0x4f7,0x9b8,0x9bf,0x9c6,0x401,0x9c9,0x38a,0x38a,0x4dd,0x9d1,0x38a,0x9d7,0x401,0x9dc,0x609,0x38a, +0x38a,0x9e4,0x38a,0x38a,0x38a,0x38a,0x826,0x9ec,0x401,0x4f8,0x556,0x9f3,0x38a,0x38a,0x38a,0x38a, +0x38a,0x9b8,0x9fb,0x38a,0x38a,0x9ff,0xa07,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa0b,0xa13,0x38a, +0x38a,0xa1b,0x556,0xa23,0x38a,0xa29,0x38a,0x38a,0x5e7,0xa31,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa39,0xa3d,0xa45,0x38a,0xa4c,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa53,0x38a,0x38a,0xa61,0xa5b, +0x38a,0x38a,0x38a,0xa69,0xa71,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa75,0x38a,0xa7b,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa2a,0x38a,0x38a,0xa32,0xa38, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa3e,0x38a,0xa44,0x38a,0x38a,0x38a, +0x38a,0xa81,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa4a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x511,0xa89,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0xa90,0xa98,0xa9e,0x38a,0x38a,0x654,0x654,0xaa6,0x38a,0x38a,0x38a,0x38a,0x38a,0x654, +0x654,0xaae,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xab4,0x38a,0xabb, +0x38a,0xab7,0x38a,0xabe,0x38a,0xac6,0xaca,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x3d8,0xad2,0x3d8,0xad9,0xae0,0xae8,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x509,0xa52,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0xa59,0xa61,0xa67,0x38a,0x38a,0x643,0x643,0xa6f,0x38a,0x38a,0x38a,0x38a,0x38a,0x643,0x643,0x767, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xaf0,0xaf8,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xa71,0x38a,0xa78,0x38a,0xa74, -0x38a,0xa7b,0x38a,0xa83,0xa87,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x3d8,0xa8f,0x3d8,0xa96,0xa9d,0xaa5,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0xaad,0xab5,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0x38a,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0xabd,0x41f,0xac5,0xac5,0xacc, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0xb00,0x41f,0xb08, +0xb08,0xb0f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, 0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, -0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f, -0x41f,0x41f,0x41f,0x41f,0x41f,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0xad4,0x41f,0x41f,0x41f, -0x41f,0x41f,0x41f,0x41f,0x41f,0x643,0xadc,0x643,0x643,0x646,0xae1,0xae5,0x843,0xaed,0x38a,0x38a, -0xaf3,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x643,0x643,0x643, -0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643, -0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x643,0x768,0xafb,0x643,0x643,0x643, -0x646,0x643,0x643,0x830,0x38a,0xadc,0x643,0xb03,0x643,0xb0b,0x845,0x38a,0x38a,0xb1b,0xb23,0xb2b, -0x38a,0x844,0x38a,0x5e6,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0xb17,0x41f, +0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x41f,0x654,0xb1f,0x654,0x654,0x657,0xb24,0xb28,0x840,0xb30, +0x38a,0x38a,0xb36,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x764,0x38a,0x38a,0x38a,0x38a,0x654, +0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654, +0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0xb3e,0xb46,0x654, +0x654,0x654,0x657,0x654,0x654,0xb3e,0x38a,0xb1f,0x654,0xb4e,0x654,0xb56,0x842,0x38a,0x38a,0xb1f, +0xb5a,0xb62,0x659,0x656,0x38a,0xb6a,0x56d,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0xb13,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xb72,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, 0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0x38a, -0x38a,0x38a,0x38a,0x38a,0xb13,0xb3b,0xb33,0xb33,0xb33,0xb3c,0xb3c,0xb3c,0xb3c,0x3d8,0x3d8,0x3d8, -0x3d8,0x3d8,0x3d8,0x3d8,0xb44,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c, -0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c, -0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c, -0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0xb3c, -0xb3c,0xb3c,0xb3c,0xb3c,0xb3c,0x369,0x369,0x369,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, +0x38a,0x38a,0x38a,0x38a,0x38a,0x38a,0xb72,0xb82,0xb7a,0xb7a,0xb7a,0xb83,0xb83,0xb83,0xb83,0x3d8, +0x3d8,0x3d8,0x3d8,0x3d8,0x3d8,0x3d8,0xb8b,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83, +0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83, +0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83, +0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83, +0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0xb83,0x369,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, 0x12,8,7,8,9,7,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, 0x12,0x12,0x12,0x12,7,7,7,8,9,0xa,0xa,4,4,4,0xa,0xa, 0x310a,0xf20a,0xa,3,6,3,6,6,2,2,2,2,2,2,2,2, @@ -319,6 +319,8 @@ static const uint16_t ubidi_props_trieIndex[11572]={ 1,1,1,1,1,1,1,1,1,1,0xb1,0xb1,0xb1,0xb1,1,0xb1, 0xb1,0xb1,0xb1,0xb1,0x81,0x41,0x41,0x41,0x41,0x41,0x81,0x81,0x41,0x81,0x41,0x41, 0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x81,0x41,1,1,1,0xb1,0xb1,0xb1, +1,1,1,1,0x4d,0xd,0x4d,0x4d,0x4d,0x4d,0xd,0x8d,0x4d,0x8d,0x8d,0xd, +0xd,0xd,0xd,0xd,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0xb1,0xb1,5,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, 0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, 0xb1,0xb1,0xb1,0xb1,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x8d,0x8d, @@ -346,400 +348,415 @@ static const uint16_t ubidi_props_trieIndex[11572]={ 0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0,0,0, 0,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0, -0,0,0,0,0,4,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,0xb1,0,0,0xb1,0,0xb1,0xb1,0xb1,0xb1,0,0,0, -0,0,0,0,0,0xb1,0,0,0,0,0,0,0,0,0xb1,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,0xb1,0,0,0, -0,0,0,0,0,0,0,0,0,0xb1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xa, -0xa,0xa,0xa,0xa,0xa,4,0xa,0,0,0,0,0,0xb1,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,0xb1,0xb1, -0xb1,0,0,0,0,0,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0,0, -0,0,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0, -0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0, +0,0,0,0,0,4,0,0,0,0,0,0,0,0,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,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,0xb1,0,0,0xa0, -0,0,0,0,0,0,0xa0,0,0,0,0,0,0xb1,0xb1,0,0, +0xb1,0,0,0xb1,0,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0, +0,0xb1,0,0,0,0,0,0,0,0,0xb1,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0xb1,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0xb1,0, +0,0,0,0,0,0,0,0,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0xb1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa, +0xa,4,0xa,0,0,0,0,0,0xb1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,4, -0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, +0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0,0, +0,0,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0, +0,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0xb1,0,0,0xa0,0,0,0,0, +0,0,0xa0,0,0,0,0,0,0xb1,0xb1,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,0xb1,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0xb1,0,0,0,0,0,0,0,0xb1,0xb1, +0xb1,0,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, +0,0,0,4,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1, +0xb1,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,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,0xb1,0xb1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0,0,0, -0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0, +0,0,0,0,0,0xb1,0,0xb1,0,0xb1,0x310a,0xf20a,0x310a,0xf20a,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,0xb1,0xb1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0xb1,0,0xb1,0,0xb1,0x310a,0xf20a,0x310a,0xf20a,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1, -0xb1,0,0xb1,0xb1,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, +0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0,0,0,0,0,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, 0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xb1,0xb1,0,0,0,0,0xb1,0xb1,0xb1,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0,0, -0,0,0,0,0,0,0,0,0,0,0xb1,0,0,0xb1,0xb1,0, -0,0,0,0,0,0xb1,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xb1,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,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0,0,0,0,0,0,0xa,0,0,0,0,0,0,0, +0,0,0,0,0xb1,0xb1,0,0,0,0,0xb1,0xb1,0xb1,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1, +0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0, +0,0xb1,0xb1,0,0,0,0,0,0,0xb1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0xb1,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,9,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0xa,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0x310a,0xf20a,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0, -0,0,0,0,0,0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,4,0,0xb1,0,0, -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, +0,0,0,0,0,0,0,0x310a,0xf20a,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1, +0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0,0,0,0,0,0,0,0,0xb1,0,0,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,4, +0,0xb1,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, -0x40,0xb1,0x40,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x4a, -0xa,0xa,0x2a,0xb1,0xb1,0xb1,0x12,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, +0x40,0x40,0x40,0x40,0x40,0xb1,0x40,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0x4a,0xa,0xa,0x2a,0xb1,0xb1,0xb1,0x12,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, -0,0,0,0,0,0,0,0,0,0xb1,0xb1,0x40,0x40,0x40,0x40,0x40, +0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, -0x40,0x40,0x40,0x40,0xb1,0xb1,0xb1,0,0,0,0,0xb1,0xb1,0,0,0, -0,0,0,0,0,0,0xb1,0,0,0,0,0,0,0xb1,0xb1,0xb1, -0,0,0,0,0xa,0,0,0,0xa,0xa,0,0,0,0,0,0, +0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xb1,0xb1,0xb1,0,0,0,0,0xb1, +0xb1,0,0,0,0,0,0,0,0,0,0xb1,0,0,0,0,0, +0,0xb1,0xb1,0xb1,0,0,0,0,0xa,0,0,0,0xa,0xa,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,0xa,0xa,0xa,0xa,0xa,0xa, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0xb1,0xb1,0,0,0xb1,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0xb1,0xb1,0,0,0xb1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0,0xb1,0, +0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1, +0xb1,0xb1,0,0,0xb1,0xb1,0,0xb1,0xb1,0xb1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0,0xb1,0,0,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0,0,0,0,0,0,0,0, +0xb1,0xb1,0,0,0,0xb1,0,0xb1,0xb1,0xb1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0,0,0,0, +0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0, +0,0xb1,0,0,0,0,0,0,0xb1,0,0,0,0xb1,0xb1,0,0, +0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1, +0xb1,0xb1,0xb1,0xb1,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,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0, -0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0,0xb1, -0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0xb1,0,0xb1,0xb1,0,0,0,0xb1,0,0xb1, -0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0xb1,0,0,0,0,0,0, -0xb1,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,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,0xa,0,0xa,0xa,0xa,0,0, -0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xa,0xa,0,0xa,0xa,0xa,0xa, -6,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,9,0xb2,0xb2,0xb2,0xb2, -0xb2,0x12,0x814,0x815,0x813,0x816,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,2,0,0,0, -2,2,2,2,2,2,3,3,0xa,0x310a,0xf20a,0,9,9,9,9, -9,9,9,9,9,9,9,0xb2,0x412,0x432,0x8a0,0x8a1,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,9,7,0x8ab,0x8ae, -0x8b0,0x8ac,0x8af,6,4,4,4,4,4,0xa,0xa,0xa,0xa,0x300a,0xf00a,0xa, -0xa,0xa,0xa,0xa,2,2,2,2,2,2,2,2,2,2,3,3, -0xa,0x310a,0xf20a,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4, +0,0xa,0,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0, +0,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0, +0,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0, +0,0xa,0xa,0,0xa,0xa,0xa,0xa,6,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,9,0xb2,0xb2,0xb2,0xb2,0xb2,0x12,0x814,0x815,0x813,0x816,0xb2,0xb2, +0xb2,0xb2,0xb2,0xb2,2,0,0,0,2,2,2,2,2,2,3,3, +0xa,0x310a,0xf20a,0,9,9,9,9,9,9,9,9,9,9,9,0xb2, +0x412,0x432,0x8a0,0x8a1,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,9,7,0x8ab,0x8ae,0x8b0,0x8ac,0x8af,6,4,4,4,4, +4,0xa,0xa,0xa,0xa,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,2,2,2,2, +2,2,2,2,2,2,3,3,0xa,0x310a,0xf20a,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xa,0xa,0,0xa,0xa,0xa,0xa,0,0xa,0xa,0,0, -0,0,0,0,0,0,0,0,0xa,0,0xa,0xa,0xa,0,0,0, -0,0,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0,0xa,0,0xa,0,0, -0,0,4,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa, -0,0,0,0,0x100a,0xa,0xa,0xa,0xa,0,0,0,0,0,0xa,0xa, -0xa,0xa,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa, -0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a, -0x300a,0xf00a,0xa,0xa,0x300a,0xf00a,0x900a,0x900a,0x900a,0x100a,0x900a,0x900a,0x100a,0x100a,0x900a,0x900a, -0x900a,0x900a,0x900a,0x100a,0xa,0x100a,0x100a,0x100a,0x100a,0xa,0xa,0xa,0x700a,0x700a,0x700a,0xb00a, -0xb00a,0xb00a,0xa,0xa,0xa,0x100a,3,4,0xa,0x900a,0x100a,0xa,0xa,0xa,0x100a,0x100a, -0x100a,0x100a,0xa,0x100a,0x100a,0x100a,0x100a,0xa,0x100a,0xa,0x100a,0xa,0xa,0xa,0xa,0x100a, -0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0x100a,0xa,0x100a, -0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x100a,0x900a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, -0x100a,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0x100a,0x100a,0xa,0x100a,0xa,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a, -0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a, -0x300a,0xf00a,0x300a,0xf00a,0x100a,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa, -0x900a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0xa,0xa,0x900a,0x100a, -0x900a,0x900a,0x100a,0x900a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a, -0x100a,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0x300a,0xf00a,0x300a,0xf00a,0x900a,0xa,0xa,0x300a,0xf00a,0xa,0xa,0xa,0xa,0x300a,0xf00a, -0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0xa,0xa,0xa,0xa,0xa, +4,4,4,4,4,4,4,4,4,4,4,4,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xa,0xa,0,0xa, +0xa,0xa,0xa,0,0xa,0xa,0,0,0,0,0,0,0,0,0,0, +0xa,0,0xa,0xa,0xa,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa, +0,0xa,0,0xa,0,0xa,0,0,0,0,4,0,0,0,0,0, +0,0,0,0,0,0,0xa,0xa,0,0,0,0,0x100a,0xa,0xa,0xa, +0xa,0,0,0,0,0,0xa,0xa,0xa,0xa,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0, +0,0,0,0,0,0xa,0xa,0xa,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a, +0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0x300a,0xf00a,0x900a,0x900a, +0x900a,0x100a,0x900a,0x900a,0x100a,0x100a,0x900a,0x900a,0x900a,0x900a,0x900a,0x100a,0xa,0x100a,0x100a,0x100a, +0x100a,0xa,0xa,0xa,0x700a,0x700a,0x700a,0xb00a,0xb00a,0xb00a,0xa,0xa,0xa,0x100a,3,4, +0xa,0x900a,0x100a,0xa,0xa,0xa,0x100a,0x100a,0x100a,0x100a,0xa,0x100a,0x100a,0x100a,0x100a,0xa, +0x100a,0xa,0x100a,0xa,0xa,0xa,0xa,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, +0xa,0xa,0xa,0xa,0xa,0x100a,0xa,0x100a,0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x100a,0x900a, +0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a, +0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0xa,0x100a,0xa, +0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a, +0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a,0xa,0xa,0x300a, +0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0x900a,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0x300a,0xf00a,0xa,0xa,0x900a,0x100a,0x900a,0x900a,0x100a,0x900a,0x100a,0x100a,0x100a,0x100a, +0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x900a,0xa,0xa, +0x300a,0xf00a,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0xa,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,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,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a, +0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0x100a,0xa,0xa,0x300a,0xf00a,0x310a,0xf20a,0xa,0x300a,0xf00a,0xa,0x500a, +0x100a,0xd00a,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa, +0x100a,0x300a,0xf00a,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a, +0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0x100a,0xa,0x100a,0x100a,0x100a,0xa,0xa,0x100a,0x100a,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x100a,0x900a,0x100a,0x100a,0x300a,0xf00a,0xa,0xa, +0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a, +0xf20a,0x710a,0x320a,0xf10a,0xb20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0x100a, +0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x900a,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0x300a,0xf00a,0x100a,0x100a,0x300a,0xf00a,0xa,0xa,0xa,0x100a,0xa,0xa,0xa,0xa,0x100a,0x300a, +0xf00a,0x300a,0xf00a,0xa,0x300a,0xf00a,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x100a,0xa,0xa,0xa, +0xa,0xa,0x100a,0x900a,0x900a,0x900a,0x100a,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x100a,0xa, +0xa,0xa,0xa,0x100a,0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x100a,0xa,0x100a,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, +0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0xa,0x100a,0x100a, +0x100a,0x100a,0xa,0xa,0x100a,0xa,0x100a,0xa,0xa,0x100a,0xa,0x300a,0xf00a,0x300a,0xf00a,0xa, +0xa,0xa,0xa,0xa,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x100a,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a, -0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0x100a,0xa,0xa,0x300a,0xf00a,0x310a,0xf20a,0xa,0x300a,0xf00a,0xa,0x500a,0x100a,0xd00a,0xa,0xa, -0xa,0xa,0xa,0x100a,0x100a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0x100a,0x300a,0xf00a,0xa, -0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0x300a,0xf00a,0xa,0xa,0xa,0xa,0x100a,0x100a,0x100a,0x100a,0xa,0x100a,0x100a,0xa,0xa,0x100a, +0x100a,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a, +0xf00a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x300a, +0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x100a, +0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa,0x300a,0xf00a,0x100a,0x100a,0x300a, +0xf00a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a, +0x100a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa, +0xa,0xa,0xa,0xa,0x100a,0xa,0x900a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0xa,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0x100a,0xa,0x100a,0x100a,0x100a,0xa,0xa,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0x100a,0x900a,0x100a,0x100a,0x300a,0xf00a,0xa,0xa,0x310a,0xf20a,0xa,0xa, -0xa,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x710a,0x320a,0xf10a, -0xb20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0x100a,0x100a,0x100a,0x100a,0x100a, -0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0x900a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x100a,0x100a, -0x300a,0xf00a,0xa,0xa,0xa,0x100a,0xa,0xa,0xa,0xa,0x100a,0x300a,0xf00a,0x300a,0xf00a,0xa, -0x300a,0xf00a,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x100a,0xa,0xa,0xa,0xa,0xa,0x100a,0x900a, -0x900a,0x900a,0x100a,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x100a,0xa,0xa,0xa,0xa,0x100a, -0xa,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0x100a,0xa,0x100a,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, -0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0xa,0x100a,0x100a,0x100a,0x100a,0xa,0xa, -0x100a,0xa,0x100a,0xa,0xa,0x100a,0xa,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa, -0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0x100a,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0x100a,0x100a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x300a,0xf00a,0xa,0xa, -0xa,0xa,0x100a,0x100a,0x100a,0x100a,0xa,0x100a,0x100a,0xa,0xa,0x100a,0x100a,0xa,0xa,0xa, -0xa,0x300a,0xf00a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a,0x100a,0x100a, -0x100a,0x100a,0x100a,0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a, -0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x300a,0xf00a,0x100a,0xa,0xa,0x300a,0xf00a, -0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa,0x300a,0xf00a,0x100a,0x100a,0x300a,0xf00a,0x100a,0x100a,0x100a, -0x100a,0x100a,0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x100a,0x100a,0x100a,0x100a,0x100a, -0x100a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa, -0x100a,0xa,0x900a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa, +0xa,0xa,0xa,0,0,0,0,0xb1,0xb1,0xb1,0,0,0,0,0,0, +0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0xb1,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa, +0xa,0x300a,0xf00a,0xa,0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0x300a,0xf00a,0xa,0xa,0x300a,0xf00a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a, +0x310a,0xf20a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0, -0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0, -0,0,0,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,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,0xb1,0xa,0xa,0x300a,0xf00a,0x300a,0xf00a,0xa,0xa,0xa,0x300a,0xf00a,0xa, -0x300a,0xf00a,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0x300a,0xf00a,0xa,0xa,0x300a,0xf00a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0,0,0,0,0xa,0,0,0,0,0,0,0, +0,0,0xb1,0xb1,0xb1,0xb1,0,0,0xa,0,0,0,0,0,0xa,0xa, +0,0,0,0,0,0xa,0xa,0xa,9,0xa,0xa,0xa,0xa,0,0,0, +0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a, +0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0,0,0,0,0xa,0,0,0,0,0,0,0,0,0,0xb1,0xb1, -0xb1,0xb1,0,0,0xa,0,0,0,0,0,0xa,0xa,0,0,0,0, -0,0xa,0xa,0xa,9,0xa,0xa,0xa,0xa,0,0,0,0x310a,0xf20a,0x310a,0xf20a, -0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a, -0xa,0xa,0xa,0xa,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,0xb1,0xb1,0xa, -0xa,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0xb1,0xb1,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xa, 0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0xb1,0xb1,0xb1,0xb1,0xa,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xa,0xa,0,0,0,0,0,0,0,0,0xa,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,0xb1,0,0,0,0xb1,0,0,0,0,0xb1, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0xb1,0xb1,0,0xa,0xa,0xa,0xa,0,0,0,0, -0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0, -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, -0x40,0x40,0x60,0,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0, -0xb1,0xb1,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,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xa,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xa,0xa,0,0,0,0,0,0,0,0, +0xa,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,0xb1,0,0,0,0xb1,0, +0,0,0,0xb1,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0xb1,0xb1,0,0xa,0xa,0xa,0xa, +0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0, +0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, +0x40,0x40,0x40,0x40,0x40,0x40,0x60,0,0xa,0xa,0xa,0xa,0,0,0,0, +0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, 0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xb1,0,0,0xb1,0xb1, -0xb1,0xb1,0,0,0xb1,0,0,0,0,0,0,0,0,0,0,0, -0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0xb1,0xb1,0, -0,0,0,0,0,0,0,0,0,0,0,0xb1,0,0,0,0, -0,0,0,0,0xb1,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xb1,0,0xb1,0xb1,0xb1,0,0,0xb1, -0xb1,0,0,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0, -0,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0xb1,0, -0,0,0,0,0,0,0,0,0,0xb1,0,0,0xb1,0,0,0, -0,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,1,1,1,1,1,3,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xd,0xd,0xd,0xd,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,1,0xb1,1,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, +0,0,0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0,0,0, +0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, +0,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0, +0,0,0,0xb1,0,0,0,0,0,0,0,0,0xb1,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xb1,0,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0,0,0,0xb1,0xb1, +0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0,0, +0,0,0,0,0,0,0xb1,0,0,0,0,0,0,0,0,0, +0,0xb1,0,0,0xb1,0,0,0,0,0xb1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1, +1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xd,0xd,0xd,0xd, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,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,1,0xb1,1,0xd,0xd,0xd,0xd, 0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xd,0xd,0xa,0xa,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xd,0xd,0xd,0xd,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, -0x12,0x12,0x12,0x12,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xd,0xa,0xd,0xd,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0, -0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,6,0xa,6,0,0xa,6,0xa,0xa,0xa,0x310a,0xf20a,0x310a, -0xf20a,0x310a,0xf20a,4,0xa,0xa,3,3,0x300a,0xf00a,0xa,0,0xa,4,4,0xa, -0,0,0,0,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xa,0xa,0xd,0xd,0xd,0xd, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0x12,0x12,0x12,0x12, +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xd,0xd,0xd,0xd, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xa,0xd,0xd,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,6,0xa,6,0, +0xa,6,0xa,0xa,0xa,0x310a,0xf20a,0x310a,0xf20a,0x310a,0xf20a,4,0xa,0xa,3,3, +0x300a,0xf00a,0xa,0,0xa,4,4,0xa,0,0,0,0,0xd,0xd,0xd,0xd, 0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xd,0xd,0xd,0xb2,0,0xa,0xa,4,4,4,0xa,0xa,0x310a,0xf20a,0xa,3, -6,3,6,6,2,2,2,2,2,2,2,2,2,2,6,0xa, -0x500a,0xa,0xd00a,0xa,0xa,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,0x510a, -0xa,0xd20a,0xa,0x310a,0xf20a,0xa,0x310a,0xf20a,0xa,0xa,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,4,4,0xa,0xa,0xa,4,4,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xaa,0xaa,0xaa, -0xa,0xa,0x12,0x12,0,0xa,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,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0,0,0,0,0xb1,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xb2,0,0xa,0xa,4, +4,4,0xa,0xa,0x310a,0xf20a,0xa,3,6,3,6,6,2,2,2,2, +2,2,2,2,2,2,6,0xa,0x500a,0xa,0xd00a,0xa,0xa,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,0x510a,0xa,0xd20a,0xa,0x310a,0xf20a,0xa,0x310a,0xf20a, +0xa,0xa,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,4,4,0xa,0xa, +0xa,4,4,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0x12,0x12,0x12,0x12, +0x12,0x12,0x12,0x12,0x12,0xaa,0xaa,0xaa,0xa,0xa,0x12,0x12,0,0xa,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0xb1,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1, +0xb1,0xb1,0xb1,0,0,0,0,0,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xa, -1,0xb1,0xb1,0xb1,1,0xb1,0xb1,1,1,1,1,1,0xb1,0xb1,0xb1,0xb1, +1,1,1,1,1,1,1,0xa,1,0xb1,0xb1,0xb1,1,0xb1,0xb1,1, +1,1,1,1,0xb1,0xb1,0xb1,0xb1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,0xb1,0xb1,0xb1,1,1,1,1,0xb1, -0x41,0x81,1,1,0x81,0xb1,0xb1,1,1,1,1,0x41,0x41,0x41,0x41,0x81, +0xb1,0xb1,0xb1,1,1,1,1,0xb1,0x41,0x81,1,1,0x81,0xb1,0xb1,1, +1,1,1,0x41,0x41,0x41,0x41,0x81,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,0x41,0x41,0x41,0x41,0x41,0x81,1,0x81, +1,0x81,0x81,1,1,0x61,0x81,0x81,0x81,0x81,0x81,0x41,0x41,0x41,0x41,0x61, +0x41,0x41,0x41,0x41,0x41,0x81,0x41,0x41,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -0x41,0x41,0x41,0x41,0x41,0x81,1,0x81,1,0x81,0x81,1,1,0x61,0x81,0x81, -0x81,0x81,0x81,0x41,0x41,0x41,0x41,0x61,0x41,0x41,0x41,0x41,0x41,0x81,0x41,0x41, +1,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x41,0x81,0x41,0x81,0x81,0x81,0x41,0x41, +0x41,0x81,0x41,0x41,0x81,0x41,0x81,0x81,0x41,0x81,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,0x81,0x81,0x81,0x81,0x41,0x41,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0x41,0x81,0x41,0x81,0x81,0x81,0x41,0x41,0x41,0x81,0x41,0x41,0x81,0x41,0x81,0x81, -0x41,0x81,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,0x81,0x81,0x81,0x81,0x41,0x41,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, -0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0,0,0xa0,0,0, -0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xb1,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0, -0xb1,0,0xb1,0xb1,0,0,0,0,0,0,0xb1,0,0,0,0,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0, +0,0xa0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1, +0xb1,0xb1,0,0,0xb1,0,0xb1,0xb1,0,0,0,0,0,0,0xb1,0, +0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0xb1,0xb1,0xb1,0xb1, +0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1, +0xb1,0,0xb1,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,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0,0,0,0,0xb1,0xb1,0,0xb1,0xb1, +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,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0, -0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0xb1,0, +0xb1,0xb1,0,0,0,0,0,0,0xb1,0xb1,0,0xb1,0xb1,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,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0,0xb1,0,0,0,0,0xb1,0xb1,0,0xb1,0xb1,0,0,0,0, +0,0,0,0,0,0,0,0,0xb1,0xb1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0,0xb1,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1, +0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0,0,0,0, +0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1, 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,0xb1,0xb1,0xb1,0xb1,0,0, -0,0,0,0,0xb1,0xb1,0,0xb1,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0,0,0xb1,0,0xb1,0,0,0,0,0,0,0,0, -0,0,0,0xb1,0,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1, -0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0xb1, -0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xa0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1, +0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0xb1,0,0,0,0, +0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0xb1, 0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0,0xb1,0xb1,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xa0,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1, +0,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0xb1,0, +0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0xb2,0xb2,0xb2,0xb2,0,0,0,0, +0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0, +0,0,0,0,0xb2,0xb2,0xb2,0xb2,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,0xb1,0xb1,0xb1,0,0, -0,0,0,0,0,0,0,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0,0,0,0,0,0, +0,0,0,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,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,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xb1,0xb1, -0xb1,0xa,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,0x100a, +0,0,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xb1,0xb1,0xb1,0xa,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0x100a,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,0x100a, -0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0x100a,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0x100a,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,0x100a,0,0,0,0, +0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0xb1,0,0, -0,0,0,0,0,0,0,0,0xb1,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1, -0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0, +2,2,2,2,2,2,2,2,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0, +0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0,0,0,0,0,0,0,0,0xb1,0,0,0,0,0,0, +0,0,0,0,0xb1,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0,0xb1,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,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,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,1,1,1,1,1, -1,1,1,1,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41, -0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41, -0x41,0x41,0x41,0x41,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xa,0xa,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,1,1,1,1,1,1,1,1,1, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,0xd,0xd,0xd,0xd, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xa,0xa,0xd,0xd, +0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0, +0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +2,2,2,2,2,2,2,2,2,2,2,0xa,0xa,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0xa,0xa,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, 0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,2,2,2,2,2,2,2,2,2,2,2,0xa, -0xa,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0xa,0xa,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa, +0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,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,0x12,0x12,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0,0,0,0,0,0,0,0,0xa,0,0,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,0xa,0xa,0xa,0xa, -0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0xb2,0xb2,0xb2,0xb2, +0,0,0,0,0,0,0x12,0x12,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2, 0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2, -0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0x12,0xb2,0x12,0x12, +0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0xb2,0x12,0xb2,0x12,0x12,0x12,0x12,0x12,0x12, 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, -0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, -0,0,0,0 +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0x12,0x12,0x12,0x12, +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0,0,0,0 }; static const uint32_t ubidi_props_mirrors[26]={ @@ -784,7 +801,7 @@ static const uint8_t ubidi_props_jgArray[672]={ 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, +0x5d,0x5a,0x60,0x63,0x5e,0x5f,0x59,0x61,0x5b,0x5c,0x62,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, @@ -809,13 +826,13 @@ static const UBiDiProps ubidi_props_singleton={ ubidi_props_trieIndex+3496, NULL, 3496, - 8076, + 8360, 0x1a0, 0xe28, 0x0, 0x0, 0x110000, - 0x2d30, + 0x2e4c, NULL, 0, FALSE, FALSE, 0, NULL }, { 2,2,0,0 } diff --git a/deps/icu-small/source/common/ubidiimp.h b/deps/icu-small/source/common/ubidiimp.h index a62d8b259ece03..fd64fac34dea4b 100644 --- a/deps/icu-small/source/common/ubidiimp.h +++ b/deps/icu-small/source/common/ubidiimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ubidiimp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ubidiln.c b/deps/icu-small/source/common/ubidiln.cpp similarity index 99% rename from deps/icu-small/source/common/ubidiln.c rename to deps/icu-small/source/common/ubidiln.cpp index 688ca4c31ed3a3..71c581fe1c713b 100644 --- a/deps/icu-small/source/common/ubidiln.c +++ b/deps/icu-small/source/common/ubidiln.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ubidiln.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ubiditransform.c b/deps/icu-small/source/common/ubiditransform.cpp similarity index 99% rename from deps/icu-small/source/common/ubiditransform.c rename to deps/icu-small/source/common/ubiditransform.cpp index 15e3c7cc941d16..80261d391e753b 100644 --- a/deps/icu-small/source/common/ubiditransform.c +++ b/deps/icu-small/source/common/ubiditransform.cpp @@ -1,12 +1,12 @@ /* ****************************************************************************** * -* Copyright (C) 2016 and later: Unicode, Inc. and others. +* © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html * ****************************************************************************** * file name: ubiditransform.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -165,6 +165,7 @@ action_reorder(UBiDiTransform *pTransform, UErrorCode *pErrorCode) static UBool action_setInverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode) { + (void)pErrorCode; ubidi_setInverse(pTransform->pBidi, TRUE); ubidi_setReorderingMode(pTransform->pBidi, UBIDI_REORDER_INVERSE_LIKE_DIRECT); return FALSE; @@ -183,6 +184,7 @@ action_setInverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode) static UBool action_setRunsOnly(UBiDiTransform *pTransform, UErrorCode *pErrorCode) { + (void)pErrorCode; ubidi_setReorderingMode(pTransform->pBidi, UBIDI_REORDER_RUNS_ONLY); return FALSE; } diff --git a/deps/icu-small/source/common/ubidiwrt.c b/deps/icu-small/source/common/ubidiwrt.cpp similarity index 99% rename from deps/icu-small/source/common/ubidiwrt.c rename to deps/icu-small/source/common/ubidiwrt.cpp index 1d0c36a5d2815b..a89099dad0e700 100644 --- a/deps/icu-small/source/common/ubidiwrt.c +++ b/deps/icu-small/source/common/ubidiwrt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ubidiwrt.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ubrk.cpp b/deps/icu-small/source/common/ubrk.cpp index b02c966b107d7f..f8bdf5a6b65822 100644 --- a/deps/icu-small/source/common/ubrk.cpp +++ b/deps/icu-small/source/common/ubrk.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -20,6 +20,7 @@ #include "unicode/rbbi.h" #include "rbbirb.h" #include "uassert.h" +#include "cmemory.h" U_NAMESPACE_USE @@ -119,7 +120,28 @@ 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, + UErrorCode * status) +{ + if (U_FAILURE(*status)) { + return NULL; + } + if (rulesLength < 0) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return NULL; + } + LocalPointer lpRBBI(new RuleBasedBreakIterator(binaryRules, rulesLength, *status), *status); + if (U_FAILURE(*status)) { + return NULL; + } + UBreakIterator *uBI = reinterpret_cast(lpRBBI.orphan()); + if (text != NULL) { + ubrk_setText(uBI, text, textLength, status); + } + return uBI; +} U_CAPI UBreakIterator * U_EXPORT2 @@ -288,7 +310,8 @@ ubrk_getLocaleByType(const UBreakIterator *bi, } -void ubrk_refreshUText(UBreakIterator *bi, +U_CAPI void U_EXPORT2 +ubrk_refreshUText(UBreakIterator *bi, UText *text, UErrorCode *status) { @@ -296,6 +319,39 @@ void ubrk_refreshUText(UBreakIterator *bi, bii->refreshInputText(text, *status); } +U_CAPI int32_t U_EXPORT2 +ubrk_getBinaryRules(UBreakIterator *bi, + uint8_t * binaryRules, int32_t rulesCapacity, + UErrorCode * status) +{ + if (U_FAILURE(*status)) { + return 0; + } + if ((binaryRules == NULL && rulesCapacity > 0) || rulesCapacity < 0) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + RuleBasedBreakIterator* rbbi; + if ((rbbi = dynamic_cast(reinterpret_cast(bi))) == NULL) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + uint32_t rulesLength; + const uint8_t * returnedRules = rbbi->getBinaryRules(rulesLength); + if (rulesLength > INT32_MAX) { + *status = U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + if (binaryRules != NULL) { // if not preflighting + // Here we know rulesLength <= INT32_MAX and rulesCapacity >= 0, can cast safely + if ((int32_t)rulesLength > rulesCapacity) { + *status = U_BUFFER_OVERFLOW_ERROR; + } else { + uprv_memcpy(binaryRules, returnedRules, rulesLength); + } + } + return (int32_t)rulesLength; +} #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ diff --git a/deps/icu-small/source/common/ubrkimpl.h b/deps/icu-small/source/common/ubrkimpl.h index 36ca6688593b6c..8197f66339e47f 100644 --- a/deps/icu-small/source/common/ubrkimpl.h +++ b/deps/icu-small/source/common/ubrkimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ucase.cpp b/deps/icu-small/source/common/ucase.cpp index 5c9354e73b7da0..1f41dbf6de3edb 100644 --- a/deps/icu-small/source/common/ucase.cpp +++ b/deps/icu-small/source/common/ucase.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucase.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -46,13 +46,6 @@ struct UCaseProps { #define INCLUDED_FROM_UCASE_CPP #include "ucase_props_data.h" -/* UCaseProps singleton ----------------------------------------------------- */ - -U_CAPI const UCaseProps * U_EXPORT2 -ucase_getSingleton() { - return &ucase_props_singleton; -} - /* set of property starts for UnicodeSet ------------------------------------ */ static UBool U_CALLCONV @@ -64,13 +57,13 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 /*end*/, ui } U_CFUNC void U_EXPORT2 -ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *pErrorCode) { +ucase_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) { if(U_FAILURE(*pErrorCode)) { return; } /* add the start code point of each same-value range of the trie */ - utrie2_enum(&csp->trie, NULL, _enumPropertyStartsRange, sa); + utrie2_enum(&ucase_props_singleton.trie, NULL, _enumPropertyStartsRange, sa); /* add code points with hardcoded properties, plus the ones following them */ @@ -133,14 +126,14 @@ static const uint8_t flagsOffset[256]={ /* simple case mappings ----------------------------------------------------- */ U_CAPI UChar32 U_EXPORT2 -ucase_tolower(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_tolower(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)>=UCASE_UPPER) { c+=UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props); + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props); uint16_t excWord=*pe++; if(HAS_SLOT(excWord, UCASE_EXC_LOWER)) { GET_SLOT_VALUE(excWord, UCASE_EXC_LOWER, pe, c); @@ -150,14 +143,14 @@ ucase_tolower(const UCaseProps *csp, UChar32 c) { } U_CAPI UChar32 U_EXPORT2 -ucase_toupper(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_toupper(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)==UCASE_LOWER) { c+=UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props); + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props); uint16_t excWord=*pe++; if(HAS_SLOT(excWord, UCASE_EXC_UPPER)) { GET_SLOT_VALUE(excWord, UCASE_EXC_UPPER, pe, c); @@ -167,14 +160,14 @@ ucase_toupper(const UCaseProps *csp, UChar32 c) { } U_CAPI UChar32 U_EXPORT2 -ucase_totitle(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_totitle(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)==UCASE_LOWER) { c+=UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props); + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props); uint16_t excWord=*pe++; int32_t idx; if(HAS_SLOT(excWord, UCASE_EXC_TITLE)) { @@ -198,7 +191,7 @@ static const UChar iDotTilde[3] = { 0x69, 0x307, 0x303 }; U_CFUNC void U_EXPORT2 -ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa) { +ucase_addCaseClosure(UChar32 c, const USetAdder *sa) { uint16_t props; /* @@ -229,7 +222,7 @@ ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa) { break; } - props=UTRIE2_GET16(&csp->trie, c); + props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)!=UCASE_NONE) { /* add the one simple case mapping, no matter what type it is */ @@ -243,7 +236,7 @@ ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa) { * c has exceptions, so there may be multiple simple and/or * full case mappings. Add them all. */ - const uint16_t *pe0, *pe=GET_EXCEPTIONS(csp, props); + const uint16_t *pe0, *pe=GET_EXCEPTIONS(&ucase_props_singleton, props); const UChar *closure; uint16_t excWord=*pe++; int32_t idx, closureLength, fullLength, length; @@ -338,10 +331,10 @@ strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) { } U_CFUNC UBool U_EXPORT2 -ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa) { +ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa) { int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth; - if(csp->unfold==NULL || s==NULL) { + if(ucase_props_singleton.unfold==NULL || s==NULL) { return FALSE; /* no reverse case folding data, or no string */ } if(length<=1) { @@ -355,7 +348,7 @@ ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length return FALSE; } - const uint16_t *unfold=csp->unfold; + const uint16_t *unfold=ucase_props_singleton.unfold; unfoldRows=unfold[UCASE_UNFOLD_ROWS]; unfoldRowWidth=unfold[UCASE_UNFOLD_ROW_WIDTH]; unfoldStringWidth=unfold[UCASE_UNFOLD_STRING_WIDTH]; @@ -381,7 +374,7 @@ ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length for(i=unfoldStringWidth; iadd(sa->set, c); - ucase_addCaseClosure(csp, c, sa); + ucase_addCaseClosure(c, sa); } return TRUE; } else if(result<0) { @@ -430,38 +423,38 @@ U_NAMESPACE_END /** @return UCASE_NONE, UCASE_LOWER, UCASE_UPPER, UCASE_TITLE */ U_CAPI int32_t U_EXPORT2 -ucase_getType(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_getType(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); return UCASE_GET_TYPE(props); } /** @return same as ucase_getType() and set bit 2 if c is case-ignorable */ U_CAPI int32_t U_EXPORT2 -ucase_getTypeOrIgnorable(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_getTypeOrIgnorable(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); return UCASE_GET_TYPE_AND_IGNORABLE(props); } /** @return UCASE_NO_DOT, UCASE_SOFT_DOTTED, UCASE_ABOVE, UCASE_OTHER_ACCENT */ static inline int32_t -getDotType(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +getDotType(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { return props&UCASE_DOT_MASK; } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props); + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props); return (*pe>>UCASE_EXC_DOT_SHIFT)&UCASE_DOT_MASK; } } U_CAPI UBool U_EXPORT2 -ucase_isSoftDotted(const UCaseProps *csp, UChar32 c) { - return (UBool)(getDotType(csp, c)==UCASE_SOFT_DOTTED); +ucase_isSoftDotted(UChar32 c) { + return (UBool)(getDotType(c)==UCASE_SOFT_DOTTED); } U_CAPI UBool U_EXPORT2 -ucase_isCaseSensitive(const UCaseProps *csp, UChar32 c) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_isCaseSensitive(UChar32 c) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); return (UBool)((props&UCASE_SENSITIVE)!=0); } @@ -545,12 +538,10 @@ ucase_isCaseSensitive(const UCaseProps *csp, UChar32 c) { * zero or more case-ignorable characters. */ -#define is_a(c) ((c)=='a' || (c)=='A') #define is_d(c) ((c)=='d' || (c)=='D') #define is_e(c) ((c)=='e' || (c)=='E') #define is_i(c) ((c)=='i' || (c)=='I') #define is_l(c) ((c)=='l' || (c)=='L') -#define is_n(c) ((c)=='n' || (c)=='N') #define is_r(c) ((c)=='r' || (c)=='R') #define is_t(c) ((c)=='t' || (c)=='T') #define is_u(c) ((c)=='u' || (c)=='U') @@ -565,16 +556,7 @@ ucase_isCaseSensitive(const UCaseProps *csp, UChar32 c) { * Accepts both 2- and 3-letter codes and accepts case variants. */ U_CFUNC int32_t -ucase_getCaseLocale(const char *locale, int32_t *locCache) { - int32_t result; - char c; - - if(locCache!=NULL && (result=*locCache)!=UCASE_LOC_UNKNOWN) { - return result; - } - - result=UCASE_LOC_ROOT; - +ucase_getCaseLocale(const char *locale) { /* * This function used to use uloc_getLanguage(), but the current code * removes the dependency of this low-level code on uloc implementation code @@ -584,73 +566,149 @@ ucase_getCaseLocale(const char *locale, int32_t *locCache) { * Because this code does not want to depend on uloc, the caller must * pass in a non-NULL locale, i.e., may need to call uloc_getDefault(). */ - c=*locale++; - if(is_t(c)) { - /* tr or tur? */ + char c=*locale++; + // Fastpath for English "en" which is often used for default (=root locale) case mappings, + // and for Chinese "zh": Very common but no special case mapping behavior. + // Then check lowercase vs. uppercase to reduce the number of comparisons + // for other locales without special behavior. + if(c=='e') { + /* el or ell? */ c=*locale++; - if(is_u(c)) { + if(is_l(c)) { c=*locale++; - } - if(is_r(c)) { - c=*locale; + if(is_l(c)) { + c=*locale; + } if(is_sep(c)) { - result=UCASE_LOC_TURKISH; + return UCASE_LOC_GREEK; } } - } else if(is_a(c)) { - /* az or aze? */ - c=*locale++; - if(is_z(c)) { + // en, es, ... -> root + } else if(c=='z') { + return UCASE_LOC_ROOT; +#if U_CHARSET_FAMILY==U_ASCII_FAMILY + } else if(c>='a') { // ASCII a-z = 0x61..0x7a, after A-Z +#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY + } else if(c<='z') { // EBCDIC a-z = 0x81..0xa9 with two gaps, before A-Z +#else +# error Unknown charset family! +#endif + // lowercase c + if(c=='t') { + /* tr or tur? */ c=*locale++; - if(is_e(c)) { + if(is_u(c)) { + c=*locale++; + } + if(is_r(c)) { c=*locale; + if(is_sep(c)) { + return UCASE_LOC_TURKISH; + } } - if(is_sep(c)) { - result=UCASE_LOC_TURKISH; + } else if(c=='a') { + /* az or aze? */ + c=*locale++; + if(is_z(c)) { + c=*locale++; + if(is_e(c)) { + c=*locale; + } + if(is_sep(c)) { + return UCASE_LOC_TURKISH; + } } - } - } else if(is_l(c)) { - /* lt or lit? */ - c=*locale++; - if(is_i(c)) { + } else if(c=='l') { + /* lt or lit? */ c=*locale++; - } - if(is_t(c)) { - c=*locale; - if(is_sep(c)) { - result=UCASE_LOC_LITHUANIAN; + if(is_i(c)) { + c=*locale++; } - } - } else if(is_e(c)) { - /* el or ell? */ - c=*locale++; - if(is_l(c)) { + if(is_t(c)) { + c=*locale; + if(is_sep(c)) { + return UCASE_LOC_LITHUANIAN; + } + } + } else if(c=='n') { + /* nl or nld? */ c=*locale++; if(is_l(c)) { + c=*locale++; + if(is_d(c)) { + c=*locale; + } + if(is_sep(c)) { + return UCASE_LOC_DUTCH; + } + } + } + } else { + // uppercase c + // Same code as for lowercase c but also check for 'E'. + if(c=='T') { + /* tr or tur? */ + c=*locale++; + if(is_u(c)) { + c=*locale++; + } + if(is_r(c)) { c=*locale; + if(is_sep(c)) { + return UCASE_LOC_TURKISH; + } } - if(is_sep(c)) { - result=UCASE_LOC_GREEK; + } else if(c=='A') { + /* az or aze? */ + c=*locale++; + if(is_z(c)) { + c=*locale++; + if(is_e(c)) { + c=*locale; + } + if(is_sep(c)) { + return UCASE_LOC_TURKISH; + } } - } - } else if(is_n(c)) { - /* nl or nld? */ - c=*locale++; - if(is_l(c)) { + } else if(c=='L') { + /* lt or lit? */ c=*locale++; - if(is_d(c)) { + if(is_i(c)) { + c=*locale++; + } + if(is_t(c)) { c=*locale; + if(is_sep(c)) { + return UCASE_LOC_LITHUANIAN; + } } - if(is_sep(c)) { - result=UCASE_LOC_DUTCH; + } else if(c=='E') { + /* el or ell? */ + c=*locale++; + if(is_l(c)) { + c=*locale++; + if(is_l(c)) { + c=*locale; + } + if(is_sep(c)) { + return UCASE_LOC_GREEK; + } + } + } else if(c=='N') { + /* nl or nld? */ + c=*locale++; + if(is_l(c)) { + c=*locale++; + if(is_d(c)) { + c=*locale; + } + if(is_sep(c)) { + return UCASE_LOC_DUTCH; + } } } } - - if(locCache!=NULL) { - *locCache=result; - } - return result; + return UCASE_LOC_ROOT; } /* @@ -662,7 +720,7 @@ ucase_getCaseLocale(const char *locale, int32_t *locCache) { * it is also cased or not. */ static UBool -isFollowedByCasedLetter(const UCaseProps *csp, UCaseContextIterator *iter, void *context, int8_t dir) { +isFollowedByCasedLetter(UCaseContextIterator *iter, void *context, int8_t dir) { UChar32 c; if(iter==NULL) { @@ -670,7 +728,7 @@ isFollowedByCasedLetter(const UCaseProps *csp, UCaseContextIterator *iter, void } for(/* dir!=0 sets direction */; (c=iter(context, dir))>=0; dir=0) { - int32_t type=ucase_getTypeOrIgnorable(csp, c); + int32_t type=ucase_getTypeOrIgnorable(c); if(type&4) { /* case-ignorable, continue with the loop */ } else if(type!=UCASE_NONE) { @@ -685,7 +743,7 @@ isFollowedByCasedLetter(const UCaseProps *csp, UCaseContextIterator *iter, void /* Is preceded by Soft_Dotted character with no intervening cc=230 ? */ static UBool -isPrecededBySoftDotted(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { +isPrecededBySoftDotted(UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; @@ -695,7 +753,7 @@ isPrecededBySoftDotted(const UCaseProps *csp, UCaseContextIterator *iter, void * } for(dir=-1; (c=iter(context, dir))>=0; dir=0) { - dotType=getDotType(csp, c); + dotType=getDotType(c); if(dotType==UCASE_SOFT_DOTTED) { return TRUE; /* preceded by TYPE_i */ } else if(dotType!=UCASE_OTHER_ACCENT) { @@ -742,7 +800,7 @@ isPrecededBySoftDotted(const UCaseProps *csp, UCaseContextIterator *iter, void * /* Is preceded by base character 'I' with no intervening cc=230 ? */ static UBool -isPrecededBy_I(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { +isPrecededBy_I(UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; @@ -755,7 +813,7 @@ isPrecededBy_I(const UCaseProps *csp, UCaseContextIterator *iter, void *context) if(c==0x49) { return TRUE; /* preceded by I */ } - dotType=getDotType(csp, c); + dotType=getDotType(c); if(dotType!=UCASE_OTHER_ACCENT) { return FALSE; /* preceded by different base character (not I), or intervening cc==230 */ } @@ -766,7 +824,7 @@ isPrecededBy_I(const UCaseProps *csp, UCaseContextIterator *iter, void *context) /* Is followed by one or more cc==230 ? */ static UBool -isFollowedByMoreAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { +isFollowedByMoreAbove(UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; @@ -776,7 +834,7 @@ isFollowedByMoreAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *c } for(dir=1; (c=iter(context, dir))>=0; dir=0) { - dotType=getDotType(csp, c); + dotType=getDotType(c); if(dotType==UCASE_ABOVE) { return TRUE; /* at least one cc==230 following */ } else if(dotType!=UCASE_OTHER_ACCENT) { @@ -789,7 +847,7 @@ isFollowedByMoreAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *c /* Is followed by a dot above (without cc==230 in between) ? */ static UBool -isFollowedByDotAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { +isFollowedByDotAbove(UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; @@ -802,7 +860,7 @@ isFollowedByDotAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *co if(c==0x307) { return TRUE; } - dotType=getDotType(csp, c); + dotType=getDotType(c); if(dotType!=UCASE_OTHER_ACCENT) { return FALSE; /* next base character or cc==230 in between */ } @@ -812,20 +870,20 @@ isFollowedByDotAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *co } U_CAPI int32_t U_EXPORT2 -ucase_toFullLower(const UCaseProps *csp, UChar32 c, +ucase_toFullLower(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache) { + 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); UChar32 result=c; - uint16_t props=UTRIE2_GET16(&csp->trie, c); + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)>=UCASE_UPPER) { result=c+UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props), *pe2; + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props), *pe2; uint16_t excWord=*pe++; int32_t full; @@ -833,7 +891,6 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c, if(excWord&UCASE_EXC_CONDITIONAL_SPECIAL) { /* use hardcoded conditions and mappings */ - int32_t loc=ucase_getCaseLocale(locale, locCache); /* * Test for conditional mappings first @@ -844,7 +901,7 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c, if( loc==UCASE_LOC_LITHUANIAN && /* base characters, find accents above */ (((c==0x49 || c==0x4a || c==0x12e) && - isFollowedByMoreAbove(csp, iter, context)) || + isFollowedByMoreAbove(iter, context)) || /* precomposed with accent above, no need to find one */ (c==0xcc || c==0xcd || c==0x128)) ) { @@ -896,7 +953,7 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c, 0130; 0069; 0130; 0130; az # LATIN CAPITAL LETTER I WITH DOT ABOVE */ return 0x69; - } else if(loc==UCASE_LOC_TURKISH && c==0x307 && isPrecededBy_I(csp, iter, context)) { + } else if(loc==UCASE_LOC_TURKISH && c==0x307 && isPrecededBy_I(iter, context)) { /* # When lowercasing, remove dot_above in the sequence I + dot_above, which will turn into i. # This matches the behavior of the canonically equivalent I-dot_above @@ -904,8 +961,9 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c, 0307; ; 0307; 0307; tr After_I; # COMBINING DOT ABOVE 0307; ; 0307; 0307; az After_I; # COMBINING DOT ABOVE */ + *pString=nullptr; return 0; /* remove the dot (continue without output) */ - } else if(loc==UCASE_LOC_TURKISH && c==0x49 && !isFollowedByDotAbove(csp, iter, context)) { + } else if(loc==UCASE_LOC_TURKISH && c==0x49 && !isFollowedByDotAbove(iter, context)) { /* # When lowercasing, unless an I is before a dot_above, it turns into a dotless i. @@ -922,8 +980,8 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c, *pString=iDot; return 2; } else if( c==0x3a3 && - !isFollowedByCasedLetter(csp, iter, context, 1) && - isFollowedByCasedLetter(csp, iter, context, -1) /* -1=preceded */ + !isFollowedByCasedLetter(iter, context, 1) && + isFollowedByCasedLetter(iter, context, -1) /* -1=preceded */ ) { /* greek capital sigma maps depending on surrounding cased letters (see SpecialCasing.txt) */ /* @@ -957,21 +1015,21 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c, /* internal */ static int32_t -toUpperOrTitle(const UCaseProps *csp, UChar32 c, +toUpperOrTitle(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache, + 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. U_ASSERT(c >= 0); UChar32 result=c; - uint16_t props=UTRIE2_GET16(&csp->trie, c); + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)==UCASE_LOWER) { result=c+UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props), *pe2; + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props), *pe2; uint16_t excWord=*pe++; int32_t full, idx; @@ -979,8 +1037,6 @@ toUpperOrTitle(const UCaseProps *csp, UChar32 c, if(excWord&UCASE_EXC_CONDITIONAL_SPECIAL) { /* use hardcoded conditions and mappings */ - int32_t loc=ucase_getCaseLocale(locale, locCache); - if(loc==UCASE_LOC_TURKISH && c==0x69) { /* # Turkish and Azeri @@ -994,7 +1050,7 @@ toUpperOrTitle(const UCaseProps *csp, UChar32 c, 0069; 0069; 0130; 0130; az; # LATIN SMALL LETTER I */ return 0x130; - } else if(loc==UCASE_LOC_LITHUANIAN && c==0x307 && isPrecededBySoftDotted(csp, iter, context)) { + } else if(loc==UCASE_LOC_LITHUANIAN && c==0x307 && isPrecededBySoftDotted(iter, context)) { /* # Lithuanian @@ -1004,6 +1060,7 @@ toUpperOrTitle(const UCaseProps *csp, UChar32 c, 0307; 0307; ; ; lt After_Soft_Dotted; # COMBINING DOT ABOVE */ + *pString=nullptr; return 0; /* remove the dot (continue without output) */ } else { /* no known conditional special case mapping, use a normal mapping */ @@ -1052,19 +1109,19 @@ toUpperOrTitle(const UCaseProps *csp, UChar32 c, } U_CAPI int32_t U_EXPORT2 -ucase_toFullUpper(const UCaseProps *csp, UChar32 c, +ucase_toFullUpper(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache) { - return toUpperOrTitle(csp, c, iter, context, pString, locale, locCache, TRUE); + int32_t caseLocale) { + return toUpperOrTitle(c, iter, context, pString, caseLocale, TRUE); } U_CAPI int32_t U_EXPORT2 -ucase_toFullTitle(const UCaseProps *csp, UChar32 c, +ucase_toFullTitle(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache) { - return toUpperOrTitle(csp, c, iter, context, pString, locale, locCache, FALSE); + int32_t caseLocale) { + return toUpperOrTitle(c, iter, context, pString, caseLocale, FALSE); } /* case folding ------------------------------------------------------------- */ @@ -1110,14 +1167,14 @@ ucase_toFullTitle(const UCaseProps *csp, UChar32 c, /* return the simple case folding mapping for c */ U_CAPI UChar32 U_EXPORT2 -ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options) { - uint16_t props=UTRIE2_GET16(&csp->trie, c); +ucase_fold(UChar32 c, uint32_t options) { + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)>=UCASE_UPPER) { c+=UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props); + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props); uint16_t excWord=*pe++; int32_t idx; if(excWord&UCASE_EXC_CONDITIONAL_FOLD) { @@ -1170,19 +1227,19 @@ ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options) { */ U_CAPI int32_t U_EXPORT2 -ucase_toFullFolding(const UCaseProps *csp, UChar32 c, +ucase_toFullFolding(UChar32 c, const UChar **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); UChar32 result=c; - uint16_t props=UTRIE2_GET16(&csp->trie, c); + uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c); if(!PROPS_HAS_EXCEPTION(props)) { if(UCASE_GET_TYPE(props)>=UCASE_UPPER) { result=c+UCASE_GET_DELTA(props); } } else { - const uint16_t *pe=GET_EXCEPTIONS(csp, props), *pe2; + const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props), *pe2; uint16_t excWord=*pe++; int32_t full, idx; @@ -1244,66 +1301,59 @@ ucase_toFullFolding(const UCaseProps *csp, UChar32 c, /* case mapping properties API ---------------------------------------------- */ -#define GET_CASE_PROPS() &ucase_props_singleton - /* public API (see uchar.h) */ U_CAPI UBool U_EXPORT2 u_isULowercase(UChar32 c) { - return (UBool)(UCASE_LOWER==ucase_getType(GET_CASE_PROPS(), c)); + return (UBool)(UCASE_LOWER==ucase_getType(c)); } U_CAPI UBool U_EXPORT2 u_isUUppercase(UChar32 c) { - return (UBool)(UCASE_UPPER==ucase_getType(GET_CASE_PROPS(), c)); + return (UBool)(UCASE_UPPER==ucase_getType(c)); } /* Transforms the Unicode character to its lower case equivalent.*/ U_CAPI UChar32 U_EXPORT2 u_tolower(UChar32 c) { - return ucase_tolower(GET_CASE_PROPS(), c); + return ucase_tolower(c); } /* Transforms the Unicode character to its upper case equivalent.*/ U_CAPI UChar32 U_EXPORT2 u_toupper(UChar32 c) { - return ucase_toupper(GET_CASE_PROPS(), c); + return ucase_toupper(c); } /* Transforms the Unicode character to its title case equivalent.*/ U_CAPI UChar32 U_EXPORT2 u_totitle(UChar32 c) { - return ucase_totitle(GET_CASE_PROPS(), c); + return ucase_totitle(c); } /* return the simple case folding mapping for c */ U_CAPI UChar32 U_EXPORT2 u_foldCase(UChar32 c, uint32_t options) { - return ucase_fold(GET_CASE_PROPS(), c, options); + return ucase_fold(c, options); } U_CFUNC int32_t U_EXPORT2 ucase_hasBinaryProperty(UChar32 c, UProperty which) { /* case mapping properties */ const UChar *resultString; - int32_t locCache; - const UCaseProps *csp=GET_CASE_PROPS(); - if(csp==NULL) { - return FALSE; - } switch(which) { case UCHAR_LOWERCASE: - return (UBool)(UCASE_LOWER==ucase_getType(csp, c)); + return (UBool)(UCASE_LOWER==ucase_getType(c)); case UCHAR_UPPERCASE: - return (UBool)(UCASE_UPPER==ucase_getType(csp, c)); + return (UBool)(UCASE_UPPER==ucase_getType(c)); case UCHAR_SOFT_DOTTED: - return ucase_isSoftDotted(csp, c); + return ucase_isSoftDotted(c); case UCHAR_CASE_SENSITIVE: - return ucase_isCaseSensitive(csp, c); + return ucase_isCaseSensitive(c); case UCHAR_CASED: - return (UBool)(UCASE_NONE!=ucase_getType(csp, c)); + return (UBool)(UCASE_NONE!=ucase_getType(c)); case UCHAR_CASE_IGNORABLE: - return (UBool)(ucase_getTypeOrIgnorable(csp, c)>>2); + return (UBool)(ucase_getTypeOrIgnorable(c)>>2); /* * Note: The following Changes_When_Xyz are defined as testing whether * the NFD form of the input changes when Xyz-case-mapped. @@ -1317,21 +1367,17 @@ ucase_hasBinaryProperty(UChar32 c, UProperty which) { * start sets for normalization and case mappings. */ case UCHAR_CHANGES_WHEN_LOWERCASED: - locCache=UCASE_LOC_ROOT; - return (UBool)(ucase_toFullLower(csp, c, NULL, NULL, &resultString, "", &locCache)>=0); + return (UBool)(ucase_toFullLower(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0); case UCHAR_CHANGES_WHEN_UPPERCASED: - locCache=UCASE_LOC_ROOT; - return (UBool)(ucase_toFullUpper(csp, c, NULL, NULL, &resultString, "", &locCache)>=0); + return (UBool)(ucase_toFullUpper(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0); case UCHAR_CHANGES_WHEN_TITLECASED: - locCache=UCASE_LOC_ROOT; - return (UBool)(ucase_toFullTitle(csp, c, NULL, NULL, &resultString, "", &locCache)>=0); + return (UBool)(ucase_toFullTitle(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0); /* case UCHAR_CHANGES_WHEN_CASEFOLDED: -- in uprops.c */ case UCHAR_CHANGES_WHEN_CASEMAPPED: - locCache=UCASE_LOC_ROOT; return (UBool)( - ucase_toFullLower(csp, c, NULL, NULL, &resultString, "", &locCache)>=0 || - ucase_toFullUpper(csp, c, NULL, NULL, &resultString, "", &locCache)>=0 || - ucase_toFullTitle(csp, c, NULL, NULL, &resultString, "", &locCache)>=0); + ucase_toFullLower(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0 || + ucase_toFullUpper(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0 || + ucase_toFullTitle(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0); default: return FALSE; } diff --git a/deps/icu-small/source/common/ucase.h b/deps/icu-small/source/common/ucase.h index 29ea71a533d8c5..9d6365eadfcca2 100644 --- a/deps/icu-small/source/common/ucase.h +++ b/deps/icu-small/source/common/ucase.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucase.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -37,18 +37,8 @@ U_NAMESPACE_END /* library API -------------------------------------------------------------- */ -U_CDECL_BEGIN - -struct UCaseProps; -typedef struct UCaseProps UCaseProps; - -U_CDECL_END - -U_CAPI const UCaseProps * U_EXPORT2 -ucase_getSingleton(void); - U_CFUNC void U_EXPORT2 -ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *pErrorCode); +ucase_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode); /** * Requires non-NULL locale ID but otherwise does the equivalent of @@ -56,7 +46,7 @@ ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode * * Accepts both 2- and 3-letter codes and accepts case variants. */ U_CFUNC int32_t -ucase_getCaseLocale(const char *locale, int32_t *locCache); +ucase_getCaseLocale(const char *locale); /* Casing locale types for ucase_getCaseLocale */ enum { @@ -71,7 +61,7 @@ enum { /** * Bit mask for getting just the options from a string compare options word * that are relevant for case-insensitive string comparison. - * See uchar.h. Also include _STRNCMP_STYLE and U_COMPARE_CODE_POINT_ORDER. + * See stringoptions.h. Also include _STRNCMP_STYLE and U_COMPARE_CODE_POINT_ORDER. * @internal */ #define _STRCASECMP_OPTIONS_MASK 0xffff @@ -79,24 +69,30 @@ enum { /** * Bit mask for getting just the options from a string compare options word * that are relevant for case folding (of a single string or code point). - * See uchar.h. + * + * Currently only bit 0 for U_FOLD_CASE_EXCLUDE_SPECIAL_I. + * It is conceivable that at some point we might use one more bit for using uppercase sharp s. + * It is conceivable that at some point we might want the option to use only simple case foldings + * when operating on strings. + * + * See stringoptions.h. * @internal */ -#define _FOLD_CASE_OPTIONS_MASK 0xff +#define _FOLD_CASE_OPTIONS_MASK 7 /* single-code point functions */ U_CAPI UChar32 U_EXPORT2 -ucase_tolower(const UCaseProps *csp, UChar32 c); +ucase_tolower(UChar32 c); U_CAPI UChar32 U_EXPORT2 -ucase_toupper(const UCaseProps *csp, UChar32 c); +ucase_toupper(UChar32 c); U_CAPI UChar32 U_EXPORT2 -ucase_totitle(const UCaseProps *csp, UChar32 c); +ucase_totitle(UChar32 c); U_CAPI UChar32 U_EXPORT2 -ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options); +ucase_fold(UChar32 c, uint32_t options); /** * Adds all simple case mappings and the full case folding for c to sa, @@ -108,7 +104,7 @@ ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options); * - for k include the Kelvin sign */ U_CFUNC void U_EXPORT2 -ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa); +ucase_addCaseClosure(UChar32 c, const USetAdder *sa); /** * Maps the string to single code points and adds the associated case closure @@ -123,7 +119,7 @@ ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa); * @return TRUE if the string was found */ U_CFUNC UBool U_EXPORT2 -ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa); +ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa); #ifdef __cplusplus U_NAMESPACE_BEGIN @@ -157,17 +153,17 @@ U_NAMESPACE_END /** @return UCASE_NONE, UCASE_LOWER, UCASE_UPPER, UCASE_TITLE */ U_CAPI int32_t U_EXPORT2 -ucase_getType(const UCaseProps *csp, UChar32 c); +ucase_getType(UChar32 c); /** @return like ucase_getType() but also sets UCASE_IGNORABLE if c is case-ignorable */ U_CAPI int32_t U_EXPORT2 -ucase_getTypeOrIgnorable(const UCaseProps *csp, UChar32 c); +ucase_getTypeOrIgnorable(UChar32 c); U_CAPI UBool U_EXPORT2 -ucase_isSoftDotted(const UCaseProps *csp, UChar32 c); +ucase_isSoftDotted(UChar32 c); U_CAPI UBool U_EXPORT2 -ucase_isCaseSensitive(const UCaseProps *csp, UChar32 c); +ucase_isCaseSensitive(UChar32 c); /* string case mapping functions */ @@ -240,10 +236,7 @@ enum { * @param context Pointer to be passed into iter. * @param pString If the mapping result is a string, then the pointer is * written to *pString. - * @param locale Locale ID for locale-dependent mappings. - * @param locCache Initialize to 0; may be used to cache the result of parsing - * the locale ID for subsequent calls. - * Can be NULL. + * @param caseLocale Case locale value from ucase_getCaseLocale(). * @return Output code point or string length, see UCASE_MAX_STRING_LENGTH. * * @see UCaseContextIterator @@ -251,25 +244,25 @@ enum { * @internal */ U_CAPI int32_t U_EXPORT2 -ucase_toFullLower(const UCaseProps *csp, UChar32 c, +ucase_toFullLower(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache); + int32_t caseLocale); U_CAPI int32_t U_EXPORT2 -ucase_toFullUpper(const UCaseProps *csp, UChar32 c, +ucase_toFullUpper(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache); + int32_t caseLocale); U_CAPI int32_t U_EXPORT2 -ucase_toFullTitle(const UCaseProps *csp, UChar32 c, +ucase_toFullTitle(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache); + int32_t caseLocale); U_CAPI int32_t U_EXPORT2 -ucase_toFullFolding(const UCaseProps *csp, UChar32 c, +ucase_toFullFolding(UChar32 c, const UChar **pString, uint32_t options); @@ -283,10 +276,10 @@ U_CDECL_BEGIN * @internal */ typedef int32_t U_CALLCONV -UCaseMapFull(const UCaseProps *csp, UChar32 c, +UCaseMapFull(UChar32 c, UCaseContextIterator *iter, void *context, const UChar **pString, - const char *locale, int32_t *locCache); + int32_t caseLocale); U_CDECL_END diff --git a/deps/icu-small/source/common/ucase_props_data.h b/deps/icu-small/source/common/ucase_props_data.h index aa51bac691c9da..fe620efc6e2cbc 100644 --- a/deps/icu-small/source/common/ucase_props_data.h +++ b/deps/icu-small/source/common/ucase_props_data.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // Copyright (C) 1999-2016, International Business Machines @@ -11,36 +11,36 @@ #ifdef INCLUDED_FROM_UCASE_CPP -static const UVersionInfo ucase_props_dataVersion={9,0,0,0}; +static const UVersionInfo ucase_props_dataVersion={0xa,0,0,0}; -static const int32_t ucase_props_indexes[UCASE_IX_TOP]={0x10,0x6c6c,0x5a10,0x79c,0x172,0,0,0,0,0,0,0,0,0,0,3}; +static const int32_t ucase_props_indexes[UCASE_IX_TOP]={0x10,0x6dfc,0x5ba0,0x79c,0x172,0,0,0,0,0,0,0,0,0,0,3}; -static const uint16_t ucase_props_trieIndex[11520]={ +static const uint16_t ucase_props_trieIndex[11720]={ 0x327,0x32f,0x337,0x33f,0x34d,0x355,0x35d,0x365,0x36d,0x375,0x37c,0x384,0x38c,0x394,0x39c,0x3a4, 0x3aa,0x3b2,0x3ba,0x3c2,0x3ca,0x3d2,0x3da,0x3e2,0x3ea,0x3f2,0x3fa,0x402,0x40a,0x412,0x41a,0x422, 0x42a,0x432,0x43a,0x442,0x44a,0x452,0x45a,0x462,0x45e,0x466,0x46b,0x473,0x47a,0x482,0x48a,0x492, 0x49a,0x4a2,0x4aa,0x4b2,0x346,0x34e,0x4b7,0x4bf,0x4c4,0x4cc,0x4d4,0x4dc,0x4db,0x4e3,0x4e8,0x4f0, 0x4f7,0x4fe,0x502,0x346,0x346,0x327,0x512,0x50a,0x51a,0x51c,0x524,0x52c,0x530,0x531,0x539,0x541, -0x549,0x531,0x551,0x556,0x549,0x531,0x55e,0x541,0x530,0x562,0x56a,0x541,0x56f,0x346,0x577,0x346, -0x4a1,0x4dd,0x57f,0x541,0x530,0x562,0x586,0x541,0x530,0x346,0x539,0x541,0x346,0x346,0x58c,0x346, -0x346,0x592,0x599,0x346,0x346,0x59d,0x5a5,0x346,0x5a9,0x5b0,0x346,0x5b7,0x5bf,0x5c6,0x5ce,0x346, -0x346,0x5d3,0x5db,0x5e3,0x5eb,0x5f3,0x5fb,0x490,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x5ff,0x346,0x346,0x60f,0x617,0x607, +0x549,0x531,0x551,0x556,0x549,0x531,0x55e,0x566,0x530,0x56e,0x576,0x541,0x57b,0x346,0x583,0x346, +0x4a1,0x4dd,0x58b,0x541,0x530,0x56e,0x592,0x541,0x59a,0x59c,0x539,0x541,0x346,0x346,0x5a4,0x346, +0x346,0x5aa,0x5b1,0x346,0x346,0x5b5,0x5bd,0x346,0x5c1,0x5c8,0x346,0x5cf,0x5d7,0x5de,0x5e6,0x346, +0x346,0x5eb,0x5f3,0x5fb,0x603,0x60b,0x613,0x490,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x617,0x346,0x346,0x627,0x62f,0x61f, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x61f,0x61f,0x53d,0x53d,0x346,0x625,0x62d,0x346, -0x635,0x346,0x63d,0x346,0x548,0x643,0x346,0x346,0x346,0x64b,0x346,0x346,0x346,0x346,0x346,0x346, -0x652,0x346,0x659,0x661,0x346,0x669,0x346,0x346,0x671,0x674,0x67c,0x682,0x68a,0x692,0x346,0x699, -0x346,0x69e,0x346,0x6a4,0x6ac,0x346,0x6b0,0x6b8,0x6c0,0x6c5,0x6c8,0x6d0,0x6e0,0x6d8,0x6f0,0x6e8, -0x36d,0x6f8,0x36d,0x700,0x703,0x36d,0x70b,0x36d,0x713,0x71b,0x723,0x72b,0x733,0x73b,0x743,0x74b, -0x753,0x75a,0x346,0x762,0x76a,0x346,0x772,0x77a,0x782,0x78a,0x792,0x79a,0x7a2,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x637,0x637,0x53d,0x53d,0x346,0x63d,0x645,0x346, +0x64d,0x346,0x655,0x346,0x548,0x65b,0x346,0x346,0x346,0x663,0x346,0x346,0x346,0x346,0x346,0x346, +0x66a,0x346,0x671,0x679,0x346,0x681,0x346,0x346,0x56d,0x689,0x691,0x697,0x59a,0x69f,0x346,0x6a6, +0x346,0x6ab,0x346,0x6b1,0x6b9,0x346,0x6bd,0x6c5,0x6cd,0x6d2,0x6d5,0x6dd,0x6ed,0x6e5,0x6fd,0x6f5, +0x36d,0x705,0x36d,0x70d,0x710,0x36d,0x718,0x36d,0x720,0x728,0x730,0x738,0x740,0x748,0x750,0x758, +0x760,0x767,0x346,0x76f,0x777,0x346,0x77f,0x787,0x78f,0x797,0x79f,0x7a7,0x7af,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x7a5,0x7ab,0x7b1,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x7b2,0x7b8,0x7be,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x7b9,0x7be,0x7c2,0x7ca,0x36d,0x36d,0x36d,0x7d2,0x7da,0x7e2,0x346,0x7e7,0x346,0x346,0x346,0x7ef, -0x346,0x63a,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x52f,0x7f7,0x346,0x346,0x7fe,0x346,0x346,0x806,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x7c6,0x7cb,0x7cf,0x7d7,0x36d,0x36d,0x36d,0x7df,0x7e7,0x7ef,0x346,0x7f4,0x346,0x346,0x346,0x7fc, +0x346,0x652,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x52f,0x804,0x346,0x346,0x80b,0x346,0x346,0x813,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, @@ -96,12 +96,12 @@ static const uint16_t ucase_props_trieIndex[11520]={ 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x80e,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x81b,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x6a4,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x814,0x346,0x81c,0x821,0x829,0x346,0x346,0x831,0x839,0x841,0x36d,0x846,0x84e,0x854,0x346,0x85a, -0x862,0x548,0x346,0x346,0x346,0x346,0x869,0x871,0x346,0x878,0x87f,0x346,0x51a,0x884,0x88c,0x548, -0x346,0x892,0x89a,0x89e,0x346,0x8a6,0x8ae,0x8b6,0x346,0x8bc,0x8c0,0x8c8,0x8d8,0x8d0,0x346,0x8e0, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x6b1,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x821,0x346,0x829,0x82e,0x836,0x346,0x346,0x83e,0x846,0x84e,0x36d,0x853,0x85b,0x861,0x346,0x867, +0x86f,0x548,0x346,0x346,0x346,0x346,0x876,0x87e,0x346,0x885,0x88c,0x346,0x51a,0x891,0x899,0x548, +0x346,0x89f,0x8a7,0x8ab,0x346,0x8b3,0x8bb,0x8c3,0x346,0x8c9,0x8cd,0x8d5,0x8e5,0x8dd,0x346,0x8ed, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, @@ -141,15 +141,15 @@ static const uint16_t ucase_props_trieIndex[11520]={ 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x8e8,0x346,0x346,0x346,0x346,0x8f0,0x68a,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x8f5,0x346,0x346,0x346,0x346,0x8fd,0x59a,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x8f5,0x8fd,0x901,0x346,0x346,0x346,0x346,0x329,0x32f,0x909,0x911,0x918,0x4dd,0x346,0x346,0x920, +0x902,0x90a,0x90e,0x346,0x346,0x346,0x346,0x329,0x32f,0x916,0x91e,0x925,0x4dd,0x346,0x346,0x92d, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0xd1c,0xd1c,0xd34,0xd74,0xdb4,0xdf0,0xe30,0xe70,0xea8,0xee8,0xf28,0xf68,0xfa8,0xfe8,0x1028,0x1068, 0x10a8,0x10e8,0x1128,0x1168,0x1178,0x11ac,0x11e8,0x1228,0x1268,0x12a8,0xd18,0x12dc,0x1310,0x1350,0x136c,0x13a0, -0x9e1,0xa11,0xa51,0xa8c,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xab5,0x188,0x188, -0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xaf5,0x188,0x188,0xb2a,0xb69,0xba9,0xbe3,0xc1a,0x188, +0x9e1,0xa11,0xa51,0xa8c,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xab7,0x188,0x188, +0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xaf7,0x188,0x188,0xb2c,0xb6b,0xbab,0xbe5,0xc1c,0x188, 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, @@ -174,50 +174,50 @@ static const uint16_t ucase_props_trieIndex[11520]={ 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, 0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188, -0xc5a,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x63e,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x928,0x346,0x346,0x346,0x92b,0x346,0x346,0x346, -0x346,0x933,0x939,0x93d,0x346,0x346,0x941,0x945,0x94b,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0xc5c,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x656,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x935,0x346,0x346,0x346,0x938,0x346,0x346,0x346, +0x346,0x940,0x946,0x94a,0x346,0x346,0x94e,0x952,0x958,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x953,0x957,0x346,0x346,0x346,0x346,0x346,0x95f,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x967,0x96b,0x973,0x977,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x960,0x964,0x346,0x346,0x346,0x346,0x346,0x96c,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x974,0x978,0x980,0x984,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x530,0x97c,0x983,0x985,0x68a,0x98d,0x346,0x346,0x995,0x99c,0x346,0x988,0x68a,0x9a2,0x9aa, -0x346,0x346,0x9af,0x346,0x346,0x346,0x346,0x329,0x9b7,0x68a,0x531,0x9bf,0x9c6,0x346,0x346,0x346, -0x346,0x346,0x97c,0x9ce,0x346,0x346,0x9d2,0x9da,0x346,0x346,0x346,0x346,0x346,0x346,0x9de,0x9e6, -0x346,0x346,0x9ee,0x4a1,0x346,0x346,0x9f6,0x346,0x346,0x9fc,0xa04,0x346,0x346,0x346,0x346,0x346, -0x346,0xa0c,0xa14,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa1c,0x346,0x346, -0x8f0,0xa24,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa2a,0x346,0xa30,0x671, +0x346,0x530,0x989,0x990,0x59b,0x59a,0x994,0x346,0x346,0x99c,0x9a3,0x346,0x9a9,0x59a,0x9ae,0x9b6, +0x346,0x346,0x9bb,0x346,0x346,0x346,0x346,0x329,0x9c3,0x59a,0x531,0x9cb,0x9d2,0x346,0x346,0x346, +0x346,0x346,0x989,0x9da,0x346,0x346,0x9de,0x9e6,0x346,0x346,0x346,0x346,0x346,0x346,0x9ea,0x9f2, +0x346,0x346,0x9fa,0x4a1,0x346,0x346,0xa02,0x346,0x346,0xa08,0xa10,0x346,0x346,0x346,0x346,0x346, +0x346,0xa18,0xa20,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa28,0xa2c,0xa34,0x346, +0xa3b,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa42,0x346,0x346, +0x8fd,0xa4a,0x346,0x346,0x346,0xa50,0xa58,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa5c,0x346, +0xa62,0x56d,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0xa68,0x346,0x346,0x59a,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0xa36,0x346,0x346,0x4a1,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa70,0x56d,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa3e,0x671,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa78,0xa80,0xa86,0x346,0x346,0x346,0x346,0xa8e,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa96,0xa9e,0xaa3,0xaa9, +0xab1,0xab9,0xac1,0xa9a,0xac9,0xad1,0xad9,0xae0,0xa9b,0xa96,0xa9e,0xa99,0xaa9,0xa9c,0xa97,0xae8, +0xa9a,0xaf0,0xaf8,0xb00,0xb07,0xaf3,0xafb,0xb03,0xb0a,0xaf6,0xb12,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x846,0xb1a,0x846,0xb21,0xb28, +0xb30,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0xa46,0xa4e,0xa54,0x346,0x346,0x346,0x346,0xa5c,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xa64,0xa6c,0xa71,0xa77,0xa7f,0xa87, -0xa8f,0xa68,0xa97,0xa9f,0xaa7,0xaae,0xa69,0xa64,0xa6c,0xa67,0xa77,0xa6a,0xa65,0xab6,0xa68,0xabe, -0xac6,0xace,0xad5,0xac1,0xac9,0xad1,0xad8,0xac4,0xae0,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x839,0xae8,0x839,0xaef,0xaf6,0xafe,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xb38,0xb40,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xb06,0xb0e,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xb44,0x346,0xb4c,0xb54,0xb5b, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0xb12,0x346,0xb1a,0xb22,0xb29,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0xa92,0xb63,0xb63,0xb69,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x99e,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x530,0x846,0x846,0x846, +0x346,0x346,0x346,0x346,0x846,0x846,0x846,0x846,0x846,0x846,0x846,0xa6c,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0xa60,0xb31,0xb31,0xb37,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x997,0x346,0x346,0x346,0x346,0x346,0x346, 0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x530,0x839,0x839,0x839,0x346,0x346, -0x346,0x346,0x839,0x839,0x839,0x839,0x839,0x839,0x839,0xa3a,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346, -0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x326,0x326,0,0,0,0, +0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,0x346,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,4,0,0,0,0,0,0,4,0,0,0,0,0, @@ -361,6 +361,9 @@ static const uint16_t ucase_props_trieIndex[11520]={ 0,0,0,0,0,0,0,0,4,4,0,0,0,4,0,0, 0,0,0,0,0,0,0,0,0,4,4,4,4,4,0,4, 4,0,0,0,0,0x64,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,4,4,4,4,4,4,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,0x64,0,0,4,0,4,4,4,4,0,0,0, 0,0,0,0,0,0x64,0,0,0,0,0,0,0,0,4,0, @@ -371,6 +374,9 @@ static const uint16_t ucase_props_trieIndex[11520]={ 0,0,4,4,4,0,4,4,4,0x64,0,0,0,0,0,0, 0,0x64,0x64,0,0,0,0,0,0,0,0,0,0,0,4,0, 0,0,0,0,4,0x64,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,4,4,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,0x64,0x64,0,0,0, 0,0,0,0,0,0,0,0,0,0,0x64,0,0,0,0,0, 0,0,4,4,4,0,4,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,4,0,0,4,4,4,4, @@ -428,211 +434,208 @@ static const uint16_t ucase_props_trieIndex[11520]={ 4,0,0,0,0,0,0,4,4,0x44,0x44,0x44,0x44,0x44,0x44,0x44, 0x44,0,0,0x64,0,0,0,0,0,0,0,4,0,0,0,0, 0,0,0,0,0x44,0x44,0x44,0x44,0x44,0x64,0x64,0x64,0x64,0x64,0x64,0x44, -0x44,0x64,4,0,4,4,4,4,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,0x64,0,4,4,4,4,4,0,4,0,0,0, -0,0,4,0,0x60,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,0x44,0x64,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0,0,0, -0,0,0,0,0,0,0,0,4,4,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,4,4,4,4,0,0, -4,4,0x60,0x64,4,4,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x64,0,4,4,0,0, -0,4,0,4,4,4,0x60,0x60,0,0,0,0,0,0,0,0, -0,0,0,0,4,4,4,4,4,4,4,4,0,0,4,0x64, +0x44,0x64,4,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x64,0,4,4,4,4,4,0, +4,0,0,0,0,0,4,0,0x60,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,4,4,4,4,4,4,0,0, -0x5cd9,0x5d39,0x5d99,0x5df9,0x5e59,0x5ef9,0x5f99,0x5ff9,0x6059,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x44,0x44,0x44,0,0x64,0x64,0x64,0x64,0x64,0x64,0x44,0x44,0x64,0x64,0x64,0x64, -0x44,0,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0,0,0,0,0x64,0,0, -0,0,0,0,0x44,0,0,0,0x44,0x44,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0,0,0,0,0,0,0,0x44,0x64,0x44,0x44,0x44,0x44,0x44,0x44,0x44, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4, +4,4,0,0,4,4,0x60,0x64,4,4,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x64,0, +4,4,0,0,0,4,0,4,4,4,0x60,0x60,0,0,0,0, +0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4, +0,0,4,0x64,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4, +4,4,0,0,0x5cd9,0x5d39,0x5d99,0x5df9,0x5e59,0x5ef9,0x5f99,0x5ff9,0x6059,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0x44,0x44,0x44,0,0x64,0x64,0x64,0x64,0x64,0x64,0x44,0x44, +0x64,0x64,0x64,0x64,0x44,0,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0,0,0, +0,0x64,0,0,0,0,0,0,0x44,0,0,0,0x44,0x44,0,0, +0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,0x25,5,5,5,5,5,5,5,5,1, +1,1,1,1,1,1,1,1,1,1,1,1,5,0x60b9,1,1, +1,0x60f9,1,1,5,5,5,5,0x25,5,5,5,0x25,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0x25,5,5,5,5,5,5,5,5,1,1,1,1,1, -1,1,1,1,1,1,1,1,5,0x60b9,1,1,1,0x60f9,1,1, -5,5,5,5,0x25,5,5,5,0x25,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,0x21,1,1,1,1,5,5,5,5,5, -0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, -0x44,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0,0x44,0x64,0x64,0x44,0x64, -0x44,0x44,0x64,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x64,0x44,0x44,0x64,0x64,0x64, -0x64,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, -0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xffa9,0x8a,0xff89, +5,5,5,5,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,0x21,1,1,1,1,5, +5,5,5,5,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, +0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x64,0x64,0x64,0x64,0,0x44, +0x64,0x64,0x44,0x64,0x44,0x44,0x64,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x64,0x44, +0x44,0x64,0x64,0x64,0x64,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, +0x44,0x44,0x44,0x44,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xffa9,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xff89,0x8a,0xff89,0x613a,0x61b9,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, 0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -0x613a,0x61b9,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x6239,0x6339,0x6439,0x6539,0x6639,0x6739,1,1,0x679a,1, +0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xffa9,0x8a,0xff89,0x8a,0xff89, 0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -0x8a,0xff89,0x6239,0x6339,0x6439,0x6539,0x6639,0x6739,1,1,0x679a,1,0x8a,0xff89,0x8a,0xff89, -0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xffa9,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x409,0x409,0x409,0x409, -0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0x409,0x409,0x409,0x409, -0x409,0x409,0,0,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0,0,0x409,0x409,0x409,0x409, -0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0x409,0x409,0x409,0x409, -0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0x409,0x409,0x409,0x409, -0x409,0x409,0,0,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0,0,0x6839,0x409,0x6939,0x409, -0x6a99,0x409,0x6bf9,0x409,0,0xfc0a,0,0xfc0a,0,0xfc0a,0,0xfc0a,0x409,0x409,0x409,0x409, -0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0x2509,0x2509,0x2b09,0x2b09, -0x2b09,0x2b09,0x3209,0x3209,0x4009,0x4009,0x3809,0x3809,0x3f09,0x3f09,0,0,0x6d59,0x6e39,0x6f19,0x6ff9, -0x70d9,0x71b9,0x7299,0x7379,0x745b,0x753b,0x761b,0x76fb,0x77db,0x78bb,0x799b,0x7a7b,0x7b59,0x7c39,0x7d19,0x7df9, -0x7ed9,0x7fb9,0x8099,0x8179,0x825b,0x833b,0x841b,0x84fb,0x85db,0x86bb,0x879b,0x887b,0x8959,0x8a39,0x8b19,0x8bf9, -0x8cd9,0x8db9,0x8e99,0x8f79,0x905b,0x913b,0x921b,0x92fb,0x93db,0x94bb,0x959b,0x967b,0x409,0x409,0x9759,0x9859, -0x9939,0,0x9a39,0x9b39,0xfc0a,0xfc0a,0xdb0a,0xdb0a,0x9c9b,4,0x9d79,4,4,4,0x9e19,0x9f19, -0x9ff9,0,0xa0f9,0xa1f9,0xd50a,0xd50a,0xd50a,0xd50a,0xa35b,4,4,4,0x409,0x409,0xa439,0xa599, -0,0,0xa739,0xa839,0xfc0a,0xfc0a,0xce0a,0xce0a,0,4,4,4,0x409,0x409,0xa999,0xaaf9, -0xac99,0x389,0xad99,0xae99,0xfc0a,0xfc0a,0xc80a,0xc80a,0xfc8a,4,4,4,0,0,0xaff9,0xb0f9, -0xb1d9,0,0xb2d9,0xb3d9,0xc00a,0xc00a,0xc10a,0xc10a,0xb53b,4,4,0,0,0,0,0, -0,0,0,0,0,0,0,4,4,4,4,4,0,0,0,0, -0,0,0,0,4,4,0,0,0,0,0,0,4,0,0,4, -0,0,4,4,4,4,4,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,4,4,4,4,4,0,4,4, -4,4,4,4,4,4,4,4,0,0x25,0,0,0,0,0,0, -0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x44,0x44,0x64,0x64,0x44,0x44,0x44,0x44, -0x64,0x64,0x64,0x44,0x44,4,4,4,4,0x44,4,4,4,0x64,0x64,0x44, -0x64,0x44,0x64,0x64,0x64,0x64,0x64,0x64,0x44,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2, -0,0,1,2,2,2,1,1,2,2,2,1,0,2,0,0, -0,2,2,2,2,2,0,0,0,0,0,0,2,0,0xb61a,0, -2,0,0xb69a,0xb71a,2,2,0,1,2,2,0xe0a,2,1,0,0,0, -0,1,0,0,1,1,2,2,0,0,0,0,0,2,1,1, -0x21,0x21,0,0,0,0,0xf209,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a, -0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809, -0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0,0,0,0x8a,0xff89,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,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a, -0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xf309,0xf309,0xf309,0xf309, -0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a, +0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a, +0x409,0x409,0x409,0x409,0x409,0x409,0,0,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0,0, +0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a, +0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a, +0x409,0x409,0x409,0x409,0x409,0x409,0,0,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0,0, +0x6839,0x409,0x6939,0x409,0x6a99,0x409,0x6bf9,0x409,0,0xfc0a,0,0xfc0a,0,0xfc0a,0,0xfc0a, +0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a,0xfc0a, +0x2509,0x2509,0x2b09,0x2b09,0x2b09,0x2b09,0x3209,0x3209,0x4009,0x4009,0x3809,0x3809,0x3f09,0x3f09,0,0, +0x6d59,0x6e39,0x6f19,0x6ff9,0x70d9,0x71b9,0x7299,0x7379,0x745b,0x753b,0x761b,0x76fb,0x77db,0x78bb,0x799b,0x7a7b, +0x7b59,0x7c39,0x7d19,0x7df9,0x7ed9,0x7fb9,0x8099,0x8179,0x825b,0x833b,0x841b,0x84fb,0x85db,0x86bb,0x879b,0x887b, +0x8959,0x8a39,0x8b19,0x8bf9,0x8cd9,0x8db9,0x8e99,0x8f79,0x905b,0x913b,0x921b,0x92fb,0x93db,0x94bb,0x959b,0x967b, +0x409,0x409,0x9759,0x9859,0x9939,0,0x9a39,0x9b39,0xfc0a,0xfc0a,0xdb0a,0xdb0a,0x9c9b,4,0x9d79,4, +4,4,0x9e19,0x9f19,0x9ff9,0,0xa0f9,0xa1f9,0xd50a,0xd50a,0xd50a,0xd50a,0xa35b,4,4,4, +0x409,0x409,0xa439,0xa599,0,0,0xa739,0xa839,0xfc0a,0xfc0a,0xce0a,0xce0a,0,4,4,4, +0x409,0x409,0xa999,0xaaf9,0xac99,0x389,0xad99,0xae99,0xfc0a,0xfc0a,0xc80a,0xc80a,0xfc8a,4,4,4, +0,0,0xaff9,0xb0f9,0xb1d9,0,0xb2d9,0xb3d9,0xc00a,0xc00a,0xc10a,0xc10a,0xb53b,4,4,0, +0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4, +0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0, +4,0,0,4,0,0,4,4,4,4,4,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4, +4,0,4,4,4,4,4,4,4,4,4,4,0,0x25,0,0, +0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x44,0x44,0x64,0x64, +0x44,0x44,0x44,0x44,0x64,0x64,0x64,0x44,0x44,4,4,4,4,0x44,4,4, +4,0x64,0x64,0x44,0x64,0x44,0x64,0x64,0x64,0x64,0x64,0x64,0x44,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, +0,0,0,2,0,0,1,2,2,2,1,1,2,2,2,1, +0,2,0,0,0,2,2,2,2,2,0,0,0,0,0,0, +2,0,0xb61a,0,2,0,0xb69a,0xb71a,2,2,0,1,2,2,0xe0a,2, +1,0,0,0,0,1,0,0,1,1,2,2,0,0,0,0, +0,2,1,1,0x21,0x21,0,0,0,0,0xf209,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x80a,0x80a,0x80a,0x80a, +0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0xf809,0xf809,0xf809,0xf809, +0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0xf809,0,0,0,0x8a, +0xff89,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,0xd0a,0xd0a, +0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a,0xd0a, +0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309,0xf309, +0xf309,0xf309,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a, 0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a, -0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809, +0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0x180a,0,0xe809,0xe809,0xe809,0xe809, 0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809, -0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0,0x8a,0xff89,0xb79a,0xb7da,0xb81a,0xb859,0xb899,0x8a, -0xff89,0x8a,0xff89,0x8a,0xff89,0xb8da,0xb91a,0xb95a,0xb99a,1,0x8a,0xff89,1,0x8a,0xff89,1, -1,1,1,1,0x25,5,0xb9da,0xba1a,0x8a,0xff89,0x8a,0xff89,1,0,0,0, -0,0,0,0x8a,0xff89,0x8a,0xff89,0x44,0x44,0x44,0x8a,0xff89,0,0,0,0, -0,0,0,0,0,0,0,0,0xba59,0xba99,0xbad9,0xbb19,0xbb59,0xbb99,0xbbd9,0xbc19, -0xbc59,0xbc99,0xbcd9,0xbd19,0xbd59,0xbd99,0xbdd9,0xbe19,0xbe59,0xbe99,0xbed9,0xbf19,0xbf59,0xbf99,0xbfd9,0xc019, -0xc059,0xc099,0xc0d9,0xc119,0xc159,0xc199,0xc1d9,0xc219,0xc259,0xc299,0xc2d9,0xc319,0xc359,0xc399,0,0xc3d9, -0,0,0,0,0,0xc419,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0x64,0x44,0x44,0x44,0x44, +0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0xe809,0,0x8a,0xff89,0xb79a,0xb7da, +0xb81a,0xb859,0xb899,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0xb8da,0xb91a,0xb95a,0xb99a,1,0x8a,0xff89, +1,0x8a,0xff89,1,1,1,1,1,0x25,5,0xb9da,0xba1a,0x8a,0xff89,0x8a,0xff89, +1,0,0,0,0,0,0,0x8a,0xff89,0x8a,0xff89,0x44,0x44,0x44,0x8a,0xff89, +0,0,0,0,0,0,0,0,0,0,0,0,0xba59,0xba99,0xbad9,0xbb19, +0xbb59,0xbb99,0xbbd9,0xbc19,0xbc59,0xbc99,0xbcd9,0xbd19,0xbd59,0xbd99,0xbdd9,0xbe19,0xbe59,0xbe99,0xbed9,0xbf19, +0xbf59,0xbf99,0xbfd9,0xc019,0xc059,0xc099,0xc0d9,0xc119,0xc159,0xc199,0xc1d9,0xc219,0xc259,0xc299,0xc2d9,0xc319, +0xc359,0xc399,0,0xc3d9,0,0,0,0,0,0xc419,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x64, +0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, -0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0,0,0, -0,0,0,0,0,0,0x64,0x64,0x64,0x64,0x60,0x60,0,4,4,4, -4,4,0,0,0,0,0,4,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0x64,0x64,0x64,0x64,0x60,0x60, +0,4,4,4,4,4,0,0,0,0,0,4,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0x64,0x64,4,4,4,4,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0x64,0x64,4,4,4,4,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,4,4,4,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, +0,0,0,0,0,0,0,0,4,4,4,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0xc45a,0xc4d9,0x8a,0xff89,0x8a,0xff89, +0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0xc45a,0xc4d9, 0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -0x8a,0xff89,0,0x44,4,4,4,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, -0x44,0x44,0,4,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0,0x44,4,4,4,0,0x44,0x44,0x44,0x44, +0x44,0x44,0x44,0x44,0x44,0x44,0,4,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, 0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -5,5,0x44,0x44,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x44,0x44,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4, +0x8a,0xff89,0x8a,0xff89,5,5,0x44,0x44,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x44,0x44,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -0x8a,0xff89,0x8a,0xff89,1,1,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,5,1,1,1,1,1,1,1, -1,0x8a,0xff89,0x8a,0xff89,0xc55a,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, -4,4,4,0x8a,0xff89,0xc59a,1,0,0x8a,0xff89,0x8a,0xff89,1,1,0x8a,0xff89, -0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0xc5da,0xc61a,0xc65a,0xc69a,0xc6da,0, -0xc71a,0xc75a,0xc79a,0xc7da,0x8a,0xff89,0x8a,0xff89,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,1,0,0,0,0,0,0,0,4,0,0,0,0x64,0, -0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x64,4,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,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, -0x44,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,4,4,4,4,4,0x64,0x64,0x64,0,0, +4,4,4,4,4,4,4,4,4,4,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,1,1,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,5,1,1,1, +1,1,1,1,1,0x8a,0xff89,0x8a,0xff89,0xc55a,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89, +0x8a,0xff89,0x8a,0xff89,4,4,4,0x8a,0xff89,0xc59a,1,0,0x8a,0xff89,0x8a,0xff89, +1,1,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0x8a,0xff89,0xc5da,0xc61a, +0xc65a,0xc69a,0xc6da,0,0xc71a,0xc75a,0xc79a,0xc7da,0x8a,0xff89,0x8a,0xff89,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,1,0,0,0,0,0,0,0,4,0, +0,0,0x64,0,0,0,0,4,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x64,4,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,4,4,4,4,4,4,4,4,4,4,4,0,0x60, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0x64,0,0,4,4,4,4,0,0,4,0,0,0, -0x60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,4,4,4,4,4,4,0,0,4,4,0,0,4,4,0, -0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0, -0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, +0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,0x64, +0x64,0x64,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4, +4,4,0,0x60,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0x64,0,0,4,4,4,4,0,0, +4,0,0,0,0x60,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,4,4,4,4,4,4,0,0,4,4,0, +0,4,4,0,0,0,0,0,0,0,0,0,0,0,0,4, +0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, 0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x44,0,0x44,0x44, +0x64,0,0,0x44,0x44,0,0,0,0,0,0x44,0x44,0,0x44,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,4,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,4, +4,0,0x64,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0xc819,1,1,1,1,1,1,1,4, +5,5,5,5,1,1,1,1,1,1,0,0,0,0,0,0, +0,0,0,0,0xc859,0xc8b9,0xc919,0xc979,0xc9d9,0xca39,0xca99,0xcaf9,0xcb59,0xcbb9,0xcc19,0xcc79, +0xccd9,0xcd39,0xcd99,0xcdf9,0xda59,0xdab9,0xdb19,0xdb79,0xdbd9,0xdc39,0xdc99,0xdcf9,0xdd59,0xddb9,0xde19,0xde79, +0xded9,0xdf39,0xdf99,0xdff9,0xe059,0xe0b9,0xe119,0xe179,0xe1d9,0xe239,0xe299,0xe2f9,0xe359,0xe3b9,0xe419,0xe479, +0xe4d9,0xe539,0xe599,0xe5f9,0xce59,0xceb9,0xcf19,0xcf79,0xcfd9,0xd039,0xd099,0xd0f9,0xd159,0xd1b9,0xd219,0xd279, +0xd2d9,0xd339,0xd399,0xd3f9,0xd459,0xd4b9,0xd519,0xd579,0xd5d9,0xd639,0xd699,0xd6f9,0xd759,0xd7b9,0xd819,0xd879, +0xd8d9,0xd939,0xd999,0xd9f9,0,0,0,0,0,4,0,0,4,0,0,0, +0,0x64,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0xe659,0xe759,0xe859,0xe959,0xeab9,0xec19,0xed59,0,0,0,0,0, +0,0,0,0,0,0,0,0xee99,0xef99,0xf099,0xf199,0xf299,0,0,0,0, +0,0,0x64,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,0,0,0,4,0,0,0,0, +0,0,0,0,0,0,0,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x64, +0x64,0x64,0x64,0x64,0x64,0x64,0x44,0x44,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,4,0,0,4,0,0, +0,0,0,0,0,0,0,0,0,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, +0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, +0x100a,0x100a,0x100a,0,0,0,4,0,4,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009, +0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009, +0xf009,0xf009,0xf009,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x44,0,0x44,0x44,0x64,0,0,0x44, -0x44,0,0,0,0,0,0x44,0x44,0,0x44,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,4,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,4,4,0,0,0,0,0,4,4,0,0x64,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,0xc819,1,1,1,1,1,1,1,4,5,5,5,5, -1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0, -0xc859,0xc8b9,0xc919,0xc979,0xc9d9,0xca39,0xca99,0xcaf9,0xcb59,0xcbb9,0xcc19,0xcc79,0xccd9,0xcd39,0xcd99,0xcdf9, -0xda59,0xdab9,0xdb19,0xdb79,0xdbd9,0xdc39,0xdc99,0xdcf9,0xdd59,0xddb9,0xde19,0xde79,0xded9,0xdf39,0xdf99,0xdff9, -0xe059,0xe0b9,0xe119,0xe179,0xe1d9,0xe239,0xe299,0xe2f9,0xe359,0xe3b9,0xe419,0xe479,0xe4d9,0xe539,0xe599,0xe5f9, -0xce59,0xceb9,0xcf19,0xcf79,0xcfd9,0xd039,0xd099,0xd0f9,0xd159,0xd1b9,0xd219,0xd279,0xd2d9,0xd339,0xd399,0xd3f9, -0xd459,0xd4b9,0xd519,0xd579,0xd5d9,0xd639,0xd699,0xd6f9,0xd759,0xd7b9,0xd819,0xd879,0xd8d9,0xd939,0xd999,0xd9f9, -0,0,0,0,0,4,0,0,4,0,0,0,0,0x64,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0xe659,0xe759,0xe859,0xe959,0xeab9,0xec19,0xed59,0,0,0,0,0,0,0,0,0, -0,0,0,0xee99,0xef99,0xf099,0xf199,0xf299,0,0,0,0,0,0,0x64,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,0,0,0,4,0,0,0,0,0,0,0,0, -0,0,0,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x64,0x64,0x64,0x64,0x64, -0x64,0x64,0x44,0x44,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,4,0,0,4,0,0,0,0,0,0, -0,0,0,0,0,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, -0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0, -0,0,4,0,4,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009, -0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,4,4,4,0,0,0,0, -0x64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4, +0,0,0,0,0x64,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,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0,0x140a,0x140a,0x140a,0x140a, +0,0,0,0,0,0,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0, +0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a, 0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a, -0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0xec09,0xec09,0xec09,0xec09, 0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09, -0xec09,0xec09,0xec09,0xec09,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a, -0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0,0,0,0,0xec09,0xec09,0xec09,0xec09, +0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a, +0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0,0,0,0, 0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09, -0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0,0,0,0,0,4,4,4, -0,4,4,0,0,0,0,0,4,0x64,4,0x44,0,0,0,0, +0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0xec09,0,0,0,0, +0,4,4,4,0,4,4,0,0,0,0,0,4,0x64,4,0x44, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x44,0x64,0x64,0,0,0,0,0x64, +0,0,0,0,0,0x44,0x64,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,0x44,0x64,0x64,0,0,0,0,0x64,0,0,0,0, -0,0x44,0x64,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,0x200a,0x200a,0x200a,0x200a, 0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a, -0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xe009,0xe009,0xe009,0xe009, +0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a,0x200a, +0x200a,0x200a,0x200a,0,0,0,0,0,0,0,0,0,0,0,0,0, 0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009, -0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,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,4,4,4,4,4,4,4,4, -4,4,0x64,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009,0xe009, +0xe009,0xe009,0xe009,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,4,4,4,4, +4,4,4,4,4,4,0x64,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,0x64,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,4,4,4,4,0,0,0x64,0x64,0, -0,4,0,0,0x44,0x44,0x44,0,0,0,0,0,0,0,0,0, +0,0,0,4,4,4,4,0,0,0x64,0x64,0,0,4,0,0, +0x44,0x44,0x44,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,4,4,4,4,4,0,4,4,4, -4,4,4,0x64,0x64,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,4,4,4,4,4,0,4,4,4,4,4,4,0x64, +0x64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0x64,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4, 4,4,4,4,4,4,4,0,0x60,0,0,0,0,0,0,0, 0,0,0x64,4,4,0,0,0,0,0,0,0,0,0,0,0, @@ -663,79 +666,89 @@ static const uint16_t ucase_props_trieIndex[11520]={ 0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a,0x100a, 0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009, 0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009,0xf009, +0,4,4,4,4,4,4,0,0,4,4,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -4,4,4,4,4,4,4,0,4,4,4,4,4,4,0,0x64, -4,4,4,4,4,4,4,4,0,0,4,4,4,4,4,4, -4,0,4,4,0,4,4,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x64,0x64,0x64,0x64,0x64,0,0,0, +0,0,0,4,0x64,4,4,4,4,0,0,4,4,4,4,0, +0,0,0,0,0,0,0,0x64,0,0,0,0,0,0,0,0, +0,4,4,4,4,4,4,0,0,4,4,4,0,0,0,0, +0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4, +4,4,4,0,4,0x64,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,0, +4,4,4,4,4,4,0,0x64,4,4,4,4,4,4,4,4, +0,0,4,4,4,4,4,4,4,0,4,4,0,4,4,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0, +0,4,4,4,4,4,4,0,0,0,4,0,4,4,0,4, +4,4,0x64,4,0x64,0x64,0,4,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x64,0x64,0x64,0x64,0x64,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,4,0x64,0,0,0,0,0,0,0x60,0x60,0x64, -0x64,0x64,0,0,0,0x60,0x60,0x60,0x60,0x60,0x60,4,4,4,4,4, -4,4,4,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0,0,0x44,0x44,0x44, -0x44,0x44,0x64,0x64,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x44,0x44,0x44,0x44,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,4,0x64,0, +0,0,0,0,0,0x60,0x60,0x64,0x64,0x64,0,0,0,0x60,0x60,0x60, +0x60,0x60,0x60,4,4,4,4,4,4,4,4,0x64,0x64,0x64,0x64,0x64, +0x64,0x64,0x64,0,0,0x44,0x44,0x44,0x44,0x44,0x64,0x64,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0x44,0x44,0x44,0,0,0,0,0,0,0,0,0,0,0, +0,0,0x44,0x44,0x44,0x44,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0x44,0x44,0x44,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,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,1,1,1,1,1,1,1,1,0x21,0x21,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1, -1,1,0x21,0x21,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,1,1,1,1,1,1,1,0,0x21,0x21,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1, -1,1,1,1,1,1,0x21,0x21,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,2,0,2,2,0,0,2,0, -0,2,2,0,0,2,2,2,2,0,2,2,2,2,2,2, -2,2,1,1,1,1,0,1,0,1,0x21,0x21,1,1,1,1, -0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1, -2,2,0,2,2,2,2,0,0,2,2,2,2,2,2,2, -2,0,2,2,2,2,2,2,2,0,1,1,1,1,1,1, -1,1,0x21,0x21,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,2,2,0,2,2,2,2,0,2,2,2,2, -2,0,2,0,0,0,2,2,2,2,2,2,2,0,1,1, -1,1,1,1,1,1,0x21,0x21,1,1,1,1,1,1,1,1, +1,0,0x21,0x21,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,1,1,1,1,1,1,1,1,0x21,0x21, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +2,0,2,2,0,0,2,0,0,2,2,0,0,2,2,2, +2,0,2,2,2,2,2,2,2,2,1,1,1,1,0,1, +0,1,0x21,0x21,1,1,1,1,0,1,1,1,1,1,1,1, 1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,1,1,1,1,1,1,0,0, +2,2,2,2,1,1,1,1,2,2,0,2,2,2,2,0, +0,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2, +2,0,1,1,1,1,1,1,1,1,0x21,0x21,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,2,2,0,2, +2,2,2,0,2,2,2,2,2,0,2,0,0,0,2,2, +2,2,2,2,2,0,1,1,1,1,1,1,1,1,0x21,0x21, +1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,0,1,1,1,1,1,1,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, +1,1,1,1,1,1,0,0,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -1,1,1,0,1,1,1,1,1,1,2,1,0,0,0,0, +2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1, +1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,1,1,1,0,1,1,1,1, +1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0, +0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0, +0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4, +0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,0,0,0,0,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0, -0,4,0,0,0,0,0,0,0,0,0,0,4,0,0,0, +0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, +0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0,0x44,0x44,0x44,0x44,0x44, +0x44,0x44,0,0x44,0x44,0,0x44,0x44,0x44,0x44,0x44,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,4,4,4,4,4,0,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0, -0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, -0x44,0,0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0,0x44,0x44,0,0x44,0x44, -0x44,0x44,0x44,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0, -0,0,0,0,0,0,0,0,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a, +0x64,0x64,0x64,0x64,0x64,0x64,0x64,0,0,0,0,0,0,0,0,0, +0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a, 0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a, -0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0x110a,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09, +0x110a,0x110a,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09, 0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09, -0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0xef09,0x44,0x44,0x44,0x44,0x44,0x44,0x64,0, +0x44,0x44,0x44,0x44,0x44,0x44,0x64,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2, +2,2,2,2,2,2,0,0,0,0,0,0,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,2,2,2,2,2,2,2,2,2,2,0,0, -0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,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 }; static const uint16_t ucase_props_exceptions[1948]={ @@ -900,13 +913,13 @@ static const UCaseProps ucase_props_singleton={ ucase_props_trieIndex+3228, NULL, 3228, - 8292, + 8492, 0x188, 0xd18, 0x0, 0x0, 0xe0800, - 0x2cfc, + 0x2dc4, NULL, 0, FALSE, FALSE, 0, NULL }, { 3,0,0,0 } diff --git a/deps/icu-small/source/common/ucasemap.cpp b/deps/icu-small/source/common/ucasemap.cpp index 0576a26ddd1c86..8eec93c6e3ea3b 100644 --- a/deps/icu-small/source/common/ucasemap.cpp +++ b/deps/icu-small/source/common/ucasemap.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucasemap.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -20,6 +20,11 @@ #include "unicode/utypes.h" #include "unicode/brkiter.h" +#include "unicode/bytestream.h" +#include "unicode/casemap.h" +#include "unicode/edits.h" +#include "unicode/stringoptions.h" +#include "unicode/stringpiece.h" #include "unicode/ubrk.h" #include "unicode/uloc.h" #include "unicode/ustring.h" @@ -30,49 +35,51 @@ #include "unicode/utf.h" #include "unicode/utf8.h" #include "unicode/utf16.h" +#include "bytesinkutil.h" #include "cmemory.h" #include "cstring.h" +#include "uassert.h" #include "ucase.h" +#include "ucasemap_imp.h" #include "ustr_imp.h" U_NAMESPACE_USE /* UCaseMap service object -------------------------------------------------- */ +UCaseMap::UCaseMap(const char *localeID, uint32_t opts, UErrorCode *pErrorCode) : +#if !UCONFIG_NO_BREAK_ITERATION + iter(NULL), +#endif + caseLocale(UCASE_LOC_UNKNOWN), options(opts) { + ucasemap_setLocale(this, localeID, pErrorCode); +} + +UCaseMap::~UCaseMap() { +#if !UCONFIG_NO_BREAK_ITERATION + delete iter; +#endif +} + U_CAPI UCaseMap * U_EXPORT2 ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode) { - UCaseMap *csm; - if(U_FAILURE(*pErrorCode)) { return NULL; } - - csm=(UCaseMap *)uprv_malloc(sizeof(UCaseMap)); + UCaseMap *csm = new UCaseMap(locale, options, pErrorCode); if(csm==NULL) { + *pErrorCode = U_MEMORY_ALLOCATION_ERROR; return NULL; - } - uprv_memset(csm, 0, sizeof(UCaseMap)); - - csm->csp=ucase_getSingleton(); - ucasemap_setLocale(csm, locale, pErrorCode); - if(U_FAILURE(*pErrorCode)) { - uprv_free(csm); + } else if (U_FAILURE(*pErrorCode)) { + delete csm; return NULL; } - - csm->options=options; return csm; } U_CAPI void U_EXPORT2 ucasemap_close(UCaseMap *csm) { - if(csm!=NULL) { -#if !UCONFIG_NO_BREAK_ITERATION - // Do not call ubrk_close() so that we do not depend on all of the BreakIterator code. - delete reinterpret_cast(csm->iter); -#endif - uprv_free(csm); - } + delete csm; } U_CAPI const char * U_EXPORT2 @@ -87,13 +94,16 @@ ucasemap_getOptions(const UCaseMap *csm) { U_CAPI void U_EXPORT2 ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode) { - int32_t length; - if(U_FAILURE(*pErrorCode)) { return; } + if (locale != NULL && *locale == 0) { + csm->locale[0] = 0; + csm->caseLocale = UCASE_LOC_ROOT; + return; + } - length=uloc_getName(locale, csm->locale, (int32_t)sizeof(csm->locale), pErrorCode); + int32_t length=uloc_getName(locale, csm->locale, (int32_t)sizeof(csm->locale), pErrorCode); if(*pErrorCode==U_BUFFER_OVERFLOW_ERROR || length==sizeof(csm->locale)) { *pErrorCode=U_ZERO_ERROR; /* we only really need the language code for case mappings */ @@ -102,124 +112,60 @@ ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode) { if(length==sizeof(csm->locale)) { *pErrorCode=U_BUFFER_OVERFLOW_ERROR; } - csm->locCache=0; if(U_SUCCESS(*pErrorCode)) { - ucase_getCaseLocale(csm->locale, &csm->locCache); + csm->caseLocale=UCASE_LOC_UNKNOWN; + csm->caseLocale = ucase_getCaseLocale(csm->locale); } else { csm->locale[0]=0; + csm->caseLocale = UCASE_LOC_ROOT; } } U_CAPI void U_EXPORT2 -ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode * /*pErrorCode*/) { +ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode) { + if(U_FAILURE(*pErrorCode)) { + return; + } csm->options=options; } /* UTF-8 string case mappings ----------------------------------------------- */ -/* TODO(markus): Move to a new, separate utf8case.c file. */ +/* TODO(markus): Move to a new, separate utf8case.cpp file. */ + +namespace { /* append a full case mapping result, see UCASE_MAX_STRING_LENGTH */ -static inline int32_t -appendResult(uint8_t *dest, int32_t destIndex, int32_t destCapacity, - int32_t result, const UChar *s) { - UChar32 c; - int32_t length; - UErrorCode errorCode; +inline UBool +appendResult(int32_t cpLength, int32_t result, const UChar *s, + ByteSink &sink, uint32_t options, icu::Edits *edits, UErrorCode &errorCode) { + U_ASSERT(U_SUCCESS(errorCode)); /* decode the result */ if(result<0) { /* (not) original code point */ - c=~result; - length=U8_LENGTH(c); - } else if(result<=UCASE_MAX_STRING_LENGTH) { - c=U_SENTINEL; - length=result; - } else { - c=result; - length=U8_LENGTH(c); - } - if(length>(INT32_MAX-destIndex)) { - return -1; // integer overflow - } - - if(destIndex=0) { - /* code point */ - UBool isError=FALSE; - U8_APPEND(dest, destIndex, destCapacity, c, isError); - if(isError) { - /* overflow, nothing written */ - destIndex+=length; - } - } else { - /* string */ - int32_t destLength; - errorCode=U_ZERO_ERROR; - u_strToUTF8( - (char *)(dest+destIndex), destCapacity-destIndex, &destLength, - s, length, - &errorCode); - if(U_FAILURE(errorCode) && errorCode != U_BUFFER_OVERFLOW_ERROR) { - return -1; - } - if(destLength>(INT32_MAX-destIndex)) { - return -1; // integer overflow - } - destIndex+=destLength; - /* we might have an overflow, but we know the actual length */ + if(edits!=NULL) { + edits->addUnchanged(cpLength); + } + if((options & U_OMIT_UNCHANGED_TEXT) == 0) { + ByteSinkUtil::appendCodePoint(cpLength, ~result, sink); } } else { - /* preflight */ - if(c>=0) { - destIndex+=length; + if(result<=UCASE_MAX_STRING_LENGTH) { + // string: "result" is the UTF-16 length + return ByteSinkUtil::appendChange(cpLength, s, result, sink, edits, errorCode); } else { - int32_t destLength; - errorCode=U_ZERO_ERROR; - u_strToUTF8( - NULL, 0, &destLength, - s, length, - &errorCode); - if(U_FAILURE(errorCode) && errorCode != U_BUFFER_OVERFLOW_ERROR) { - return -1; - } - if(destLength>(INT32_MAX-destIndex)) { - return -1; // integer overflow - } - destIndex+=destLength; + ByteSinkUtil::appendCodePoint(cpLength, result, sink, edits); } } - return destIndex; + return TRUE; } -static inline int32_t -appendUChar(uint8_t *dest, int32_t destIndex, int32_t destCapacity, UChar c) { - int32_t length=U8_LENGTH(c); - if(length>(INT32_MAX-destIndex)) { - return -1; // integer overflow - } - int32_t limit=destIndex+length; - if(limit<=destCapacity) { - U8_APPEND_UNSAFE(dest, destIndex, c); - } - return limit; -} +// See unicode/utf8.h U8_APPEND_UNSAFE(). +inline uint8_t getTwoByteLead(UChar32 c) { return (uint8_t)((c >> 6) | 0xc0); } +inline uint8_t getTwoByteTrail(UChar32 c) { return (uint8_t)((c & 0x3f) | 0x80); } -static inline int32_t -appendString(uint8_t *dest, int32_t destIndex, int32_t destCapacity, - const uint8_t *s, int32_t length) { - if(length>0) { - if(length>(INT32_MAX-destIndex)) { - return -1; // integer overflow - } - if((destIndex+length)<=destCapacity) { - uprv_memcpy(dest+destIndex, s, length); - } - destIndex+=length; - } - return destIndex; -} +} // namespace static UChar32 U_CALLCONV utf8_caseContextIterator(void *context, int8_t dir) { @@ -257,133 +203,96 @@ utf8_caseContextIterator(void *context, int8_t dir) { * Case-maps [srcStart..srcLimit[ but takes * context [0..srcLength[ into account. */ -static int32_t -_caseMap(const UCaseMap *csm, UCaseMapFull *map, - uint8_t *dest, int32_t destCapacity, +static void +_caseMap(int32_t caseLocale, uint32_t options, UCaseMapFull *map, const uint8_t *src, UCaseContext *csc, int32_t srcStart, int32_t srcLimit, - UErrorCode *pErrorCode) { - const UChar *s = NULL; - UChar32 c, c2 = 0; - int32_t srcIndex, destIndex; - int32_t locCache; - - locCache=csm->locCache; - + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode) { /* case mapping loop */ - srcIndex=srcStart; - destIndex=0; - while(srcIndexcpStart=srcIndex; + int32_t srcIndex=srcStart; + while (U_SUCCESS(errorCode) && srcIndexcpStart=cpStart=srcIndex; + UChar32 c; U8_NEXT(src, srcIndex, srcLimit, c); csc->cpLimit=srcIndex; if(c<0) { // Malformed UTF-8. - destIndex=appendString(dest, destIndex, destCapacity, src+csc->cpStart, srcIndex-csc->cpStart); - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; - } - continue; - } - c=map(csm->csp, c, utf8_caseContextIterator, csc, &s, csm->locale, &locCache); - if((destIndexdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } - return destIndex; } #if !UCONFIG_NO_BREAK_ITERATION -U_CFUNC int32_t U_CALLCONV -ucasemap_internalUTF8ToTitle(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode) { - const UChar *s; - UChar32 c; - int32_t prev, titleStart, titleLimit, idx, destIndex; - UBool isFirstIndex; - - if(U_FAILURE(*pErrorCode)) { - return 0; +U_CFUNC void U_CALLCONV +ucasemap_internalUTF8ToTitle( + int32_t caseLocale, uint32_t options, BreakIterator *iter, + const uint8_t *src, int32_t srcLength, + ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode) { + if (!ustrcase_checkTitleAdjustmentOptions(options, errorCode)) { + return; } - // Use the C++ abstract base class to minimize dependencies. - // TODO: Change UCaseMap.iter to store a BreakIterator directly. - BreakIterator *bi=reinterpret_cast(csm->iter); - /* set up local variables */ - int32_t locCache=csm->locCache; UCaseContext csc=UCASECONTEXT_INITIALIZER; csc.p=(void *)src; csc.limit=srcLength; - destIndex=0; - prev=0; - isFirstIndex=TRUE; + int32_t prev=0; + UBool isFirstIndex=TRUE; /* titlecasing loop */ while(prevfirst(); + index=iter->first(); } else { - idx=bi->next(); + index=iter->next(); } - if(idx==UBRK_DONE || idx>srcLength) { - idx=srcLength; + if(index==UBRK_DONE || index>srcLength) { + index=srcLength; } /* - * Unicode 4 & 5 section 3.13 Default Case Operations: - * - * R3 toTitlecase(X): Find the word boundaries based on Unicode Standard Annex - * #29, "Text Boundaries." Between each pair of word boundaries, find the first - * cased character F. If F exists, map F to default_title(F); then map each - * subsequent character C to default_lower(C). - * - * In this implementation, segment [prev..index[ into 3 parts: - * a) uncased characters (copy as-is) [prev..titleStart[ - * b) first case letter (titlecase) [titleStart..titleLimit[ + * Segment [prev..index[ into 3 parts: + * a) skipped characters (copy as-is) [prev..titleStart[ + * b) first letter (titlecase) [titleStart..titleLimit[ * c) subsequent characters (lowercase) [titleLimit..index[ */ - if(prevoptions&U_TITLECASE_NO_BREAK_ADJUSTMENT)==0 && UCASE_NONE==ucase_getType(csm->csp, c)) { - /* Adjust the titlecasing index (titleStart) to the next cased character. */ - for(;;) { + if(prevcsp, c)) { - break; /* cased letter at [titleStart..titleLimit[ */ - } + U8_NEXT(src, titleLimit, index, c); } - destIndex=appendString(dest, destIndex, destCapacity, src+prev, titleStart-prev); - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; + if (prev < titleStart) { + if (!ByteSinkUtil::appendUnchanged(src+prev, titleStart-prev, + sink, options, edits, errorCode)) { + return; + } } } @@ -392,61 +301,60 @@ ucasemap_internalUTF8ToTitle(const UCaseMap *csm, if(c>=0) { csc.cpStart=titleStart; csc.cpLimit=titleLimit; - c=ucase_toFullTitle(csm->csp, c, utf8_caseContextIterator, &csc, &s, csm->locale, &locCache); - destIndex=appendResult(dest, destIndex, destCapacity, c, s); + const UChar *s; + c=ucase_toFullTitle(c, utf8_caseContextIterator, &csc, &s, caseLocale); + if (!appendResult(titleLimit-titleStart, c, s, sink, options, edits, errorCode)) { + return; + } } else { // Malformed UTF-8. - destIndex=appendString(dest, destIndex, destCapacity, src+titleStart, titleLimit-titleStart); - } - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; + if (!ByteSinkUtil::appendUnchanged(src+titleStart, titleLimit-titleStart, + sink, options, edits, errorCode)) { + return; + } } /* Special case Dutch IJ titlecasing */ - if (titleStart+1 < idx && - ucase_getCaseLocale(csm->locale, &locCache) == UCASE_LOC_DUTCH && - (src[titleStart] == 0x0049 || src[titleStart] == 0x0069) && - (src[titleStart+1] == 0x004A || src[titleStart+1] == 0x006A)) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x004A); - titleLimit++; + if (titleStart+1 < index && + caseLocale == UCASE_LOC_DUTCH && + (src[titleStart] == 0x0049 || src[titleStart] == 0x0069)) { + if (src[titleStart+1] == 0x006A) { + ByteSinkUtil::appendCodePoint(1, 0x004A, sink, edits); + titleLimit++; + } else if (src[titleStart+1] == 0x004A) { + // Keep the capital J from getting lowercased. + if (!ByteSinkUtil::appendUnchanged(src+titleStart+1, 1, + sink, options, edits, errorCode)) { + return; + } + titleLimit++; + } } + /* lowercase [titleLimit..index[ */ - if(titleLimitoptions&U_TITLECASE_NO_LOWERCASE)==0) { + if(titleLimitdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } - return destIndex; } #endif @@ -454,11 +362,11 @@ ucasemap_internalUTF8ToTitle(const UCaseMap *csm, U_NAMESPACE_BEGIN namespace GreekUpper { -UBool isFollowedByCasedLetter(const UCaseProps *csp, const uint8_t *s, int32_t i, int32_t length) { +UBool isFollowedByCasedLetter(const uint8_t *s, int32_t i, int32_t length) { while (i < length) { UChar32 c; U8_NEXT(s, i, length, c); - int32_t type = ucase_getTypeOrIgnorable(csp, c); + int32_t type = ucase_getTypeOrIgnorable(c); if ((type & UCASE_IGNORABLE) != 0) { // Case-ignorable, continue with the loop. } else if (type != UCASE_NONE) { @@ -471,19 +379,17 @@ UBool isFollowedByCasedLetter(const UCaseProps *csp, const uint8_t *s, int32_t i } // Keep this consistent with the UTF-16 version in ustrcase.cpp and the Java version in CaseMap.java. -int32_t toUpper(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode) { - int32_t locCache = UCASE_LOC_GREEK; - int32_t destIndex=0; +void toUpper(uint32_t options, + const uint8_t *src, int32_t srcLength, + ByteSink &sink, Edits *edits, + UErrorCode &errorCode) { uint32_t state = 0; for (int32_t i = 0; i < srcLength;) { int32_t nextIndex = i; UChar32 c; U8_NEXT(src, nextIndex, srcLength, c); uint32_t nextState = 0; - int32_t type = ucase_getTypeOrIgnorable(csm->csp, c); + int32_t type = ucase_getTypeOrIgnorable(c); if ((type & UCASE_IGNORABLE) != 0) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -533,7 +439,7 @@ int32_t toUpper(const UCaseMap *csm, (data & HAS_ACCENT) != 0 && numYpogegrammeni == 0 && (state & AFTER_CASED) == 0 && - !isFollowedByCasedLetter(csm->csp, src, nextIndex, srcLength)) { + !isFollowedByCasedLetter(src, nextIndex, srcLength)) { // Keep disjunctive "or" with (only) a tonos. // We use the same "word boundary" conditions as for the Final_Sigma test. if (i == nextIndex) { @@ -551,161 +457,183 @@ int32_t toUpper(const UCaseMap *csm, data &= ~HAS_EITHER_DIALYTIKA; } } - destIndex=appendUChar(dest, destIndex, destCapacity, (UChar)upper); - if (destIndex >= 0 && (data & HAS_EITHER_DIALYTIKA) != 0) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x308); // restore or add a dialytika - } - if (destIndex >= 0 && addTonos) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x301); - } - while (destIndex >= 0 && numYpogegrammeni > 0) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x399); - --numYpogegrammeni; + + UBool change; + if (edits == nullptr && (options & U_OMIT_UNCHANGED_TEXT) == 0) { + change = TRUE; // common, simple usage + } else { + // Find out first whether we are changing the text. + U_ASSERT(0x370 <= upper && upper <= 0x3ff); // 2-byte UTF-8, main Greek block + change = (i + 2) > nextIndex || + src[i] != getTwoByteLead(upper) || src[i + 1] != getTwoByteTrail(upper) || + numYpogegrammeni > 0; + int32_t i2 = i + 2; + if ((data & HAS_EITHER_DIALYTIKA) != 0) { + change |= (i2 + 2) > nextIndex || + src[i2] != (uint8_t)u8"\u0308"[0] || + src[i2 + 1] != (uint8_t)u8"\u0308"[1]; + i2 += 2; + } + if (addTonos) { + change |= (i2 + 2) > nextIndex || + src[i2] != (uint8_t)u8"\u0301"[0] || + src[i2 + 1] != (uint8_t)u8"\u0301"[1]; + i2 += 2; + } + int32_t oldLength = nextIndex - i; + int32_t newLength = (i2 - i) + numYpogegrammeni * 2; // 2 bytes per U+0399 + change |= oldLength != newLength; + if (change) { + if (edits != NULL) { + edits->addReplace(oldLength, newLength); + } + } else { + if (edits != NULL) { + edits->addUnchanged(oldLength); + } + // Write unchanged text? + change = (options & U_OMIT_UNCHANGED_TEXT) == 0; + } } - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; + + if (change) { + ByteSinkUtil::appendTwoBytes(upper, sink); + if ((data & HAS_EITHER_DIALYTIKA) != 0) { + sink.Append(u8"\u0308", 2); // restore or add a dialytika + } + if (addTonos) { + sink.Append(u8"\u0301", 2); + } + while (numYpogegrammeni > 0) { + sink.Append(u8"\u0399", 2); + --numYpogegrammeni; + } } } else if(c>=0) { const UChar *s; - UChar32 c2 = 0; - c=ucase_toFullUpper(csm->csp, c, NULL, NULL, &s, csm->locale, &locCache); - if((destIndexdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } - return destIndex; } } // namespace GreekUpper U_NAMESPACE_END -static int32_t U_CALLCONV -ucasemap_internalUTF8ToLower(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, +static void U_CALLCONV +ucasemap_internalUTF8ToLower(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode) { + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode) { UCaseContext csc=UCASECONTEXT_INITIALIZER; csc.p=(void *)src; csc.limit=srcLength; - return _caseMap( - csm, ucase_toFullLower, - dest, destCapacity, + _caseMap( + caseLocale, options, ucase_toFullLower, src, &csc, 0, srcLength, - pErrorCode); + sink, edits, errorCode); } -static int32_t U_CALLCONV -ucasemap_internalUTF8ToUpper(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, +static void U_CALLCONV +ucasemap_internalUTF8ToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode) { - int32_t locCache = csm->locCache; - if (ucase_getCaseLocale(csm->locale, &locCache) == UCASE_LOC_GREEK) { - return GreekUpper::toUpper(csm, dest, destCapacity, src, srcLength, pErrorCode); + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode) { + if (caseLocale == UCASE_LOC_GREEK) { + GreekUpper::toUpper(options, src, srcLength, sink, edits, errorCode); + } else { + UCaseContext csc=UCASECONTEXT_INITIALIZER; + csc.p=(void *)src; + csc.limit=srcLength; + _caseMap( + caseLocale, options, ucase_toFullUpper, + src, &csc, 0, srcLength, + sink, edits, errorCode); } - UCaseContext csc=UCASECONTEXT_INITIALIZER; - csc.p=(void *)src; - csc.limit=srcLength; - return _caseMap( - csm, ucase_toFullUpper, - dest, destCapacity, - src, &csc, 0, srcLength, - pErrorCode); } -static int32_t -utf8_foldCase(const UCaseProps *csp, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - uint32_t options, - UErrorCode *pErrorCode) { - int32_t srcIndex, destIndex; - - const UChar *s; - UChar32 c, c2; - int32_t start; - +static void U_CALLCONV +ucasemap_internalUTF8Fold(int32_t /* caseLocale */, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED + const uint8_t *src, int32_t srcLength, + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode) { /* case mapping loop */ - srcIndex=destIndex=0; - while(srcIndexdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; +void +ucasemap_mapUTF8(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM + const char *src, int32_t srcLength, + UTF8CaseMapper *stringCaseMapper, + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode) { + /* check argument values */ + if (U_FAILURE(errorCode)) { + return; + } + if ((src == nullptr && srcLength != 0) || srcLength < -1) { + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + return; } - return destIndex; -} -static int32_t U_CALLCONV -ucasemap_internalUTF8Fold(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode) { - return utf8_foldCase(csm->csp, dest, destCapacity, src, srcLength, csm->options, pErrorCode); + // Get the string length. + if (srcLength == -1) { + srcLength = (int32_t)uprv_strlen((const char *)src); + } + + if (edits != nullptr && (options & U_EDITS_NO_RESET) == 0) { + edits->reset(); + } + stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR + (const uint8_t *)src, srcLength, sink, edits, errorCode); + sink.Flush(); + if (U_SUCCESS(errorCode)) { + if (edits != nullptr) { + edits->copyErrorTo(errorCode); + } + } } -U_CFUNC int32_t -ucasemap_mapUTF8(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, +int32_t +ucasemap_mapUTF8(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM + char *dest, int32_t destCapacity, + const char *src, int32_t srcLength, UTF8CaseMapper *stringCaseMapper, - UErrorCode *pErrorCode) { - int32_t destLength; - + icu::Edits *edits, + UErrorCode &errorCode) { /* check argument values */ - if(U_FAILURE(*pErrorCode)) { + if(U_FAILURE(errorCode)) { return 0; } if( destCapacity<0 || (dest==NULL && destCapacity>0) || - src==NULL || - srcLength<-1 + (src==NULL && srcLength!=0) || srcLength<-1 ) { - *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; + errorCode=U_ILLEGAL_ARGUMENT_ERROR; return 0; } @@ -719,12 +647,25 @@ ucasemap_mapUTF8(const UCaseMap *csm, ((src>=dest && src<(dest+destCapacity)) || (dest>=src && dest<(src+srcLength))) ) { - *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; + errorCode=U_ILLEGAL_ARGUMENT_ERROR; return 0; } - destLength=stringCaseMapper(csm, dest, destCapacity, src, srcLength, pErrorCode); - return u_terminateChars((char *)dest, destCapacity, destLength, pErrorCode); + CheckedArrayByteSink sink(dest, destCapacity); + if (edits != nullptr && (options & U_EDITS_NO_RESET) == 0) { + edits->reset(); + } + stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR + (const uint8_t *)src, srcLength, sink, edits, errorCode); + sink.Flush(); + if (U_SUCCESS(errorCode)) { + if (sink.Overflowed()) { + errorCode = U_BUFFER_OVERFLOW_ERROR; + } else if (edits != nullptr) { + edits->copyErrorTo(errorCode); + } + } + return u_terminateChars(dest, destCapacity, sink.NumberOfBytesAppended(), &errorCode); } /* public API functions */ @@ -734,10 +675,11 @@ ucasemap_utf8ToLower(const UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode) { - return ucasemap_mapUTF8(csm, - (uint8_t *)dest, destCapacity, - (const uint8_t *)src, srcLength, - ucasemap_internalUTF8ToLower, pErrorCode); + return ucasemap_mapUTF8( + csm->caseLocale, csm->options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8ToLower, NULL, *pErrorCode); } U_CAPI int32_t U_EXPORT2 @@ -745,10 +687,11 @@ ucasemap_utf8ToUpper(const UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode) { - return ucasemap_mapUTF8(csm, - (uint8_t *)dest, destCapacity, - (const uint8_t *)src, srcLength, - ucasemap_internalUTF8ToUpper, pErrorCode); + return ucasemap_mapUTF8( + csm->caseLocale, csm->options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8ToUpper, NULL, *pErrorCode); } U_CAPI int32_t U_EXPORT2 @@ -756,8 +699,79 @@ ucasemap_utf8FoldCase(const UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode) { - return ucasemap_mapUTF8(csm, - (uint8_t *)dest, destCapacity, - (const uint8_t *)src, srcLength, - ucasemap_internalUTF8Fold, pErrorCode); + return ucasemap_mapUTF8( + UCASE_LOC_ROOT, csm->options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8Fold, NULL, *pErrorCode); +} + +U_NAMESPACE_BEGIN + +void CaseMap::utf8ToLower( + const char *locale, uint32_t options, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode) { + ucasemap_mapUTF8( + ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL + src.data(), src.length(), + ucasemap_internalUTF8ToLower, sink, edits, errorCode); +} + +void CaseMap::utf8ToUpper( + const char *locale, uint32_t options, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode) { + ucasemap_mapUTF8( + ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL + src.data(), src.length(), + ucasemap_internalUTF8ToUpper, sink, edits, errorCode); +} + +void CaseMap::utf8Fold( + uint32_t options, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode) { + ucasemap_mapUTF8( + UCASE_LOC_ROOT, options, UCASEMAP_BREAK_ITERATOR_NULL + src.data(), src.length(), + ucasemap_internalUTF8Fold, sink, edits, errorCode); +} + +int32_t CaseMap::utf8ToLower( + const char *locale, uint32_t options, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode) { + return ucasemap_mapUTF8( + ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8ToLower, edits, errorCode); } + +int32_t CaseMap::utf8ToUpper( + const char *locale, uint32_t options, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode) { + return ucasemap_mapUTF8( + ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8ToUpper, edits, errorCode); +} + +int32_t CaseMap::utf8Fold( + uint32_t options, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode) { + return ucasemap_mapUTF8( + UCASE_LOC_ROOT, options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8Fold, edits, errorCode); +} + +U_NAMESPACE_END diff --git a/deps/icu-small/source/common/ucasemap_imp.h b/deps/icu-small/source/common/ucasemap_imp.h new file mode 100644 index 00000000000000..99a64902794e7d --- /dev/null +++ b/deps/icu-small/source/common/ucasemap_imp.h @@ -0,0 +1,291 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// ucasemap_imp.h +// created: 2017feb08 Markus W. Scherer + +#ifndef __UCASEMAP_IMP_H__ +#define __UCASEMAP_IMP_H__ + +#include "unicode/utypes.h" +#include "unicode/ucasemap.h" +#include "unicode/uchar.h" +#include "ucase.h" + +/** + * Bit mask for the titlecasing iterator options bit field. + * Currently only 3 out of 8 values are used: + * 0 (words), U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. + * See stringoptions.h. + * @internal + */ +#define U_TITLECASE_ITERATOR_MASK 0xe0 + +/** + * Bit mask for the titlecasing index adjustment options bit set. + * Currently two bits are defined: + * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED. + * See stringoptions.h. + * @internal + */ +#define U_TITLECASE_ADJUSTMENT_MASK 0x600 + +/** + * Internal API, used by u_strcasecmp() etc. + * Compare strings case-insensitively, + * in code point order or code unit order. + */ +U_CFUNC int32_t +u_strcmpFold(const UChar *s1, int32_t length1, + const UChar *s2, int32_t length2, + uint32_t options, + UErrorCode *pErrorCode); + +/** + * Internal API, used for detecting length of + * shared prefix case-insensitively. + * @param s1 input string 1 + * @param length1 length of string 1, or -1 (NULL terminated) + * @param s2 input string 2 + * @param length2 length of string 2, or -1 (NULL terminated) + * @param options compare options + * @param matchLen1 (output) length of partial prefix match in s1 + * @param matchLen2 (output) length of partial prefix match in s2 + * @param pErrorCode receives error status + */ +U_CAPI void +u_caseInsensitivePrefixMatch(const UChar *s1, int32_t length1, + const UChar *s2, int32_t length2, + uint32_t options, + int32_t *matchLen1, int32_t *matchLen2, + UErrorCode *pErrorCode); + +/** + * Are the Unicode properties loaded? + * This must be used before internal functions are called that do + * not perform this check. + * Generate a debug assertion failure if data is not loaded. + */ +U_CFUNC UBool +uprv_haveProperties(UErrorCode *pErrorCode); + +#ifdef __cplusplus + +U_NAMESPACE_BEGIN + +class BreakIterator; // unicode/brkiter.h +class ByteSink; +class Locale; // unicode/locid.h + +/** Returns TRUE if the options are valid. Otherwise FALSE, and sets an error. */ +inline UBool ustrcase_checkTitleAdjustmentOptions(uint32_t options, UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { return FALSE; } + if ((options & U_TITLECASE_ADJUSTMENT_MASK) == U_TITLECASE_ADJUSTMENT_MASK) { + // Both options together. + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + return FALSE; + } + return TRUE; +} + +inline UBool ustrcase_isLNS(UChar32 c) { + // Letter, number, symbol, + // or a private use code point because those are typically used as letters or numbers. + // Consider modifier letters only if they are cased. + const uint32_t LNS = (U_GC_L_MASK|U_GC_N_MASK|U_GC_S_MASK|U_GC_CO_MASK) & ~U_GC_LM_MASK; + int gc = u_charType(c); + return (U_MASK(gc) & LNS) != 0 || (gc == U_MODIFIER_LETTER && ucase_getType(c) != UCASE_NONE); +} + +#if !UCONFIG_NO_BREAK_ITERATION + +/** Returns nullptr if error. Pass in either locale or locID, not both. */ +U_CFUNC +BreakIterator *ustrcase_getTitleBreakIterator( + const Locale *locale, const char *locID, uint32_t options, BreakIterator *iter, + LocalPointer &ownedIter, UErrorCode &errorCode); + +#endif + +U_NAMESPACE_END + +#include "unicode/unistr.h" // for UStringCaseMapper + +/* + * Internal string casing functions implementing + * ustring.h/ustrcase.cpp and UnicodeString case mapping functions. + */ + +struct UCaseMap : public icu::UMemory { + /** Implements most of ucasemap_open(). */ + UCaseMap(const char *localeID, uint32_t opts, UErrorCode *pErrorCode); + ~UCaseMap(); + +#if !UCONFIG_NO_BREAK_ITERATION + icu::BreakIterator *iter; /* We adopt the iterator, so we own it. */ +#endif + char locale[32]; + int32_t caseLocale; + uint32_t options; +}; + +#if UCONFIG_NO_BREAK_ITERATION +# define UCASEMAP_BREAK_ITERATOR_PARAM +# define UCASEMAP_BREAK_ITERATOR_UNUSED +# define UCASEMAP_BREAK_ITERATOR +# define UCASEMAP_BREAK_ITERATOR_NULL +#else +# define UCASEMAP_BREAK_ITERATOR_PARAM icu::BreakIterator *iter, +# define UCASEMAP_BREAK_ITERATOR_UNUSED icu::BreakIterator *, +# define UCASEMAP_BREAK_ITERATOR iter, +# define UCASEMAP_BREAK_ITERATOR_NULL NULL, +#endif + +U_CFUNC int32_t +ustrcase_getCaseLocale(const char *locale); + +// TODO: swap src / dest if approved for new public api +/** 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, + 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, + icu::Edits *edits, + UErrorCode &errorCode); + +#if !UCONFIG_NO_BREAK_ITERATION + +/** Implements UStringCaseMapper. */ +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, + icu::Edits *edits, + UErrorCode &errorCode); + +#endif + +/** 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, + icu::Edits *edits, + UErrorCode &errorCode); + +/** + * Common string case mapping implementation for ucasemap_toXyz() and UnicodeString::toXyz(). + * Implements argument checking. + */ +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, + UStringCaseMapper *stringCaseMapper, + icu::Edits *edits, + UErrorCode &errorCode); + +/** + * Common string case mapping implementation for old-fashioned u_strToXyz() functions + * that allow the source string to overlap the destination buffer. + * Implements argument checking and internally works with an intermediate buffer if necessary. + */ +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, + UStringCaseMapper *stringCaseMapper, + UErrorCode &errorCode); + +/** + * UTF-8 string case mapping function type, used by ucasemap_mapUTF8(). + * UTF-8 version of UStringCaseMapper. + * All error checking must be done. + * The UCaseMap must be fully initialized, with locale and/or iter set as needed. + */ +typedef void U_CALLCONV +UTF8CaseMapper(int32_t caseLocale, uint32_t options, +#if !UCONFIG_NO_BREAK_ITERATION + icu::BreakIterator *iter, +#endif + const uint8_t *src, int32_t srcLength, + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode); + +#if !UCONFIG_NO_BREAK_ITERATION + +/** Implements UTF8CaseMapper. */ +U_CFUNC void U_CALLCONV +ucasemap_internalUTF8ToTitle(int32_t caseLocale, uint32_t options, + icu::BreakIterator *iter, + const uint8_t *src, int32_t srcLength, + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode); + +#endif + +void +ucasemap_mapUTF8(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM + const char *src, int32_t srcLength, + UTF8CaseMapper *stringCaseMapper, + icu::ByteSink &sink, icu::Edits *edits, + UErrorCode &errorCode); + +/** + * Implements argument checking and buffer handling + * for UTF-8 string case mapping as a common function. + */ +int32_t +ucasemap_mapUTF8(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM + char *dest, int32_t destCapacity, + const char *src, int32_t srcLength, + UTF8CaseMapper *stringCaseMapper, + icu::Edits *edits, + UErrorCode &errorCode); + +U_NAMESPACE_BEGIN +namespace GreekUpper { + +// Data bits. +static const uint32_t UPPER_MASK = 0x3ff; +static const uint32_t HAS_VOWEL = 0x1000; +static const uint32_t HAS_YPOGEGRAMMENI = 0x2000; +static const uint32_t HAS_ACCENT = 0x4000; +static const uint32_t HAS_DIALYTIKA = 0x8000; +// Further bits during data building and processing, not stored in the data map. +static const uint32_t HAS_COMBINING_DIALYTIKA = 0x10000; +static const uint32_t HAS_OTHER_GREEK_DIACRITIC = 0x20000; + +static const uint32_t HAS_VOWEL_AND_ACCENT = HAS_VOWEL | HAS_ACCENT; +static const uint32_t HAS_VOWEL_AND_ACCENT_AND_DIALYTIKA = + HAS_VOWEL_AND_ACCENT | HAS_DIALYTIKA; +static const uint32_t HAS_EITHER_DIALYTIKA = HAS_DIALYTIKA | HAS_COMBINING_DIALYTIKA; + +// State bits. +static const uint32_t AFTER_CASED = 1; +static const uint32_t AFTER_VOWEL_WITH_ACCENT = 2; + +uint32_t getLetterData(UChar32 c); + +/** + * Returns a non-zero value for each of the Greek combining diacritics + * listed in The Unicode Standard, version 8, chapter 7.2 Greek, + * plus some perispomeni look-alikes. + */ +uint32_t getDiacriticData(UChar32 c); + +} // namespace GreekUpper +U_NAMESPACE_END + +#endif // __cplusplus + +#endif // __UCASEMAP_IMP_H__ diff --git a/deps/icu-small/source/common/ucasemap_titlecase_brkiter.cpp b/deps/icu-small/source/common/ucasemap_titlecase_brkiter.cpp index ab61e21765b7aa..c21dfb7698a8ad 100644 --- a/deps/icu-small/source/common/ucasemap_titlecase_brkiter.cpp +++ b/deps/icu-small/source/common/ucasemap_titlecase_brkiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucasemap_titlecase_brkiter.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -23,23 +23,79 @@ #include "unicode/brkiter.h" #include "unicode/ubrk.h" +#include "unicode/casemap.h" #include "unicode/ucasemap.h" #include "cmemory.h" #include "ucase.h" -#include "ustr_imp.h" +#include "ucasemap_imp.h" + +U_NAMESPACE_BEGIN + +void CaseMap::utf8ToTitle( + const char *locale, uint32_t options, BreakIterator *iter, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { + return; + } + UText utext = UTEXT_INITIALIZER; + utext_openUTF8(&utext, src.data(), src.length(), &errorCode); + LocalPointer ownedIter; + iter = ustrcase_getTitleBreakIterator(nullptr, locale, options, iter, ownedIter, errorCode); + if (iter == nullptr) { + utext_close(&utext); + return; + } + iter->setText(&utext, errorCode); + ucasemap_mapUTF8( + ustrcase_getCaseLocale(locale), options, iter, + src.data(), src.length(), + ucasemap_internalUTF8ToTitle, sink, edits, errorCode); + utext_close(&utext); +} + +int32_t CaseMap::utf8ToTitle( + const char *locale, uint32_t options, BreakIterator *iter, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { + return 0; + } + UText utext=UTEXT_INITIALIZER; + utext_openUTF8(&utext, src, srcLength, &errorCode); + LocalPointer ownedIter; + iter = ustrcase_getTitleBreakIterator(nullptr, locale, options, iter, ownedIter, errorCode); + if(iter==NULL) { + utext_close(&utext); + return 0; + } + iter->setText(&utext, errorCode); + int32_t length=ucasemap_mapUTF8( + ustrcase_getCaseLocale(locale), options, iter, + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8ToTitle, edits, errorCode); + utext_close(&utext); + return length; +} + +U_NAMESPACE_END U_NAMESPACE_USE U_CAPI const UBreakIterator * U_EXPORT2 ucasemap_getBreakIterator(const UCaseMap *csm) { - return csm->iter; + return reinterpret_cast(csm->iter); } U_CAPI void U_EXPORT2 -ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode * /*pErrorCode*/) { - // Do not call ubrk_close() so that we do not depend on all of the BreakIterator code. - delete reinterpret_cast(csm->iter); - csm->iter=iterToAdopt; +ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode) { + if(U_FAILURE(*pErrorCode)) { + return; + } + delete csm->iter; + csm->iter=reinterpret_cast(iterToAdopt); } U_CAPI int32_t U_EXPORT2 @@ -47,21 +103,30 @@ ucasemap_utf8ToTitle(UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode) { + if (U_FAILURE(*pErrorCode)) { + return 0; + } UText utext=UTEXT_INITIALIZER; utext_openUTF8(&utext, (const char *)src, srcLength, pErrorCode); - if(U_FAILURE(*pErrorCode)) { + if (U_FAILURE(*pErrorCode)) { return 0; } if(csm->iter==NULL) { - csm->iter=ubrk_open(UBRK_WORD, csm->locale, - NULL, 0, - pErrorCode); + LocalPointer ownedIter; + BreakIterator *iter = ustrcase_getTitleBreakIterator( + nullptr, csm->locale, csm->options, nullptr, ownedIter, *pErrorCode); + if (iter == nullptr) { + utext_close(&utext); + return 0; + } + csm->iter = ownedIter.orphan(); } - ubrk_setUText(csm->iter, &utext, pErrorCode); - int32_t length=ucasemap_mapUTF8(csm, - (uint8_t *)dest, destCapacity, - (const uint8_t *)src, srcLength, - ucasemap_internalUTF8ToTitle, pErrorCode); + csm->iter->setText(&utext, *pErrorCode); + int32_t length=ucasemap_mapUTF8( + csm->caseLocale, csm->options, csm->iter, + dest, destCapacity, + src, srcLength, + ucasemap_internalUTF8ToTitle, NULL, *pErrorCode); utext_close(&utext); return length; } diff --git a/deps/icu-small/source/common/ucat.c b/deps/icu-small/source/common/ucat.cpp similarity index 97% rename from deps/icu-small/source/common/ucat.c rename to deps/icu-small/source/common/ucat.cpp index cfd8b532958c33..dac56eeb5ce482 100644 --- a/deps/icu-small/source/common/ucat.c +++ b/deps/icu-small/source/common/ucat.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uchar.c b/deps/icu-small/source/common/uchar.cpp similarity index 98% rename from deps/icu-small/source/common/uchar.c rename to deps/icu-small/source/common/uchar.cpp index cf28f3f03cf541..c3f037d73eeda9 100644 --- a/deps/icu-small/source/common/uchar.c +++ b/deps/icu-small/source/common/uchar.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -68,6 +68,7 @@ struct _EnumTypeCallback { static uint32_t U_CALLCONV _enumTypeValue(const void *context, uint32_t value) { + (void)context; return GET_CATEGORY(value); } @@ -654,6 +655,8 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32 /* add the start code point to the USet */ const USetAdder *sa=(const USetAdder *)context; sa->add(sa->set, start); + (void)end; + (void)value; return TRUE; } @@ -726,8 +729,5 @@ upropsvec_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) { } /* add the start code point of each same-value range of the properties vectors trie */ - if(propsVectorsColumns>0) { - /* if propsVectorsColumns==0 then the properties vectors trie may not be there at all */ - utrie2_enum(&propsVectorsTrie, NULL, _enumPropertyStartsRange, sa); - } + utrie2_enum(&propsVectorsTrie, NULL, _enumPropertyStartsRange, sa); } diff --git a/deps/icu-small/source/common/uchar_props_data.h b/deps/icu-small/source/common/uchar_props_data.h index 79ba55eb75d570..94de36673d72e3 100644 --- a/deps/icu-small/source/common/uchar_props_data.h +++ b/deps/icu-small/source/common/uchar_props_data.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // Copyright (C) 1999-2016, International Business Machines @@ -11,145 +11,145 @@ #ifdef INCLUDED_FROM_UCHAR_C -static const UVersionInfo dataVersion={9,0,0,0}; +static const UVersionInfo dataVersion={0xa,0,0,0}; -static const uint16_t propsTrie_index[20780]={ -0x44e,0x456,0x45e,0x466,0x47e,0x486,0x48e,0x496,0x49e,0x4a6,0x4ac,0x4b4,0x4bc,0x4c4,0x4cc,0x4d4, -0x4da,0x4e2,0x4ea,0x4f2,0x4f5,0x4fd,0x505,0x50d,0x515,0x51d,0x519,0x521,0x529,0x531,0x536,0x53e, -0x546,0x54e,0x552,0x55a,0x562,0x56a,0x572,0x57a,0x576,0x57e,0x583,0x58b,0x591,0x599,0x5a1,0x5a9, -0x5b1,0x5b9,0x5c1,0x5c9,0x5ce,0x5d6,0x5d9,0x5e1,0x5e9,0x5f1,0x5f7,0x5ff,0x5fe,0x606,0x60e,0x616, -0x626,0x61e,0x62e,0x46e,0x46e,0x63e,0x646,0x636,0x656,0x658,0x660,0x64e,0x670,0x676,0x67e,0x668, -0x68e,0x694,0x69c,0x686,0x6ac,0x6b2,0x6ba,0x6a4,0x6ca,0x6d0,0x6d8,0x6c2,0x6e8,0x6f0,0x6f8,0x6e0, -0x708,0x70e,0x716,0x700,0x726,0x72c,0x734,0x71e,0x744,0x749,0x751,0x73c,0x761,0x768,0x770,0x759, -0x5fa,0x778,0x780,0x46e,0x788,0x790,0x798,0x46e,0x7a0,0x7a8,0x7b0,0x7b5,0x7bd,0x7c4,0x7cc,0x46e, -0x5b9,0x7d4,0x7dc,0x7e4,0x7ec,0x546,0x7fc,0x7f4,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x802,0x5b9,0x80a,0x800,0x812,0x5b9,0x80e,0x5b9,0x818,0x820,0x828,0x546,0x546,0x830, -0x838,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x83d,0x845,0x5b9,0x5b9,0x84d,0x855,0x85d,0x865,0x86d,0x5b9,0x875,0x87d,0x885, -0x895,0x5b9,0x89d,0x89f,0x8a7,0x88d,0x5b9,0x8aa,0x8be,0x8b2,0x8ba,0x8c6,0x5b9,0x8ce,0x8d4,0x8dc, -0x8e4,0x5b9,0x8f4,0x8fc,0x904,0x8ec,0x46e,0x46e,0x914,0x917,0x91f,0x90c,0x92f,0x927,0x5b9,0x936, -0x5b9,0x945,0x93e,0x94d,0x955,0x46e,0x95d,0x965,0x4ee,0x96d,0x970,0x976,0x97d,0x970,0x515,0x985, -0x49e,0x49e,0x49e,0x49e,0x98d,0x49e,0x49e,0x49e,0x99d,0x9a5,0x9ad,0x9b5,0x9bd,0x9c1,0x9c9,0x995, -0x9e1,0x9e9,0x9d1,0x9d9,0x9f1,0x9f9,0xa01,0xa09,0xa21,0xa11,0xa19,0xa29,0xa31,0xa40,0xa45,0xa38, -0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa55,0xa5d,0x8dc,0xa60,0xa68,0xa6f,0xa74,0xa7c, -0x8dc,0xa82,0xa81,0xa92,0xa95,0x8dc,0x8dc,0xa8a,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0xaa4,0xaac,0xa9c, -0x8dc,0x8dc,0x8dc,0xab1,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0xab7,0xabf,0x8dc,0xac7,0xace, -0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0xa4d,0xa4d,0xa4d,0xa4d,0xad6,0xa4d,0xadd,0xae4, -0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0xa4d,0x8dc,0xaec,0xaf3,0xaf7,0xafd,0xb03,0xb0b,0xb10, -0x546,0xb20,0xb18,0xb28,0x49e,0x49e,0x49e,0xb30,0x4ee,0xb38,0x5b9,0xb3e,0xb4e,0xb46,0xb46,0x515, -0xb56,0xb5e,0xb66,0x46e,0xb6e,0x8dc,0x8dc,0xb75,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0xb7d,0xb83, -0xb93,0xb8b,0x5fa,0x5b9,0xb9b,0x838,0x5b9,0xba3,0xbab,0xbb0,0x5b9,0x5b9,0xbb5,0x5a5,0x8dc,0xbbc, -0xbc4,0xbcc,0xbd2,0x8dc,0xbcc,0xbda,0x8dc,0xbc4,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc, -0xbe2,0x5b9,0x5b9,0x5b9,0xbea,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0xbf0,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xbf5,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x8aa,0x8dc,0x8dc, -0xbfd,0x5b9,0xc00,0x5b9,0xc08,0xc0e,0xc16,0xc1e,0xc23,0x5b9,0x5b9,0xc27,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc2e,0x5b9,0xc35,0xc3b,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc43,0x5b9,0x5b9,0x5b9,0xc4b,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc4d,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc54,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0xc5b,0x5b9,0x5b9,0x5b9,0xc62,0xc6a,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc6f,0x5b9,0x5b9,0xc77,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc7b,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc7e,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc81,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0xc87,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0xc8f,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0xc94,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc99,0x5b9,0x5b9,0x5b9,0xc9e,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0xca6,0xcad,0xcb1,0x5b9,0x5b9,0x5b9,0xcb8,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x8aa,0x46e, -0xcc6,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0xcbe,0x8dc,0xcce,0x94d,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0xcd3,0xcdb,0x49e,0xceb,0xce3,0x5b9,0x5b9,0xcf3,0xcfb,0xd0b,0x49e,0xd10,0xd18,0xd1e,0x46e,0xd03, -0xd26,0xd2e,0x5b9,0xd36,0xd46,0xd49,0xd3e,0xd51,0x60e,0xd59,0xd60,0xd68,0x656,0xd78,0xd70,0xd80, -0x5b9,0xd88,0xd90,0xd98,0x5b9,0xda0,0xda8,0xdb0,0xdb8,0xdc0,0xdc4,0xdcc,0x4ee,0x4ee,0x5b9,0xdd4, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xddc,0xde3,0x89e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb, -0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0x5b9,0x5b9,0x5b9,0xdfb,0x5b9,0xcb9,0xe02,0xe07, -0x5b9,0x5b9,0x5b9,0xe0f,0x5b9,0x5b9,0x8a9,0x46e,0xe25,0xe15,0xe1d,0x5b9,0x5b9,0xe2d,0xe35,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xe3a,0xe42,0x5b9,0xe46,0x5b9,0xe4c,0xe50, -0xe58,0xe60,0xe67,0xe6f,0x5b9,0x5b9,0x5b9,0xe75,0xe8d,0x45e,0xe95,0xe9d,0xea2,0x8be,0xe7d,0xe85, -0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb, -0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb,0xdeb, -0x11b8,0x11b8,0x11f8,0x1238,0x1278,0x12b0,0x12f0,0x1330,0x1368,0x13a8,0x13d4,0x1414,0x1454,0x1464,0x14a4,0x14d8, -0x1518,0x1548,0x1588,0x15c8,0x15d8,0x160c,0x1644,0x1684,0x16c4,0x1704,0x1738,0x1764,0x17a4,0x17dc,0x17f8,0x1838, +static const uint16_t propsTrie_index[21148]={ +0x45c,0x464,0x46c,0x474,0x48c,0x494,0x49c,0x4a4,0x4ac,0x4b4,0x4ba,0x4c2,0x4ca,0x4d2,0x4da,0x4e2, +0x4e8,0x4f0,0x4f8,0x500,0x503,0x50b,0x513,0x51b,0x523,0x52b,0x527,0x52f,0x537,0x53f,0x544,0x54c, +0x554,0x55c,0x560,0x568,0x570,0x578,0x580,0x588,0x584,0x58c,0x591,0x599,0x59f,0x5a7,0x5af,0x5b7, +0x5bf,0x5c7,0x5cf,0x5d7,0x5dc,0x5e4,0x5e7,0x5ef,0x5f7,0x5ff,0x605,0x60d,0x60c,0x614,0x61c,0x624, +0x634,0x62c,0x63c,0x644,0x47c,0x654,0x65c,0x64c,0x66c,0x66e,0x676,0x664,0x686,0x68c,0x694,0x67e, +0x6a4,0x6aa,0x6b2,0x69c,0x6c2,0x6c8,0x6d0,0x6ba,0x6e0,0x6e6,0x6ee,0x6d8,0x6fe,0x706,0x70e,0x6f6, +0x71e,0x724,0x72c,0x716,0x73c,0x742,0x74a,0x734,0x75a,0x75f,0x767,0x752,0x777,0x77e,0x786,0x76f, +0x608,0x78e,0x796,0x47c,0x79e,0x7a6,0x7ae,0x47c,0x7b6,0x7be,0x7c6,0x7cb,0x7d3,0x7da,0x7e2,0x47c, +0x5c7,0x7ea,0x7f2,0x7fa,0x802,0x554,0x812,0x80a,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x818,0x5c7,0x820,0x816,0x828,0x5c7,0x824,0x5c7,0x82e,0x836,0x83e,0x554,0x554,0x846, +0x84e,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x853,0x85b,0x5c7,0x5c7,0x863,0x86b,0x873,0x87b,0x883,0x5c7,0x88b,0x893,0x89b, +0x8ab,0x5c7,0x8b3,0x8b5,0x8bd,0x8a3,0x5c7,0x8c0,0x8d4,0x8c8,0x8d0,0x8dc,0x5c7,0x8e4,0x8ea,0x8f2, +0x8fa,0x5c7,0x90a,0x912,0x91a,0x902,0x47c,0x47c,0x92a,0x92d,0x935,0x922,0x945,0x93d,0x5c7,0x94c, +0x5c7,0x95b,0x954,0x963,0x96b,0x47c,0x973,0x97b,0x4fc,0x983,0x986,0x98c,0x993,0x986,0x523,0x99b, +0x4ac,0x4ac,0x4ac,0x4ac,0x9a3,0x4ac,0x4ac,0x4ac,0x9b3,0x9bb,0x9c3,0x9cb,0x9d3,0x9d7,0x9df,0x9ab, +0x9f7,0x9ff,0x9e7,0x9ef,0xa07,0xa0f,0xa17,0xa1f,0xa37,0xa27,0xa2f,0xa3f,0xa47,0xa56,0xa5b,0xa4e, +0xa63,0xa63,0xa63,0xa63,0xa63,0xa63,0xa63,0xa63,0xa6b,0xa73,0x8f2,0xa76,0xa7e,0xa85,0xa8a,0xa92, +0x8f2,0xa99,0xa98,0xaa9,0xaac,0x8f2,0x8f2,0xaa1,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0xabb,0xac3,0xab3, +0x8f2,0x8f2,0x8f2,0xac8,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0xace,0xad6,0x8f2,0xade,0xae5, +0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0xa63,0xa63,0xa63,0xa63,0xaed,0xa63,0xaf4,0xafb, +0xa63,0xa63,0xa63,0xa63,0xa63,0xa63,0xa63,0xa63,0x8f2,0xb03,0xb0a,0xb0e,0xb14,0xb1a,0xb22,0xb27, +0x554,0xb37,0xb2f,0xb3f,0x4ac,0x4ac,0x4ac,0xb47,0x4fc,0xb4f,0x5c7,0xb55,0xb65,0xb5d,0xb5d,0x523, +0xb6d,0xb75,0xb7d,0x47c,0xb85,0x8f2,0x8f2,0xb8c,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0xb94,0xb9a, +0xbaa,0xba2,0x608,0x5c7,0xbb2,0x84e,0x5c7,0xbba,0xbc2,0xbc7,0x5c7,0x5c7,0xbcc,0x5b3,0x8f2,0xbd3, +0xa93,0xbdb,0xbe1,0x8f2,0xbdb,0xbe9,0x8f2,0xa93,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2, +0xbf1,0x5c7,0x5c7,0x5c7,0xbf9,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0xbff,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc04,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x8c0,0x8f2,0x8f2, +0xc0c,0x5c7,0xc0f,0x5c7,0xc17,0xc1d,0xc25,0xc2d,0xc32,0x5c7,0x5c7,0xc36,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc3d,0x5c7,0xc44,0xc4a,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc52,0x5c7,0x5c7,0x5c7,0xc5a,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc5c,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc63,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0xc6a,0x5c7,0x5c7,0x5c7,0xc71,0xc79,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc7e,0x5c7,0x5c7,0xc86,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc8a,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc8d,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc90,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0xc96,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0xc9e,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0xca3,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xca8,0x5c7,0x5c7,0x5c7,0xcad,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0xcb5,0xcbc,0xcc0,0x5c7,0x5c7,0x5c7,0xcc7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x644, +0xcd5,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0xccd,0x8f2,0xcdd,0x963,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0xce2,0xcea,0x4ac,0xcfa,0xcf2,0x5c7,0x5c7,0xd02,0xd0a,0xd1a,0x4ac,0xd1f,0xd27,0xd2d,0x47c,0xd12, +0xd35,0xd3d,0x5c7,0xd45,0xd55,0xd58,0xd4d,0xd60,0x61c,0xd68,0xd6f,0xd77,0x66c,0xd87,0xd7f,0xd8f, +0x5c7,0xd97,0xd9f,0xda7,0x5c7,0xdaf,0xdb7,0xdbf,0xdc7,0xdcf,0xdd3,0xddb,0x4fc,0x4fc,0x5c7,0xde3, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xdeb,0xdf2,0x8b4, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa, +0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0x5c7,0x5c7,0x5c7,0xe0a,0x5c7,0xcc8,0xe11,0xe16, +0x5c7,0x5c7,0x5c7,0xe1e,0x5c7,0x5c7,0x8bf,0x47c,0xe34,0xe24,0xe2c,0x5c7,0x5c7,0xe3c,0xe44,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xe49,0xe51,0x5c7,0xe55,0x5c7,0xe5b,0xe5f, +0xe67,0xe6f,0xe76,0xe7e,0x5c7,0x5c7,0x5c7,0xe84,0xe9c,0x46c,0xea4,0xeac,0xeb1,0x8d4,0xe8c,0xe94, +0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa, +0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa,0xdfa, +0x11f0,0x11f0,0x1230,0x1270,0x12b0,0x12e8,0x1328,0x1368,0x13a0,0x13e0,0x140c,0x144c,0x148c,0x149c,0x14dc,0x1510, +0x1550,0x1580,0x15c0,0x1600,0x1610,0x1644,0x167c,0x16bc,0x16fc,0x173c,0x1770,0x179c,0x17dc,0x1814,0x1830,0x1870, 0xa80,0xac0,0xb00,0xb3b,0xb7b,0xa40,0xbbb,0xa40,0xbdd,0xa40,0xa40,0xa40,0xa40,0xc1d,0x1db,0x1db, 0xc5d,0xc9d,0xa40,0xa40,0xa40,0xa40,0xcdd,0xcfd,0xa40,0xa40,0xd3d,0xd7d,0xdbd,0xdfd,0xe3d,0xe7d, 0xebd,0xef4,0x1db,0x1db,0xf18,0xf4c,0x1db,0xf74,0x1db,0x1db,0x1db,0x1db,0xfa1,0x1db,0x1db,0x1db, -0x1db,0x1db,0x1db,0x1db,0xfb5,0x1db,0xfed,0x102d,0x1db,0x1038,0xa40,0xa40,0xa40,0xa40,0xa40,0x1078, +0x1db,0x1db,0x1db,0x1db,0xfb5,0x1db,0xfed,0x102d,0x1db,0x1038,0x1db,0x1db,0x1db,0x106e,0xa40,0x10ae, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, @@ -172,1117 +172,1136 @@ static const uint16_t propsTrie_index[20780]={ 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0x10b8,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, +0x10ee,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, 0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700, -0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x10f8, +0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x112e, 0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700, -0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x10f8, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0xeaa,0xeb1,0xeb9,0x46e,0x5b9,0x5b9,0x5b9,0x5a5,0xec9,0xec1,0xee0,0xed1,0xed8,0xee8,0xb6a,0xef0, -0x46e,0x46e,0x46e,0x46e,0xd68,0x5b9,0xef8,0xf00,0x5b9,0xf08,0xf10,0xf14,0xf1c,0x5b9,0xf24,0x46e, -0x546,0x550,0xf2c,0x5b9,0xf30,0xf38,0xf48,0xf40,0x5b9,0xf50,0x5b9,0xf57,0x46e,0x46e,0x46e,0x46e, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xb4e,0x8aa,0xe4c,0x46e,0x46e,0x46e,0x46e, -0xf67,0xf5f,0xf6a,0xf72,0x8be,0xf7a,0x46e,0xf82,0xf8a,0xf92,0x46e,0x46e,0x5b9,0xfa2,0xfaa,0xf9a, -0xfba,0xfc1,0xfb2,0xfc9,0xfd1,0x46e,0xfe1,0xfd9,0x5b9,0xfe4,0xfec,0xff4,0xffc,0x1004,0x46e,0x46e, -0x5b9,0x5b9,0x100c,0x46e,0x546,0x1014,0x4ee,0x101c,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x1024,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x1034,0x5ef,0x103c,0x102c,0x92f,0x1044,0x104c,0x1052,0x106a,0x105a,0x1062,0x106e,0x92f,0x107e,0x1076,0x1086, -0x1096,0x108e,0x46e,0x46e,0x109d,0x10a5,0x611,0x10ad,0x10bd,0x6b2,0x10c5,0x10b5,0x46e,0x46e,0x46e,0x46e, -0x5b9,0x10cd,0x10d5,0x46e,0x5b9,0x10dd,0x10e5,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x10ed,0x10f5,0x46e, -0x5b9,0x10fd,0x1105,0x110d,0x5b9,0x111d,0x1115,0x46e,0x112d,0x1125,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x546,0x4ee,0x1135,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x5b9,0x113d,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x1153,0x1158,0x1145,0x114d,0x1168, -0x1160,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x8a9,0x46e,0x46e,0x46e,0x1178,0x1180,0x1188,0x1170,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x1190,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x1198,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x119a, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x113d,0x8be, -0x11a2,0x46e,0x46e,0xe42,0x11aa,0x5b9,0x11ba,0x11c2,0x11ca,0x11b2,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x11d2,0x11d7,0x11df,0x46e,0x46e,0x11e7,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x11ef,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x11f7,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x11ff,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9, -0x1207,0x120c,0x1214,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x8dc,0x8dc,0x8dc, -0x8dc,0x8dc,0x8dc,0x8dc,0xb7d,0x8dc,0x121c,0x8dc,0x1223,0x122b,0x1231,0x8dc,0x1237,0x8dc,0x8dc,0x123f, -0x46e,0x46e,0x46e,0x46e,0x46e,0x8dc,0x8dc,0xa7e,0x1247,0x46e,0x46e,0x46e,0x46e,0x1257,0x125e,0x1263, -0x1269,0x1271,0x1279,0x1281,0x125b,0x1289,0x1291,0x1299,0x129e,0x1270,0x1257,0x125e,0x125a,0x1269,0x12a6,0x1258, -0x12a9,0x125b,0x12b1,0x12b9,0x12c1,0x12c8,0x12b4,0x12bc,0x12c4,0x12cb,0x12b7,0x12d3,0x124f,0x8dc,0x8dc,0x8dc, -0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x515,0x12e3,0x515, -0x12ea,0x12f1,0x12db,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x12f8,0x1300,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x1308,0x46e,0x546,0x1318,0x1310,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x1328,0x1330,0x1338, -0x1340,0x1348,0x1350,0x46e,0x1320,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x8dc,0x1358,0x8dc, -0x8dc,0xb75,0x135d,0x1361,0xb7d,0x1369,0x136e,0x8dc,0x1358,0x8dc,0x1236,0x46e,0x1376,0x137e,0x1382,0x138a, -0x46e,0x46e,0x46e,0x46e,0x46e,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x1392,0x8dc,0x8dc,0x8dc, -0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc,0x8dc, -0x8dc,0x8dc,0x8dc,0xa7f,0x139a,0x8dc,0x8dc,0x8dc,0xb75,0x8dc,0x8dc,0x13a2,0x46e,0x1358,0x8dc,0x13aa, -0x8dc,0x13b2,0xb7f,0x46e,0x46e,0x13ba,0x13c2,0x13ca,0x46e,0xb7e,0x46e,0xee8,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x13d2,0x5b9,0x5b9, -0x13d9,0x5b9,0x5b9,0x5b9,0x13e1,0x5b9,0x13e9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xc5f,0x5b9,0x5b9, -0x13f1,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x13f9,0x1401,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0xc9e,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x1408,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x140f,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x1416,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xb4e,0x46e,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x141a,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xf30,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x11ff,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x5b9,0x5b9,0x5b9,0x5b9,0x1422,0x5b9,0x5b9,0x5b9, -0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0x5b9,0xf30,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x1432,0x142a,0x142a,0x142a,0x46e,0x46e,0x46e,0x46e, -0x515,0x515,0x515,0x515,0x515,0x515,0x515,0x143a,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, -0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3, -0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0xdf3,0x1442,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, +0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x700,0x112e, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0xeb9,0xec0,0xec8,0x47c,0x5c7,0x5c7,0x5c7,0x5b3,0xed8,0xed0,0xeef,0xee0,0xee7,0xef7,0xb81,0xeff, +0x47c,0x47c,0x47c,0x47c,0xd77,0x5c7,0xf07,0xf0f,0x5c7,0xf17,0xf1f,0xf23,0xf2b,0x5c7,0xf33,0x47c, +0x554,0x55e,0xf3b,0x5c7,0xf3f,0xf47,0xf57,0xf4f,0x5c7,0xf5f,0x5c7,0xf66,0x47c,0x47c,0x47c,0x47c, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xb65,0x8c0,0xe5b,0x47c,0x47c,0x47c,0x47c, +0xf76,0xf6e,0xf79,0xf81,0x8d4,0xf89,0x47c,0xf91,0xf99,0xfa1,0x47c,0x47c,0x5c7,0xfb1,0xfb9,0xfa9, +0xfc9,0xfd0,0xfc1,0xfd8,0xfe0,0x47c,0xff0,0xfe8,0x5c7,0xff3,0xffb,0x1003,0x100b,0x1013,0x47c,0x47c, +0x5c7,0x5c7,0x101b,0x47c,0x554,0x1023,0x4fc,0x102b,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x1033,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x1043,0x5fd,0x104b,0x103b,0x945,0x1053,0x105b,0x1061,0x1079,0x1069,0x1071,0x107d,0x945,0x108d,0x1085,0x1095, +0x10a5,0x109d,0x47c,0x47c,0x10ac,0x10b4,0x61f,0x10bc,0x10cc,0x6c8,0x10d4,0x10c4,0x47c,0x47c,0x47c,0x47c, +0x5c7,0x10dc,0x10e4,0x47c,0x5c7,0x10ec,0x10f4,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x10fc,0x1104,0x47c, +0x5c7,0x110c,0x1114,0x111c,0x5c7,0x112c,0x1124,0x47c,0x113c,0x1134,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x554,0x4fc,0x1144,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x115c,0x114c,0x1154,0x5c7,0x116c, +0x1164,0x5c7,0x1174,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x118a,0x118f,0x117c,0x1184,0x119f, +0x1197,0x47c,0x47c,0x11ae,0x11b2,0x11a6,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x8bf,0x47c,0x47c,0x47c,0x11c2,0x11ca,0x11d2,0x11ba,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x11da,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x11e2,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x11e4, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x1174,0x8d4, +0x11ec,0x47c,0x47c,0xe51,0x11f4,0x5c7,0x1204,0x120c,0x1214,0x11fc,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x121c,0x1221,0x1229,0x47c,0x47c,0x1231,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x1239,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x1241,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x8d4,0x47c,0x47c,0xe51,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x8b4,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7, +0x1249,0x124e,0x1256,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x8f2,0x8f2,0x8f2, +0x8f2,0x8f2,0x8f2,0x8f2,0xb94,0x8f2,0x125e,0x8f2,0x1265,0x126d,0x1273,0x8f2,0x1279,0x8f2,0x8f2,0x1281, +0x47c,0x47c,0x47c,0x47c,0x47c,0x8f2,0x8f2,0xa95,0x1289,0x47c,0x47c,0x47c,0x47c,0x1299,0x12a0,0x12a5, +0x12ab,0x12b3,0x12bb,0x12c3,0x129d,0x12cb,0x12d3,0x12db,0x12e0,0x12b2,0x1299,0x12a0,0x129c,0x12ab,0x12e8,0x129a, +0x12eb,0x129d,0x12f3,0x12fb,0x1303,0x130a,0x12f6,0x12fe,0x1306,0x130d,0x12f9,0x1315,0x1291,0x8f2,0x8f2,0x8f2, +0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x523,0x1325,0x523, +0x132c,0x1333,0x131d,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x133a,0x1342,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x134a,0x47c,0x554,0x135a,0x1352,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x136a,0x1372,0x137a, +0x1382,0x138a,0x1392,0x47c,0x1362,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x8f2,0x139a,0x8f2, +0x8f2,0xb8c,0x139f,0x13a3,0xb94,0x13ab,0x13b0,0x8f2,0x139a,0x8f2,0x1278,0x47c,0x13b8,0x13c0,0x13c4,0x13cc, +0x13d4,0x47c,0x47c,0x47c,0x47c,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x13dc,0x8f2,0x8f2,0x8f2, +0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2,0x8f2, +0x8f2,0x8f2,0x8f2,0x13e4,0x13ec,0x8f2,0x8f2,0x8f2,0xb8c,0x8f2,0x8f2,0x13e4,0x47c,0x139a,0x8f2,0x13f4, +0x8f2,0x13fc,0xb96,0x47c,0x47c,0x139a,0xa93,0x1401,0x1406,0x140e,0x47c,0x1416,0xa99,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x141e,0x5c7,0x5c7, +0x1425,0x5c7,0x5c7,0x5c7,0x142d,0x5c7,0x1435,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xc6e,0x5c7,0x5c7, +0x143d,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x1445,0x144d,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0xcad,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x1454,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x145b,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x1462,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xb65,0x47c,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x1466,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xf3f,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x146e,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, +0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x1476,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x5c7,0x5c7, +0x5c7,0x5c7,0x147e,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0xf3f,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x148e,0x1486, +0x1486,0x1486,0x47c,0x47c,0x47c,0x47c,0x523,0x523,0x523,0x523,0x523,0x523,0x523,0x1496,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c, +0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0x47c,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02, +0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0xe02,0x149e,0x45b,0x45b, 0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, -0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xc,0x17,0x17,0x17,0x19,0x17,0x17,0x17, -0x14,0x15,0x17,0x18,0x17,0x13,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0x17,0x17,0x18,0x18,0x18,0x17,0x17,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,0x14,0x17,0x15,0x1a,0x16,0x1a,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,0x14,0x18,0x15,0x18,0xf,0,0,0,0,0,0,0,0, +0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, +0xc,0x17,0x17,0x17,0x19,0x17,0x17,0x17,0x14,0x15,0x17,0x18,0x17,0x13,0x17,0x17, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0x18,0x18,0x18,0x17, +0x17,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0x14,0x17,0x15,0x1a,0x16, +0x1a,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0x14,0x18,0x15,0x18,0xf, 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,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, 0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, -0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xc,0x17,0x19,0x19,0x19,0x19,0x1b,0x17, -0x1a,0x1b,5,0x1c,0x18,0x10,0x1b,0x1a,0x1b,0x18,0x34b,0x38b,0x1a,2,0x17,0x17, -0x1a,0x30b,5,0x1d,0x34cb,0x344b,0x3ccb,0x17,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x18, -1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0x18, -2,2,2,2,2,2,2,2,1,2,1,2,1,2,1,2, +0xc,0x17,0x19,0x19,0x19,0x19,0x1b,0x17,0x1a,0x1b,5,0x1c,0x18,0x10,0x1b,0x1a, +0x1b,0x18,0x34b,0x38b,0x1a,2,0x17,0x17,0x1a,0x30b,5,0x1d,0x34cb,0x344b,0x3ccb,0x17, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0x18,1,1,1,1,1,1,1,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,0x18,2,2,2,2,2,2,2,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -2,1,2,1,2,1,2,1,2,2,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,2,1,2,1,2,1,2,1, +2,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,2, -2,1,1,2,1,2,1,1,2,1,1,1,2,2,1,1, -1,1,2,1,1,2,1,1,1,2,2,2,1,1,2,1, -1,2,1,2,1,2,1,1,2,1,2,2,1,2,1,1, -2,1,1,1,2,1,2,1,1,2,2,5,1,2,2,2, -5,5,5,5,1,3,2,1,3,2,1,3,2,1,2,1, -2,1,2,1,2,1,2,1,2,1,2,1,2,2,1,2, +1,1,2,1,2,1,2,2,2,1,1,2,1,2,1,1, +2,1,1,1,2,2,1,1,1,1,2,1,1,2,1,1, +1,2,2,2,1,1,2,1,1,2,1,2,1,2,1,1, +2,1,2,2,1,2,1,1,2,1,1,1,2,1,2,1, +1,2,2,5,1,2,2,2,5,5,5,5,1,3,2,1, +3,2,1,3,2,1,2,1,2,1,2,1,2,1,2,1, +2,1,2,1,2,2,1,2,1,2,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,2,1,3,2,1,2,1,1, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -2,1,3,2,1,2,1,1,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,1,2,1,2,2,2,2,2, -2,2,1,1,2,1,1,2,2,1,2,1,1,1,1,2, -1,2,1,2,1,2,1,2,2,2,2,2,2,2,2,2, +1,2,1,2,2,2,2,2,2,2,1,1,2,1,1,2, +2,1,2,1,1,1,1,2,1,2,1,2,1,2,1,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,5,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,0x1a,0x1a,0x1a,0x1a,4,4,4,4,4,4, -4,4,4,4,4,4,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, -0x1a,0x1a,0x1a,0x1a,4,4,4,4,4,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, -4,0x1a,4,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, -0x1a,0x1a,0x1a,0x1a,6,6,6,6,6,6,6,6,6,6,6,6, +5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,0x1a,0x1a, +0x1a,0x1a,4,4,4,4,4,4,4,4,4,4,4,4,0x1a,0x1a, +0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,4,4,4,4, +4,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,4,0x1a,4,0x1a,0x1a,0x1a,0x1a,0x1a, +0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,1,2,1,2,4,0x1a,1,2,0,0,4,2, -2,2,0x17,1,0,0,0,0,0x1a,0x1a,1,0x17,1,1,1,0, -1,0,1,1,2,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,1,2,2,1,1,1,2,2,2, +6,6,6,6,6,6,6,6,6,6,6,6,1,2,1,2, +4,0x1a,1,2,0,0,4,2,2,2,0x17,1,0,0,0,0, +0x1a,0x1a,1,0x17,1,1,1,0,1,0,1,1,2,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1, +1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1, +2,2,1,1,1,2,2,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,2,2,2,2,1,2,0x18,1, -2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1, +2,2,2,2,1,2,0x18,1,2,1,1,2,2,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,1,2,1,2,1,2,1,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,1,2,0x1b,6,6,6,6,6, -7,7,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, +1,2,0x1b,6,6,6,6,6,7,7,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1, -2,1,2,1,2,1,2,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,0,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,0,0,4,0x17,0x17,0x17,0x17,0x17,0x17,0,2,2,2, +1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,2, +1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, +0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0,0,4,0x17,0x17, +0x17,0x17,0x17,0x17,0,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,0,0x17,0x13,0, -0,0x1b,0x1b,0x19,0,6,6,6,6,6,6,6,6,6,6,6, +2,2,2,2,0,0x17,0x13,0,0,0x1b,0x1b,0x19,0,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,0x13,6,0x17,6,6,0x17,6,6,0x17,6,0,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, -0,0,0,0,5,5,5,0x17,0x17,0,0,0,0,0,0,0, -0,0,0,0,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x18,0x18,0x17,0x17,0x19, -0x17,0x17,0x1b,0x1b,6,6,6,6,6,6,6,6,6,6,6,0x17, -0x10,0,0x17,0x17,5,5,5,5,5,5,5,5,5,5,5,5, +6,6,6,6,6,6,6,6,6,6,0x13,6,0x17,6,6,0x17, +6,6,0x17,6,0,0,0,0,0,0,0,0,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,4,5,5,5,5,5,5,5,5,5,5,6, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17, -0x17,0x17,5,5,6,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,0,0,0,0,5,5,5,0x17, +0x17,0,0,0,0,0,0,0,0,0,0,0,0x10,0x10,0x10,0x10, +0x10,0x10,0x18,0x18,0x18,0x17,0x17,0x19,0x17,0x17,0x1b,0x1b,6,6,6,6, +6,6,6,6,6,6,6,0x17,0x10,0,0x17,0x17,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,5, +5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0x17,0x17,5,5,6,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0x17,5,6,6,6,6,6,6, -6,0x10,0x1b,6,6,6,6,6,6,4,4,6,6,0x1b,6,6, -6,6,5,5,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5, -5,0x1b,0x1b,5,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0,0x10,5,6,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,6,0,0,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +0x17,5,6,6,6,6,6,6,6,0x10,0x1b,6,6,6,6,6, +6,4,4,6,6,0x1b,6,6,6,6,5,5,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,0x1b,0x1b,5,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0x10,5,6,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6, -6,6,6,6,6,6,6,6,6,5,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0, +0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,6,6,6,6,6,6,6,6,6,4,4,0x1b,0x17, -0x17,0x17,4,0,0,0,0,0,6,6,6,6,4,6,6,6, -4,6,6,6,6,6,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6, -6,6,4,6,6,6,6,6,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,6,6,6,0,0,0x17,0,6,6,0x10,6,6,6,6,6, +5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6, +6,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6, +6,6,6,6,4,4,0x1b,0x17,0x17,0x17,4,0,0,0,0,0, +6,6,6,6,4,6,6,6,4,6,6,6,6,6,0,0, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,6,6,6,6,4,6,6,6,6,6, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,6,6,6,0,0,0x17,0, +5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +6,6,0x10,6,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0,5,5, -5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6, -6,6,6,6,6,6,6,6,5,5,6,6,0x17,0x17,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,4,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,6,6,6,8,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,6,8,6,5,8,8, -8,6,6,6,6,6,6,6,6,8,8,8,8,6,8,8, -5,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5, -5,5,6,6,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, -5,5,0x19,0x19,0x37cb,0x35cb,0x3fcb,0x34cb,0x3ccb,0x94b,0x1b,0x19,0,0,0,0, -5,6,8,8,0,5,5,5,5,5,5,5,5,0,0,5, +5,5,5,5,5,0,5,5,5,5,5,5,5,5,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6, +5,5,6,6,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, +0x17,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +6,6,6,8,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,6,8,6,5,8,8,8,6,6,6,6,6,6,6, +6,8,8,8,8,6,8,8,5,6,6,6,6,6,6,6, +5,5,5,5,5,5,5,5,5,5,6,6,0,0,0x49,0x89, +0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,0x19,0x19,0x37cb,0x35cb,0x3fcb,0x34cb, +0x3ccb,0x94b,0x1b,0x19,5,0x17,0,0,5,6,8,8,0,5,5,5, +5,5,5,5,5,0,0,5,5,0,0,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,5,5,5,5,5,5, +5,0,5,0,0,0,5,5,5,5,0,0,6,5,8,8, +8,6,6,6,6,0,0,8,8,0,0,8,8,6,5,0, +0,0,0,0,0,0,0,8,0,0,0,0,5,5,0,5, +0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, +6,6,5,5,5,6,0,0,0,0,0,0,0,0,0,0, +0,6,6,8,0,5,5,5,5,5,5,0,0,0,0,5, 5,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,5,5,5,5,5,5,5,0,5,0,0,0,5,5, -5,5,0,0,6,5,8,8,8,6,6,6,6,0,0,8, -8,0,0,8,8,6,5,0,0,0,0,0,0,0,0,8, -0,0,0,0,5,5,0,5,0,0,0,0,0,0,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,6,6,5,5,5,6,0,0, -0,0,0,0,0,0,0,0,0,6,6,8,0,5,5,5, -5,5,5,0,0,0,0,5,5,0,0,5,5,5,5,5, +5,0,5,5,5,5,5,5,5,0,5,5,0,5,5,0, +5,5,0,0,6,0,8,8,8,6,6,0,0,0,0,6, +6,0,0,6,6,6,0,0,0,6,0,0,0,0,0,0, +0,5,5,5,5,0,5,0,5,5,6,6,0,0,0x49,0x89, +0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x19,0,0,0,0,0,0, +0,5,6,6,6,6,6,6,0,6,6,8,0,5,5,5, +5,5,5,5,5,5,0,5,5,5,0,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,0,5,5,5,5,5,5, -5,0,5,5,0,5,5,0,5,5,0,0,6,0,8,8, -8,6,6,0,0,0,0,6,6,0,0,6,6,6,0,0, -0,6,0,0,0,0,0,0,0,5,5,5,5,0,5,0, +5,0,5,5,0,5,5,5,5,5,0,0,6,5,8,8, +8,6,6,6,6,6,0,6,6,8,0,8,8,6,0,0, +5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 5,5,6,6,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, -0x17,0x19,0,0,0,0,0,0,0,5,0,0,0,0,0,0, -0,6,6,8,0,5,5,5,5,5,5,5,5,5,0,5, -5,5,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +0x1b,5,0x34cb,0x344b,0x3ccb,0x37cb,0x35cb,0x3fcb,0,0,0,0,0,0,0,0, +0,6,8,8,0,5,5,5,5,5,5,5,5,0,0,5, +5,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,0,5,5,5,5,5,5,5,0,5,5,0,5,5,5, -5,5,0,0,6,5,8,8,8,6,6,6,6,6,0,6, -6,8,0,8,8,6,0,0,5,0,0,0,0,0,0,0, +5,5,0,0,6,5,8,6,8,6,6,6,6,0,0,8, +8,0,0,8,8,6,0,0,0,0,0,0,0,0,6,8, +0,0,0,0,5,5,0,5,0,0,0,0,0,0,0x49,0x89, +0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x7cb,0x1e4b,0x784b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x19,0x1b,0,0,0,0,0,0,0,6,5,0,5,5,5, +5,5,5,0,0,0,5,5,5,0,5,5,5,5,0,0, +0,5,5,0,5,0,5,5,0,0,0,5,5,0,0,0, +5,5,5,0,0,0,5,5,5,5,5,5,5,5,5,5, +5,5,0,0,0,0,8,8,6,8,8,0,0,0,8,8, +8,0,8,8,8,6,0,0,5,0,0,0,0,0,0,8, 0,0,0,0,0,0,0,0,5,5,6,6,0,0,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x1b,5,0x34cb,0x344b,0x3ccb,0x37cb,0x35cb,0x3fcb, -0,0,0,0,0,0,0,0,0,6,8,8,0,5,5,5, -5,5,5,5,5,0,0,5,5,0,0,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,0,5,5,5,5,5,5, -5,0,5,5,0,5,5,5,5,5,0,0,6,5,8,6, -8,6,6,6,6,0,0,8,8,0,0,8,8,6,0,0, -0,0,0,0,0,0,6,8,0,0,0,0,5,5,0,5, -0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, -0x7cb,0x1e4b,0x784b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x19,0x1b,0,0,0,0,0, -0,0,6,5,0,5,5,5,5,5,5,0,0,0,5,5, -5,0,5,5,5,5,0,0,0,5,5,0,5,0,5,5, -0,0,0,5,5,0,0,0,5,5,5,0,0,0,5,5, -5,5,5,5,5,5,5,5,5,5,0,0,0,0,8,8, -6,8,8,0,0,0,8,8,8,0,8,8,8,6,0,0, -5,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0, -5,5,6,6,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, -0,0,0,0,0,0,0,0,0x54b,0x58b,0x5cb,0x60b,0x58b,0x5cb,0x60b,0x1b, -6,8,8,8,0,5,5,5,5,5,5,5,5,0,5,5, -5,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,0,0,5,6,6,6,8,8,8,8,0,6,6, -6,0,6,6,6,6,0,0,0,0,0,0,0,6,6,0, -5,5,5,0,0,0,0,0,5,5,6,6,0,0,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,5,5,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,6,8,8,0,5,5,5, +0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0,0,0, +0x54b,0x58b,0x5cb,0x60b,0x58b,0x5cb,0x60b,0x1b,6,8,8,8,0,5,5,5, 5,5,5,5,5,0,5,5,5,0,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,0,5,5,5,5,5,5, -5,5,5,5,0,5,5,5,5,5,0,0,6,5,8,6, -8,8,8,8,8,0,6,8,8,0,8,8,6,6,0,0, -0,0,0,0,0,8,8,0,0,0,0,0,0,0,5,0, +5,5,5,5,5,5,5,5,5,5,0,0,0,5,6,6, +6,8,8,8,8,0,6,6,6,0,6,6,6,6,0,0, +0,0,0,0,0,6,6,0,5,5,5,0,0,0,0,0, 5,5,6,6,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, -0x7cb,0x1e4b,0x784b,0x34cb,0x344b,0x3ccb,0x37cb,0x35cb,0x3fcb,0x1b,5,5,5,5,5,5, -0,6,8,8,0,5,5,5,5,5,5,5,5,0,5,5, +0,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0, +5,6,8,8,0,5,5,5,5,5,5,5,5,0,5,5, 5,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, -0,5,8,8,8,6,6,6,6,0,8,8,8,0,8,8, -8,6,5,0x1b,0,0,0,0,5,5,5,8,0xcc0b,0xca0b,0xcb4b,0xc90b, -0x364b,0xc94b,0x350b,5,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189, -0x1c9,0x209,0x249,0x289,0,0,8,8,0x17,0,0,0,0,0,0,0, -0,0,0,0,0,0,8,8,0,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0,0,0,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,5,5,5,5,5,5,5,5,5,0,5,0,0, -5,5,5,5,5,5,5,0,0,0,6,0,0,0,0,8, -8,8,6,6,6,0,6,0,8,8,8,8,8,8,8,8, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,6,5,5,6,6,6,6,6,6,6,0,0,0,0,0x19, -5,5,5,5,5,5,4,6,6,6,6,6,6,6,6,0x17, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0,0,0,0, -0,5,5,0,5,0,0,5,5,0,5,0,0,5,0,0, -0,0,0,0,5,5,5,5,0,5,5,5,5,5,5,5, -0,5,5,5,0,5,0,5,0,0,5,5,0,5,5,5, -5,6,5,5,6,6,6,6,6,6,0,6,6,5,0,0, -5,5,5,5,5,0,4,0,6,6,6,6,6,6,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,5,5,5,5, -5,0x1b,0x1b,0x1b,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0x17,0x1b,0x17,0x1b,0x1b,0x1b,6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x344b,0x3c4b,0x444b,0x4c4b,0x544b,0x5c4b, -0x644b,0x6c4b,0x744b,0x2c4b,0x1b,6,0x1b,6,0x1b,6,0x14,0x15,0x14,0x15,8,8, -5,5,5,5,5,5,5,5,0,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,8,6,6,6,6,6,0x17,6,6,5,5,5,5, -5,6,6,6,6,6,6,6,6,6,6,6,0,6,6,6, +5,0,5,5,5,5,5,5,5,5,5,5,0,5,5,5, +5,5,0,0,6,5,8,6,8,8,8,8,8,0,6,8, +8,0,8,8,6,6,0,0,0,0,0,0,0,8,8,0, +0,0,0,0,0,0,5,0,5,5,6,6,0,0,0x49,0x89, +0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x7cb,0x1e4b,0x784b,0x34cb,0x344b,0x3ccb,0x37cb,0x35cb, +0x3fcb,0x1b,5,5,5,5,5,5,6,6,8,8,0,5,5,5, +5,5,5,5,5,0,5,5,5,0,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,6,6,5,8,8,8,6,6,6, +6,0,8,8,8,0,8,8,8,6,5,0x1b,0,0,0,0, +5,5,5,8,0xcc0b,0xca0b,0xcb4b,0xc90b,0x364b,0xc94b,0x350b,5,0,0,0,0, +0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,8,8, +0x17,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8, +0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,0,0,0,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,0,5,5,5,5,5, +5,5,5,5,0,5,0,0,5,5,5,5,5,5,5,0, +0,0,6,0,0,0,0,8,8,8,6,6,6,0,6,0, +8,8,8,8,8,8,8,8,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,6,5,5,6,6,6,6, +6,6,6,0,0,0,0,0x19,5,5,5,5,5,5,4,6, +6,6,6,6,6,6,6,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0x17,0x17,0,0,0,0,0,5,5,0,5,0,0,5, +5,0,5,0,0,5,0,0,0,0,0,0,5,5,5,5, +0,5,5,5,5,5,5,5,0,5,5,5,0,5,0,5, +0,0,5,5,0,5,5,5,5,6,5,5,6,6,6,6, +6,6,0,6,6,5,0,0,5,5,5,5,5,0,4,0, +6,6,6,6,6,6,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0,0,5,5,5,5,5,0x1b,0x1b,0x1b,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x1b,0x17,0x1b,0x1b,0x1b, +6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0x344b,0x3c4b,0x444b,0x4c4b,0x544b,0x5c4b,0x644b,0x6c4b,0x744b,0x2c4b,0x1b,6,0x1b,6, +0x1b,6,0x14,0x15,0x14,0x15,8,8,5,5,5,5,5,5,5,5, +0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,0,0,0,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,8,6,6,6,6, +6,0x17,6,6,5,5,5,5,5,6,6,6,6,6,6,6, +6,6,6,6,0,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,6,6,6,6,6,6,6,0,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b, -0x17,0x17,0x17,0x17,0x17,0x1b,0x1b,0x1b,0x1b,0x17,0x17,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,8,8,6,6,6, -6,8,6,6,6,6,6,6,8,6,6,8,8,6,6,5, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0x17,0x17,0x17,0x17, -5,5,5,5,5,5,8,8,6,6,5,5,5,5,6,6, -6,5,8,8,8,5,5,8,8,8,8,8,8,8,5,5, -5,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5, -5,5,6,8,8,6,6,8,8,8,8,8,8,6,5,8, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,8,8,8,6,0x1b,0x1b, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0x17,4,5,5,5, -1,1,1,1,1,1,0,1,0,0,0,0,0,1,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,5,5,5,5,0,0,5,5,5,5,5,5,5,0, -5,0,5,5,5,5,0,0,5,5,5,5,5,5,5,5, -5,0,5,5,5,5,0,0,5,5,5,5,5,5,5,5, +6,6,6,6,6,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x17,0x17,0x17,0x17,0x17,0x1b,0x1b,0x1b, +0x1b,0x17,0x17,0,0,0,0,0,5,5,5,5,5,5,5,5, +5,5,5,8,8,6,6,6,6,8,6,6,6,6,6,6, +8,6,6,8,8,6,6,5,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0x17,0x17,0x17,0x17,0x17,0x17,5,5,5,5,5,5,8,8, +6,6,5,5,5,5,6,6,6,5,8,8,8,5,5,8, +8,8,8,8,8,8,5,5,5,6,6,6,6,5,5,5, +5,5,5,5,5,5,5,5,5,5,6,8,8,6,6,8, +8,8,8,8,8,6,5,8,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,8,8,8,6,0x1b,0x1b,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,0x17,4,5,5,5,1,1,1,1,1,1,0,1, +0,0,0,0,0,1,0,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,5,5,5,5,0,0, +5,5,5,5,5,5,5,0,5,0,5,5,5,5,0,0, 5,5,5,5,5,5,5,5,5,0,5,5,5,5,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0,0,6,6,6, -0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b, -0x4cb,0x50b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x788b,0,0,0, +5,0,5,5,5,5,0,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,0,0,2,2,2,2,2,2,0,0, -0x13,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0x17,0x17,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,0xc,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0x14, -0x15,0,0,0,5,5,5,5,5,5,5,5,5,5,5,0x17, -0x17,0x17,0x98a,0x9ca,0xa0a,5,5,5,5,5,5,5,5,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,5,5,5,5,6,6,6,0,0,0,0,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,6,6,6,0x17,0x17,0,0,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,6,6,0,0,0,0,0,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,5,5,5,0,6,6,0,0,0,0,0,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,6,6,8,6,6,6,6,6, -6,6,8,8,8,8,8,8,8,8,6,8,8,6,6,6, -6,6,6,6,6,6,6,6,0x17,0x17,0x17,4,0x17,0x17,0x17,0x19, -5,6,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, -0,0,0,0,0x54b,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,6,5,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,0x17,0x17,0x17,0x17,0x17,0x17,0x13,0x17,0x17,0x17,0x17,6, -6,6,0x10,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, -0,0,0,0,5,5,5,4,5,5,5,5,5,5,5,5, +5,5,5,0,0,6,6,6,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, +0x17,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b, +0x16cb,0x194b,0x1bcb,0x1e4b,0x788b,0,0,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0,0,0,0,0,0,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0, +2,2,2,2,2,2,0,0,0x13,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0x17,0x17,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0xc,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0x14,0x15,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,0x17,0x17,0x17,0x98a,0x9ca,0xa0a,5,5,5, +5,5,5,5,5,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,5,5,5,5,6,6, +6,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6, +6,0x17,0x17,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,5,5,5,0,6,6, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,0,0,0,0,0,0,0,0,5,5,5,5, -5,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, -0,0,0,0,0,0,0,0,6,6,6,8,8,8,8,6, -6,8,8,8,0,0,0,0,8,8,6,8,8,8,8,8, -8,6,6,6,0,0,0,0,0x1b,0,0,0,0x17,0x17,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,5,5,5,5,5, +6,6,8,6,6,6,6,6,6,6,8,8,8,8,8,8, +8,8,6,8,8,6,6,6,6,6,6,6,6,6,6,6, +0x17,0x17,0x17,4,0x17,0x17,0x17,0x19,5,6,0,0,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0,0x54b,0x58b,0x5cb,0x60b, +0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,6,5,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0x17,0x17,0x17,0x17, +0x17,0x17,0x13,0x17,0x17,0x17,0x17,6,6,6,0x10,0,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0,5,5,5,4, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0,0,5,5,5,5,5,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x30b,0,0,0,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, +0,0,0,0,5,5,5,5,5,6,6,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,6,6,8,8,6,0,0,0x17,0x17, -0x17,0x17,0x17,0x17,0x17,0x17,0x17,4,0x17,0x17,0x17,0x17,0x17,0x17,0,0, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0, +5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0, +6,6,6,8,8,8,8,6,6,8,8,8,0,0,0,0, +8,8,6,8,8,8,8,8,8,6,6,6,0,0,0,0, +0x1b,0,0,0,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,8,6,8,6,6,6,6,6,6,6,0, -6,8,6,8,8,6,6,6,6,6,6,6,6,8,8,8, -8,8,8,6,6,6,6,6,6,6,6,6,6,0,0,6, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, -0x17,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,6,6,6,6, -6,6,6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0, -6,6,6,6,8,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -6,8,6,6,6,6,6,8,6,8,8,8,8,8,6,8, -8,5,5,5,5,5,5,5,0,0,0,0,0x49,0x89,0xc9,0x109, -0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0x17,0x17,0x17,0x17,5,8,6,6, -6,6,8,8,6,6,8,6,6,6,5,5,0x49,0x89,0xc9,0x109, -0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,5,5,5,6,6,8,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,8, -6,6,8,8,8,6,8,6,6,6,8,8,0,0,0,0, -0,0,0,0,0x17,0x17,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0,0,0,5,5,5,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,5,5,5,5,5,5,8,8,8,8,8,8,8,8, -6,6,6,6,6,6,6,6,8,8,6,6,0,0,0,0x17, -0x17,0x17,0x17,0x17,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4, -4,4,0x17,0x17,2,2,2,2,2,2,2,2,2,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0,0,0, -0,0,0,0,6,6,6,0x17,6,6,6,6,6,6,6,6, -6,6,6,6,6,8,6,6,6,6,6,6,6,5,5,5, -5,6,5,5,5,5,8,8,6,5,5,0,6,6,0,0, -0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, +5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0x30b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6, +6,8,8,6,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,4, +0x17,0x17,0x17,0x17,0x17,0x17,0,0,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,7,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,8,6,8, +6,6,6,6,6,6,6,0,6,8,6,8,8,6,6,6, +6,6,6,6,6,8,8,8,8,8,8,6,6,6,6,6, +6,6,6,6,6,0,0,6,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0,0,0,0,0,0,0x17,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,6,6,6,6,6,6,6,6,6,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,6,6,6,6,8,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,6,8,6,6,6,6,6,8, +6,8,8,8,8,8,6,8,8,5,5,5,5,5,5,5, +0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17, +0x17,0x17,0x17,0x17,5,8,6,6,6,6,8,8,6,6,8,6, +6,6,5,5,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5, +5,5,5,5,6,6,8,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,6,8,6,6,8,8,8,6,8,6, +6,6,8,8,0,0,0,0,0,0,0,0,0x17,0x17,0x17,0x17, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,5,5,5, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,5,5,5, +8,8,8,8,8,8,8,8,6,6,6,6,6,6,6,6, +8,8,6,6,0,0,0,0x17,0x17,0x17,0x17,0x17,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,4,4,4,4,4,4,0x17,0x17,2,2,2,2, +2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0,6,6,6,0x17, +6,6,6,6,6,6,6,6,6,6,6,6,6,8,6,6, +6,6,6,6,6,5,5,5,5,6,5,5,5,5,8,8, +6,5,5,8,6,6,0,0,0,0,0,0,2,2,2,2, +2,2,2,2,2,2,2,2,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2, -4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4, -4,4,4,4,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,6, -6,6,6,6,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,1,2,2,2,2,2,2,2, -2,2,1,2,2,2,2,2,2,2,2,2,1,1,1,1, -1,0x1a,0x1a,0x1a,0,0,2,2,2,0,2,2,1,1,1,1, -3,0x1a,0x1a,0,2,2,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,0,0,1,1,1,1, -1,1,0,0,2,2,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,0,0,1,1,1,1, -1,1,0,0,2,2,2,2,2,2,2,2,0,1,0,1, -0,1,0,1,2,2,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,0,0,2,2,2,2,2,2,2,2,3,3,3,3, -3,3,3,3,2,2,2,2,2,2,2,2,3,3,3,3, -3,3,3,3,2,2,2,2,2,0,2,2,1,1,1,1, -3,0x1a,2,0x1a,0x1a,0x1a,2,2,2,0,2,2,1,1,1,1, -3,0x1a,0x1a,0x1a,2,2,2,2,0,0,2,2,1,1,1,1, -0,0x1a,0x1a,0x1a,0x16,0x17,0x17,0x17,0x18,0x14,0x15,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0x17,0x17,0x17,0x17,0x18,0x17,0x16,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0x17,0xc,0x10,0x10,0x10,0x10,0x10,0,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x2cb,4,0,0,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x18,0x18, -0x18,0x14,0x15,4,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x10, -0x10,0x10,0x10,0x10,0x13,0x13,0x13,0x13,0x13,0x13,0x17,0x17,0x1c,0x1d,0x14,0x1c, -0x1c,0x1d,0x14,0x1c,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0xd,0xe,0x10,0x10, -0x10,0x10,0x10,0xc,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x1c,0x1d,0x17, -0x17,0x17,0x17,0x16,0x2cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x18,0x18, -0x18,0x14,0x15,0,4,4,4,4,4,4,4,4,4,4,4,4, -4,0,0,0,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19, +4,4,4,4,4,4,4,4,4,4,4,2,2,2,2,2, +2,2,2,2,2,2,2,2,4,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,4,4,4,4,4,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,0,6,6,6,6,6,1,2,1,2, +1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, +1,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2, +2,2,2,2,1,1,1,1,1,0x1a,0x1a,0x1a,0,0,2,2, +2,0,2,2,1,1,1,1,3,0x1a,0x1a,0,2,2,2,2, +2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,0,0,1,1,1,1,1,1,0,0,2,2,2,2, +2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,0,0,1,1,1,1,1,1,0,0,2,2,2,2, +2,2,2,2,0,1,0,1,0,1,0,1,2,2,2,2, +2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2, +2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2, +2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2, +2,0,2,2,1,1,1,1,3,0x1a,2,0x1a,0x1a,0x1a,2,2, +2,0,2,2,1,1,1,1,3,0x1a,0x1a,0x1a,2,2,2,2, +0,0,2,2,1,1,1,1,0,0x1a,0x1a,0x1a,0x16,0x17,0x17,0x17, +0x18,0x14,0x15,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x18,0x17, +0x16,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0xc,0x10,0x10,0x10,0x10, +0x10,0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x2cb,4,0,0, +0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x18,0x18,0x18,0x14,0x15,4,0xc,0xc,0xc,0xc, +0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x10,0x10,0x10,0x10,0x10,0x13,0x13,0x13,0x13, +0x13,0x13,0x17,0x17,0x1c,0x1d,0x14,0x1c,0x1c,0x1d,0x14,0x1c,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0xd,0xe,0x10,0x10,0x10,0x10,0x10,0xc,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0x17,0x1c,0x1d,0x17,0x17,0x17,0x17,0x16,0x2cb,0x30b,0x34b,0x38b, +0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x18,0x18,0x18,0x14,0x15,0,4,4,4,4, +4,4,4,4,4,4,4,4,4,0,0,0,0x19,0x19,0x19,0x19, 0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19, -0x19,0x19,0x19,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6, -6,7,7,7,7,6,7,7,7,6,6,6,6,6,6,6, -6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x1b,0x1b,0x1b,0x1b,1,0x1b,1,0x1b,1,0x1b,1,1, -1,1,0x1b,2,1,1,1,1,2,5,5,5,5,2,0x1b,0x1b, -2,2,1,1,0x18,0x18,0x18,0x18,0x18,1,2,2,2,2,0x1b,0x18, -0x1b,0x1b,2,0x1b,0x358b,0x360b,0x364b,0x348b,0x388b,0x350b,0x390b,0x3d0b,0x410b,0x354b,0x454b,0x35cb, -0x3dcb,0x45cb,0x4dcb,0x58b,0x1b,0x1b,1,0x1b,0x1b,0x1b,0x1b,1,0x1b,0x1b,2,1, -1,1,2,2,1,1,1,2,0x1b,1,0x1b,0x1b,0x18,1,1,1, -1,1,0x1b,0x1b,0x58a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x7ca,0x80a,0x84a, -0x11ca,0x1e4a,0x980a,0x784a,0x58a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x7ca,0x80a,0x84a, -0x11ca,0x1e4a,0x980a,0x784a,0x784a,0x984a,0x788a,1,2,0x6ca,0x11ca,0x988a,0x78ca,0x54b,0x1b,0x1b, -0,0,0,0,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x1b,0x1b,0x18,0x1b,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x18,0x18,0x1b,0x1b,0x18,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6, +6,6,6,6,6,6,6,6,6,7,7,7,7,6,7,7, +7,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b, +1,0x1b,1,0x1b,1,0x1b,1,1,1,1,0x1b,2,1,1,1,1, +2,5,5,5,5,2,0x1b,0x1b,2,2,1,1,0x18,0x18,0x18,0x18, +0x18,1,2,2,2,2,0x1b,0x18,0x1b,0x1b,2,0x1b,0x358b,0x360b,0x364b,0x348b, +0x388b,0x350b,0x390b,0x3d0b,0x410b,0x354b,0x454b,0x35cb,0x3dcb,0x45cb,0x4dcb,0x58b,0x1b,0x1b,1,0x1b, +0x1b,0x1b,0x1b,1,0x1b,0x1b,2,1,1,1,2,2,1,1,1,2, +0x1b,1,0x1b,0x1b,0x18,1,1,1,1,1,0x1b,0x1b,0x58a,0x5ca,0x60a,0x64a, +0x68a,0x6ca,0x70a,0x74a,0x78a,0x7ca,0x80a,0x84a,0x11ca,0x1e4a,0x980a,0x784a,0x58a,0x5ca,0x60a,0x64a, +0x68a,0x6ca,0x70a,0x74a,0x78a,0x7ca,0x80a,0x84a,0x11ca,0x1e4a,0x980a,0x784a,0x784a,0x984a,0x788a,1, +2,0x6ca,0x11ca,0x988a,0x78ca,0x54b,0x1b,0x1b,0,0,0,0,0x18,0x18,0x18,0x18, +0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x18,0x1b,0x1b,0x18,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x1b,0x1b,0x18,0x1b, +0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x14,0x15,0x14,0x15, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x14,0x15,0x14,0x15,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x14,0x15,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x14,0x15,0x1b, +0x1b,0x1b,0x1b,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18, -0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,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,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x2cb,0x80b,0x84b,0x88b,0x8cb,0x90b,0x94b,0x98b,0x9cb,0xa0b,0xa4b,0x30b,0x34b,0x38b, -0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x2cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb, -0x50b,0x7cb,0x80b,0x84b,0x88b,0x8cb,0x90b,0x94b,0x98b,0x9cb,0xa0b,0xa4b,0x30b,0x34b,0x38b,0x3cb, -0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x80b,0x84b,0x88b,0x8cb,0x90b,0x94b,0x98b,0x9cb,0xa0b,0xa4b, +0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x2cb,0x80b, +0x84b,0x88b,0x8cb,0x90b,0x94b,0x98b,0x9cb,0xa0b,0xa4b,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b, +0x4cb,0x50b,0x7cb,0x2cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x80b,0x84b, +0x88b,0x8cb,0x90b,0x94b,0x98b,0x9cb,0xa0b,0xa4b,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb, +0x50b,0x7cb,0x80b,0x84b,0x88b,0x8cb,0x90b,0x94b,0x98b,0x9cb,0xa0b,0xa4b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15, -0x14,0x15,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x30b,0x34b,0x38b,0x3cb, -0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18, -0x18,0x14,0x15,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15, -0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x14,0x15,0x14, -0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14, -0x15,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x14,0x15, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x18,0x18, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x30b,0x34b, +0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb, +0x50b,0x7cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x14,0x15,0x14,0x15, +0x14,0x15,0x14,0x15,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14, +0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x14,0x15,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x14,0x15,0x18,0x18,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x18, +0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, +0x1b,0x1b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -1,2,1,1,1,2,2,1,2,1,2,1,2,1,1,1, -1,2,1,2,2,1,2,2,2,2,2,2,4,4,1,1, -1,2,1,2,2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,1,2,1,2,6, -6,6,1,2,0,0,0,0,0,0x17,0x17,0x17,0x17,0x344b,0x17,0x17, -2,2,2,2,2,2,0,2,0,0,0,0,0,2,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0,0,0,0,0,0,0,4,0x17,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,6,5,5,5,5,5,5,5,0, -5,5,5,5,5,5,5,0,5,5,5,5,5,5,5,0, -5,5,5,5,5,5,5,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, -0,0,0,0,0,0,0,0,0x17,0x17,0x1c,0x1d,0x1c,0x1d,0x17,0x17, -0x17,0x1c,0x1d,0x17,0x1c,0x1d,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x13, -0x17,0x17,0x13,0x17,0x1c,0x1d,0x17,0x17,0x1c,0x1d,0x14,0x15,0x14,0x15,0x14,0x15, -0x14,0x15,0x17,0x17,0x17,0x17,0x17,4,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0x13,0x13,0x17,0x17,0x17,0x17,0x13,0x17,0x14,0x17,0x17,0,0,0, +2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,1, +1,2,2,1,2,1,2,1,2,1,1,1,1,2,1,2, +2,1,2,2,2,2,2,2,4,4,1,1,1,2,1,2, +2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,1,2,1,2,6,6,6,1,2, +0,0,0,0,0,0x17,0x17,0x17,0x17,0x344b,0x17,0x17,2,2,2,2, +2,2,0,2,0,0,0,0,0,2,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, +0,0,0,4,0x17,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,6,5,5,5,5,5,5,5,0,5,5,5,5, +5,5,5,0,5,5,5,5,5,5,5,0,5,5,5,5, +5,5,5,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0, +0,0,0,0,0x17,0x17,0x1c,0x1d,0x1c,0x1d,0x17,0x17,0x17,0x1c,0x1d,0x17, +0x1c,0x1d,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x13,0x17,0x17,0x13,0x17, +0x1c,0x1d,0x17,0x17,0x1c,0x1d,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x17,0x17, +0x17,0x17,0x17,4,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x13,0x13, +0x17,0x17,0x17,0x17,0x13,0x17,0x14,0x17,0x17,0x17,0x17,0x17,0x17,0x17,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,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0, 0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x1b,0x58a,0x5ca,0x60a, -0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,6,6,6,6,8,8,0x13,4,4,4, -4,4,0x1b,0x1b,0x7ca,0xa4a,0xcca,4,5,0x17,0x1b,0x1b,0xc,0x17,0x17,0x17, -0x1b,4,5,0x54a,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x1b,0x1b, -0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x13,0x14,0x15,0x15,5,5,5,5, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x1b,0x58a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a, +0x74a,0x78a,6,6,6,6,8,8,0x13,4,4,4,4,4,0x1b,0x1b, +0x7ca,0xa4a,0xcca,4,5,0x17,0x1b,0x1b,0xc,0x17,0x17,0x17,0x1b,4,5,0x54a, +0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x1b,0x1b,0x14,0x15,0x14,0x15, +0x14,0x15,0x14,0x15,0x13,0x14,0x15,0x15,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +0,6,6,0x1a,0x1a,4,4,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,0,0,6,6,0x1a,0x1a,4,4,5,5,5,5,5, +5,5,5,0x17,4,4,4,5,0,0,0,0,0,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,0x17,4,4,4,5,0,0,0,0, -0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, -0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,0,0x1b,0x1b,0x58b,0x5cb,0x60b,0x64b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,0,0,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +0x1b,0x1b,0x58b,0x5cb,0x60b,0x64b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0x58b,0x5cb,0x60b,0x64b, +0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x7cb,0xa4b,0xccb,0xf4b, +0x11cb,0x144b,0x16cb,0x194b,0x1b,0xa8b,0xacb,0xb0b,0xb4b,0xb8b,0xbcb,0xc0b,0xc4b,0xc8b,0xccb,0xd0b, +0xd4b,0xd8b,0xdcb,0xe0b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0xe4b,0xe8b,0xecb,0xf0b,0xf4b,0xf8b,0xfcb,0x100b,0x104b,0x108b,0x10cb, +0x110b,0x114b,0x118b,0x11cb,5,5,5,5,5,0x685,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0, -0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1b,0xa8b,0xacb,0xb0b,0xb4b,0xb8b,0xbcb,0xc0b, -0xc4b,0xc8b,0xccb,0xd0b,0xd4b,0xd8b,0xdcb,0xe0b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0xe4b,0xe8b,0xecb,0xf0b,0xf4b,0xf8b,0xfcb, -0x100b,0x104b,0x108b,0x10cb,0x110b,0x114b,0x118b,0x11cb,5,5,5,5,5,0x685,5,5, +5,5,5,5,5,5,5,0x5c5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0x5c5,5,5,5,5, +5,5,5,5,5,5,0x685,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,0x705,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0x685,5,5,5,5,5, +0x585,5,5,0x705,5,5,5,0x7885,5,0x605,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0x705,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,0x585,5,5,0x705,5,5,5,0x7885,5,0x605,5,5, +5,5,5,5,5,5,5,5,5,0x785,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x5c5,5,5,5,5,5,5,5, +0x685,5,0x645,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0x785,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x5c5,5,5,5, -5,5,5,5,0x685,5,0x645,5,5,5,5,5,5,5,5,5, +5,5,5,0x7985,0x7c5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,0x7985,0x7c5,5,5,5,5,5,5,5, +5,5,5,0x7845,5,5,5,5,5,5,5,5,0x605,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,0x7845,5,5,5,5,5,5,5,5, -0x605,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,0x685,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x1e45,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x7985,5,5,5, +5,5,5,5,5,0x685,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x1e45,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x7985,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0x7a85,5,5,5,5,5, +5,5,5,5,5,5,0x7a85,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,0x5c5,5,0x745,5,0x6c5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0x7c5,5,0x7845, -0xa45,0xcc5,5,5,5,5,5,5,0xf45,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0x605,0x605,0x605, -0x605,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0x645, +5,0x5c5,5,0x745,5,0x6c5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0x7c5,5,0x7845,0xa45,0xcc5,5,5, +5,5,5,5,0xf45,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0x605,0x605,0x605,0x605,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0x585,5,5,5,5,5,5,5,0x585,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,0x645,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,0x585,5,5, +5,5,5,5,5,0x585,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0x585,5,5,5,5,5,5,5,5,5, +5,5,0x585,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0x785,0xa45,5,5,5,5,5,5,5,5, -5,5,5,5,0x585,0x5c5,0x605,5,0x5c5,5,5,5,5,5,5,5, +5,5,0x785,0xa45,5,5,5,5,5,5,5,5,5,5,5,5, +0x585,0x5c5,0x605,5,0x5c5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0x7c5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0x745,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0x705,5, +5,5,5,5,5,5,0x7c5,5,5,5,5,5,5,5,5,5, +5,5,5,5,0x745,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,0x705,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0x785,5,5,5,5,5, +5,5,5,5,5,5,0x785,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0x1e45,5,5,5,5,5, -5,5,0x645,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x7885,5,5,5, +5,5,5,5,5,5,0x1e45,5,5,5,5,5,5,5,0x645,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0x5c5,5,5,5,5,0x5c5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0x5c5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,0x7845,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x7885,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0x5c5,5, +5,5,5,0x5c5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,0x5c5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,0x7845,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0x6c5,5,5,5,5,5, -0x1e45,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x6c5,5,5,5, +5,5,5,5,5,5,0x6c5,5,5,5,5,5,0x1e45,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0x545,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,4,5,5, -5,5,5,5,5,5,5,5,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,4,0x17,0x17,0x17,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x49,0x89,0xc9,0x109, -0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2, -1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,2,1,2,1,2,4,4,6,6,1,2,1,2, -1,2,1,2,1,2,1,2,1,2,5,6,7,7,7,0x17, -6,6,6,6,6,6,6,6,6,6,0x17,4,5,5,5,5, -5,5,0x58a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x54a,6,6,0x17,0x17, -0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0,0x1a,0x1a,0x1a,0x1a, -0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, -0x1a,0x1a,0x1a,4,4,4,4,4,4,4,4,4,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,5,4,4,2,5,5,5,5,5,0x1a,0x1a,1,2, -1,2,1,2,1,2,1,2,1,2,1,2,2,2,1,2, -1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, -4,2,2,2,2,2,2,2,2,1,2,1,2,1,1,2, -1,2,1,2,1,2,1,2,4,0x1a,0x1a,1,2,1,2,5, -1,2,1,2,2,2,1,2,1,2,1,2,1,2,1,2, -1,2,1,1,1,1,1,0,1,1,1,1,1,2,1,2, -0,0,0,0,0,0,0,0,5,5,6,5,5,5,6,5, -5,5,5,6,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,8,8,6,6,8, -0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x34cb,0x344b,0x3ccb,0x37cb,0x35cb,0x3fcb,0x1b,0x1b, -0x19,0x1b,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x17,0x17,0x17,0x17, -0,0,0,0,0,0,0,0,8,8,8,8,6,6,0,0, -0,0,0,0,0,0,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0,0,0,0,0,0,8,8,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8, -8,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,5,5,5,5,5,5,0x17,0x17,0x17,5, -0x17,5,0,0,5,5,5,5,5,5,6,6,6,6,6,6, -6,6,0x17,0x17,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6, -6,6,8,8,0,0,0,0,0,0,0,0,0,0,0,0x17, +5,5,5,5,5,5,5,5,0x6c5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0, -8,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,4, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0x17,0x17, +5,5,0x545,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,4,5,5,5,5,5,5, +5,5,5,5,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,4,0x17,0x17,0x17,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,5,5,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,2,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, +1,2,1,2,4,4,6,6,1,2,1,2,1,2,1,2, +1,2,1,2,1,2,5,6,7,7,7,0x17,6,6,6,6, +6,6,6,6,6,6,0x17,4,5,5,5,5,5,5,0x58a,0x5ca, +0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x54a,6,6,0x17,0x17,0x17,0x17,0x17,0x17, +0,0,0,0,0,0,0,0,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, +0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,4, +4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, +4,4,2,5,5,5,5,5,0x1a,0x1a,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,2,2,1,2,1,2,1,2, +1,2,1,2,1,2,1,2,1,2,1,2,4,2,2,2, +2,2,2,2,2,1,2,1,2,1,1,2,1,2,1,2, +1,2,1,2,4,0x1a,0x1a,1,2,1,2,5,1,2,1,2, +2,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1, +1,1,1,0,1,1,1,1,1,2,1,2,0,0,0,0, +0,0,0,0,5,5,6,5,5,5,6,5,5,5,5,6, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,8,8,6,6,8,0x1b,0x1b,0x1b,0x1b, +0,0,0,0,0x34cb,0x344b,0x3ccb,0x37cb,0x35cb,0x3fcb,0x1b,0x1b,0x19,0x1b,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x17,0x17,0x17,0x17,0,0,0,0, +0,0,0,0,8,8,8,8,6,6,0,0,0,0,0,0, +0,0,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, +0,0,0,0,8,8,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,6,8,8,6,6,6,6,8,8,6,8,8,8, -5,5,5,5,5,6,4,5,5,5,5,5,5,5,5,5, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,5,5,0, -5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,8, -8,6,6,8,8,6,6,0,0,0,0,0,0,0,0,0, -5,5,5,6,5,5,5,5,5,5,5,5,6,8,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0x17,0x17,0x17,0x17, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -4,5,5,5,5,5,5,0x1b,0x1b,0x1b,5,8,6,8,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -6,5,6,6,6,5,5,6,6,5,5,5,5,5,6,6, -5,6,5,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,5,5,4,0x17,0x17, -5,5,5,5,5,5,5,5,5,5,5,8,6,6,8,8, -0x17,0x17,5,4,4,8,6,0,0,0,0,0,0,0,0,0, -0,5,5,5,5,5,5,0,0,5,5,5,5,5,5,0, -0,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,0,5,5,5,5,5,5,5,0, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,0x1a,4,4,4,4, -2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,8,8,8,8,8,8,8,8,8,8,8,8, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,5,5,5,5,5,5,0x17,0x17,0x17,5,0x17,5,0,0, +5,5,5,5,5,5,6,6,6,6,6,6,6,6,0x17,0x17, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,6,6,6,6,6,6,6,6,6,6,6,8,8, +0,0,0,0,0,0,0,0,0,0,0,0x17,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0,0,0,8,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,4,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0x17,0x17,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6, +8,8,6,6,6,6,8,8,6,8,8,8,5,5,5,5, +5,6,4,5,5,5,5,5,5,5,5,5,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,5,5,5,5,5,0,5,5,5,5, +5,5,5,5,5,6,6,6,6,6,6,8,8,6,6,8, +8,6,6,0,0,0,0,0,0,0,0,0,5,5,5,6, +5,5,5,5,5,5,5,5,6,8,0,0,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0x17,0x17,0x17,0x17,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,5, +5,5,5,0x1b,0x1b,0x1b,5,8,6,8,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,6,5,6,6, +6,5,5,6,6,5,5,5,5,5,6,6,5,6,5,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,5,5,4,0x17,0x17,5,5,5,5, +5,5,5,5,5,5,5,8,6,6,8,8,0x17,0x17,5,4, +4,8,6,0,0,0,0,0,0,0,0,0,0,5,5,5, +5,5,5,0,0,5,5,5,5,5,5,0,0,5,5,5, +5,5,5,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,0,5,5,5,5,5,5,5,0,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -5,5,5,8,8,6,8,8,6,8,8,0x17,8,6,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, -5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,0,0,0,0,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0x12,0x12,0x12,0x12, +2,2,2,2,2,2,2,0x1a,4,4,4,4,2,2,2,2, +2,2,0,0,0,0,0,0,0,0,0,0,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,5,5,5,8, +8,6,8,8,6,8,8,0x17,8,6,0,0,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0,5,5,5,5, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, -0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x11,0x11,0x11,0x11, +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, -0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,5,5,5,5, -5,5,5,5,5,5,5,0x605,5,5,5,5,5,5,5,0x7c5, -5,5,5,5,0x5c5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,0x6c5,5,0x6c5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,0x7c5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0,0,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0x18,5,5, -5,5,5,5,5,5,5,5,5,5,5,0,5,5,5,5, -5,0,5,0,5,5,0,5,5,0,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,2,2,2,2,2,2,2,0,0,0,0,0, -0,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0, -0,5,6,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, -0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0x15,0x14,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0,0,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,0x19,0x1b,0,0, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x14,0x15,0x17,0,0,0,0,0,0, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -0x17,0x13,0x13,0x16,0x16,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14, -0x15,0x17,0x17,0x14,0x15,0x17,0x17,0x17,0x17,0x16,0x16,0x16,0x17,0x17,0x17,0, -0x17,0x17,0x17,0x17,0x13,0x14,0x15,0x14,0x15,0x14,0x15,0x17,0x17,0x17,0x18,0x13, -0x18,0x18,0x18,0,0x17,0x19,0x17,0x17,0,0,0,0,5,5,5,5, -5,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,5,5,5,5,5,5,5,5, +5,5,5,0x605,5,5,5,5,5,5,5,0x7c5,5,5,5,5, +0x5c5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,0x6c5,5,0x6c5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,0x7c5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,0,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,0x18,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,5,5,5,5,5,0,5,0, +5,5,0,5,5,0,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0, +0,0,0,2,2,2,2,2,0,0,0,0,0,5,6,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a, +0x1a,0x1a,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,0,0x10,0,0,5,5,5,5,5,5,0,0,5,5, -5,5,5,5,0,0,5,5,5,5,5,5,0,0,5,5, -5,0,0,0,0x19,0x19,0x18,0x1a,0x1b,0x19,0x19,0,0x1b,0x18,0x18,0x18, -0x18,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0x10,0x10,0x10, -0x1b,0x1b,0,0,0,0x17,0x17,0x17,0x19,0x17,0x17,0x17,0x14,0x15,0x17,0x18, -0x17,0x13,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17, -0x18,0x18,0x18,0x17,0x1a,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0x14, -0x18,0x15,0x18,0x14,0x15,0x17,0x14,0x15,0x17,0x17,5,5,5,5,5,5, -5,5,5,5,4,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,4,4,5,5,5,5,5,5,5,5, -5,5,5,5,0,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, -5,5,0,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,0,0xb00b,0xb80b,0x784b,0x804b,0x884b,0x904b,0x984b,0xa04b,0xa84b,0xb04b,0xb84b,0x788b, -0x808b,0x888b,0x908b,0x988b,0xa08b,0xa88b,0xb08b,0xb88b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x17,0x17,0x17,0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x68b, -0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x800b,0x880b, -0x900b,0x980b,0xa00b,0xa80b,0x7ca,0x7ca,0x7ca,0x7ca,0x7ca,0xcca,0x11ca,0x11ca,0x11ca,0x11ca,0x1e4a,0x880a, -0x980a,0x980a,0x980a,0x980a,0x980a,0x784a,0x984a,0x68a,0x11ca,0x344b,0x344b,0x388b,0x3ccb,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x54b,0x34cb,0x1b,0x1b,0x1b,0, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0, -0x34ca,0x344a,0x58a,0x68a,0x11ca,0x980a,0x984a,0x988a,0x68a,0x7ca,0x11ca,0x1e4a,0x980a,0x784a,0x984a,0x68a, -0x7ca,0x11ca,0x1e4a,0x980a,0x784a,0x788a,0x988a,0x7ca,0x58a,0x58a,0x58a,0x5ca,0x5ca,0x5ca,0x5ca,0x68a, -0x1b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +5,5,0x15,0x14,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,0,0,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,0x19,0x1b,0,0,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x14,0x15,0x17,0,0,0,0,0,0,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,0x17,0x13,0x13,0x16, +0x16,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x14,0x15,0x17,0x17,0x14, +0x15,0x17,0x17,0x17,0x17,0x16,0x16,0x16,0x17,0x17,0x17,0,0x17,0x17,0x17,0x17, +0x13,0x14,0x15,0x14,0x15,0x14,0x15,0x17,0x17,0x17,0x18,0x13,0x18,0x18,0x18,0, +0x17,0x19,0x17,0x17,0,0,0,0,5,5,5,5,5,0,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0x10, +0,0,5,5,5,5,5,5,0,0,5,5,5,5,5,5, +0,0,5,5,5,5,5,5,0,0,5,5,5,0,0,0, +0x19,0x19,0x18,0x1a,0x1b,0x19,0x19,0,0x1b,0x18,0x18,0x18,0x18,0x1b,0x1b,0, +0,0,0,0,0,0,0,0,0,0x10,0x10,0x10,0x1b,0x1b,0,0, +0,0x17,0x17,0x17,0x19,0x17,0x17,0x17,0x14,0x15,0x17,0x18,0x17,0x13,0x17,0x17, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0x18,0x18,0x18,0x17, +0x1a,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0x14,0x18,0x15,0x18,0x14, +0x15,0x17,0x14,0x15,0x17,0x17,5,5,5,5,5,5,5,5,5,5, +4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,4,4,5,5,5,5,5,5,5,5,5,5,5,5, +0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,0,5,5,0,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, +0xb00b,0xb80b,0x784b,0x804b,0x884b,0x904b,0x984b,0xa04b,0xa84b,0xb04b,0xb84b,0x788b,0x808b,0x888b,0x908b,0x988b, +0xa08b,0xa88b,0xb08b,0xb88b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x17,0x17,0x17,0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b, +0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x800b,0x880b,0x900b,0x980b,0xa00b,0xa80b, +0x7ca,0x7ca,0x7ca,0x7ca,0x7ca,0xcca,0x11ca,0x11ca,0x11ca,0x11ca,0x1e4a,0x880a,0x980a,0x980a,0x980a,0x980a, +0x980a,0x784a,0x984a,0x68a,0x11ca,0x344b,0x344b,0x388b,0x3ccb,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x54b,0x34cb,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x34ca,0x344a,0x58a,0x68a, +0x11ca,0x980a,0x984a,0x988a,0x68a,0x7ca,0x11ca,0x1e4a,0x980a,0x784a,0x984a,0x68a,0x7ca,0x11ca,0x1e4a,0x980a, +0x784a,0x788a,0x988a,0x7ca,0x58a,0x58a,0x58a,0x5ca,0x5ca,0x5ca,0x5ca,0x68a,0x1b,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,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,6,0x58b,0x5cb,0x60b, +0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b, +0x800b,0x880b,0x900b,0x980b,0xa00b,0xa80b,0xb00b,0xb80b,0,0,0,0,0x58b,0x68b,0x7cb,0x11cb, +0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,0x1bca,5,5, +5,5,5,5,5,5,0xb80a,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,6,6,6,6,6,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,0,0x17,5,5,5,5, +0,0,0,0,5,5,5,5,5,5,5,5,0x17,0x58a,0x5ca,0x7ca, +0xa4a,0x1e4a,0,0,0,0,0,0,0,0,0,0,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,0,0,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +0,0,0,0,2,2,2,2,2,2,2,2,5,5,5,5, +5,5,5,5,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, +0,0,0,0,0,0,0,0x17,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,5, +5,0,0,0,5,0,0,5,5,5,5,5,5,5,0,0, +5,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,0,0x17,0x58b,0x5cb,0x60b,0x7cb, +0xa4b,0x1e4b,0x784b,0x788b,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,0x1b,0x1b,0x58b,0x5cb,0x60b, +0x64b,0x68b,0x7cb,0xa4b,0,0,0,0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x64b, +0x68b,0x7cb,0xa4b,0x1e4b,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,5,5,0,0,0,0,0,0x58b, +0x68b,0x7cb,0xa4b,0x1e4b,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,0x58b,0x7cb,0xa4b,0x1e4b,0x5cb,0x60b, +0,0,0,0x17,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, +0,0,0,0x17,0xa04b,0xa84b,0xb04b,0xb84b,0x788b,0x808b,0x888b,0x908b,0x988b,0xa08b,0xa88b,0xb08b, +0xb88b,0x78cb,0x80cb,0x88cb,0x90cb,0x98cb,0xa0cb,0xa8cb,0xb0cb,0xb8cb,0x36cb,0x354b,0x34cb,0x348b,0x46cb,0x344b, +0x4ecb,0x388b,0x3ccb,0x454b,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, +0x5ecb,0x344b,5,5,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb, +0xf4b,0x11cb,0x144b,0x16cb,0,0,0x1e4b,0x800b,0x880b,0x900b,0x980b,0xa00b,0xa80b,0xb00b,0xb80b,0x784b, +0x804b,0x884b,0x904b,0x984b,0x30b,0x34b,0x38b,0x3cb,0x7cb,0xa4b,0x1e4b,0x784b,0,0,0,0, +0,0,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0,0, +0,0,0,0,5,6,6,6,0,6,6,0,0,0,0,0, +6,6,6,6,5,5,5,5,0,5,5,5,0,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -6,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b, -0x16cb,0x194b,0x1bcb,0x1e4b,0x800b,0x880b,0x900b,0x980b,0xa00b,0xa80b,0xb00b,0xb80b,0,0,0,0, -0x58b,0x68b,0x7cb,0x11cb,0,0,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,0,0,0,0,6,6,6,0,0,0,0,6, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0x1bca,5,5,5,5,5,5,5,5,0xb80a,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,0x58b,0x11cb,0x17, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,6,6,6,6,6,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,0x58b,0x7cb,0xa4b, +5,5,5,5,5,6,6,0,0,0,0,0x58b,0x68b,0x7cb,0xa4b,0x1e4b, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,0x1b,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0x17, -5,5,5,5,0,0,0,0,5,5,5,5,5,5,5,5, -0x17,0x58a,0x5ca,0x7ca,0xa4a,0x1e4a,0,0,0,0,0,0,0,0,0,0, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +5,5,0,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,0,0,0x58b,0x5cb,0x60b,0x64b,0x7cb,0xa4b,0x1e4b,0x784b,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x7cb,0xa4b,0x1e4b,0x784b,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,0,0,0,0,2,2,2,2,2,2,2,2, -5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0,0,0,0,0,0,0,0,0,0,0,0x17,0,0,0,0, +0,0,0,0,0,0x17,0x17,0x17,0x17,0,0,0,0,0,0,0, +0,0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x7cb,0xa4b,0x1e4b,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0, +0,0,0,0,0,0,0x58b,0x68b,0x7cb,0x11cb,0x1e4b,0x784b,0x30b,0x34b,0x38b,0x3cb, +0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x800b, +0x880b,0x900b,0x980b,0xa00b,0xa80b,0xb00b,0xb80b,0x344b,0x34cb,0x348b,0x388b,0,0x144b,0x16cb,0x194b,0x1bcb, +0x1e4b,0x784b,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,6,8,6,8,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6, +6,6,6,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0,0,0,0x30b,0x34b, +0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,8,8,8,6, +6,6,6,8,8,6,6,0x17,0x17,0x10,0x17,0x17,0x17,0x17,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0, +0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, +0,0,0,0,5,5,5,5,5,5,5,6,6,6,6,6, +8,6,6,6,6,6,6,6,6,0,0x49,0x89,0xc9,0x109,0x149,0x189, +0x1c9,0x209,0x249,0x289,0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,6,6,6,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,6,0x17,0x17,5,0,0,0,0,0, +0,0,0,0,8,5,5,5,5,0x17,0x17,0x17,0x17,0x17,6,6, +6,0x17,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,5,0x17, +5,0x17,0x17,0x17,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,8,8,8,6,6,6,6,6,6, +6,6,6,8,0,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b, +0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x784b,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +8,8,8,6,6,6,8,8,6,8,6,6,0x17,0x17,0x17,0x17, +0x17,0x17,6,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,0,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,5,0,5,5,5,5,0,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,5, +5,5,5,5,5,5,5,5,5,0x17,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +8,8,8,6,6,6,6,6,6,6,6,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, +5,5,8,8,0,0,6,6,6,6,6,6,6,0,0,0, +6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0, +6,6,8,8,0,5,5,5,5,5,5,5,5,0,0,5, +5,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +6,8,8,8,8,0,0,8,8,0,0,8,8,8,0,0, +5,0,0,0,0,0,0,8,0,0,0,0,0,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,5,5,0,0,0,5,0,0,5,5,5,5,5, -5,5,0,0,5,0,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0x17, -0x58b,0x5cb,0x60b,0x7cb,0xa4b,0x1e4b,0x784b,0x788b,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0x1b, -0x1b,0x58b,0x5cb,0x60b,0x64b,0x68b,0x7cb,0xa4b,0,0,0,0,0,0,0,0x58b, -0x5cb,0x60b,0x64b,0x64b,0x68b,0x7cb,0xa4b,0x1e4b,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0,5,5,0,0, -0,0,0,0x58b,0x68b,0x7cb,0xa4b,0x1e4b,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0x58b,0x7cb, -0xa4b,0x1e4b,0x5cb,0x60b,0,0,0,0x17,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,0,0,0,0,0x17,0xa04b,0xa84b,0xb04b,0xb84b,0x788b,0x808b,0x888b,0x908b, -0x988b,0xa08b,0xa88b,0xb08b,0xb88b,0x78cb,0x80cb,0x88cb,0x90cb,0x98cb,0xa0cb,0xa8cb,0xb0cb,0xb8cb,0x36cb,0x354b, -0x34cb,0x348b,0x46cb,0x344b,0x4ecb,0x388b,0x3ccb,0x454b,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0,0,0,0,0x5ecb,0x344b,5,5,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b, -0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0,0,0x1e4b,0x800b,0x880b,0x900b,0x980b,0xa00b, -0xa80b,0xb00b,0xb80b,0x784b,0x804b,0x884b,0x904b,0x984b,0x30b,0x34b,0x38b,0x3cb,0x7cb,0xa4b,0x1e4b,0x784b, -0,0,0,0,0,0,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0,0,0,0,0,0,0,5,6,6,6,0,6,6,0, -0,0,0,0,6,6,6,6,5,5,5,5,0,5,5,5, -0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0,0,0,0,6,6,6,0, -0,0,0,6,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0x58b,0x11cb,0x17,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,8,8,8,6,6,6,6,6,6,6,6, +8,8,6,6,6,8,6,5,5,5,5,0x17,0x17,0x17,0x17,0x17, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0x17,0,0x17,0,0, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0x58b,0x7cb,0xa4b,5,5,5,5,5,6,6,0,0,0,0,0x58b, -0x68b,0x7cb,0xa4b,0x1e4b,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0,0,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,0x1b,5,5,5, +8,8,8,6,6,6,6,6,6,8,6,8,8,8,8,6, +6,8,6,6,5,5,0x17,5,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,8, +8,8,6,6,6,6,0,0,8,8,8,8,6,6,8,6, +6,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,5,5,5,5,6,6,0,0, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17, +8,8,8,6,6,6,6,6,6,6,6,8,8,6,8,6, +6,0x17,0x17,0x17,5,0,0,0,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,6,8,6,8,8, +6,6,6,6,6,6,8,6,0,0,0,0,0,0,0,0, +8,8,6,6,6,6,8,6,6,6,6,6,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x7cb,0xa4b,0x17,0x17,0x17,0x1b, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0,0,0x58b,0x5cb,0x60b,0x64b,0x7cb,0xa4b,0x1e4b,0x784b, +5,5,5,5,5,5,5,5,5,5,0,0,0,6,6,6, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b, +0x16cb,0x194b,0x1bcb,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,0,0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x7cb,0xa4b,0x1e4b,0x784b, +5,5,5,6,6,6,6,6,6,8,5,6,6,6,6,0x17, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,6,0,0,0,0,0,0,0,0, +5,6,6,6,6,6,6,8,8,6,6,6,5,5,5,5, +5,6,6,6,6,6,6,8,8,6,6,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,0,0,0,0,0,0,0x17,0x17,0x17,0x17,0,0,0, -0,0,0,0,0,0,0,0,0,0x58b,0x5cb,0x60b,0x64b,0x7cb,0xa4b,0x1e4b, +0x17,0x17,0x17,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, +5,5,5,5,0,0,5,5,5,5,6,6,6,6,6,6, +6,6,6,6,6,6,6,8,6,6,0x17,0x17,0x17,0,0x17,0x17, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0, +5,0x17,0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb, +0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0,0,0, +0x17,0x17,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,8,6,6,6,6, +6,6,6,0,6,6,6,6,6,6,8,6,6,6,6,6, +6,6,6,6,0,8,6,6,6,6,6,6,6,8,6,6, +8,6,6,0,0,0,0,0,0,0,0,0,5,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,0,0,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,6, +0,0,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0,0,0,0,0,0,5,5,5,5,5,5,5,0, +5,5,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,0, +0,0,6,0,6,6,0,6,0x34ca,0x354a,0x34ca,0x34ca,0x344a,0x348a,0x388a,0xf4a, +0x11ca,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0,0x17,0x17,0x17,0x17,0x17,0,0,0, +0,0,0,0,0,0,0,0,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a, +0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x58a,0x5ca,0x60a, +0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x58a,0x5ca,0x60a,0x64a,0x68a,0x5ca,0x60a,0x60a,0x64a,0x68a, +0x6ca,0x70a,0x74a,0x78a,0x58a,0x5ca,0x60a,0x60a,0x64a,0x68a,0xc08a,0xc18a,0x58a,0x5ca,0x60a,0x60a, +0x64a,0x68a,0x60a,0x60a,0x64a,0x64a,0x64a,0x64a,0x6ca,0x70a,0x70a,0x70a,0x74a,0x74a,0x78a,0x78a, +0x78a,0x78a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x58a,0x5ca,0x60a,0x64a,0x64a,0x68a,0x68a,0x5ca,0x60a, +0x58a,0x5ca,0x348a,0x388a,0x454a,0x348a,0x388a,0x35ca,5,5,5,5,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,0,0,0,0,0,0,0,0x58b,0x68b,0x7cb,0x11cb,0x1e4b,0x784b, -0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb, -0x194b,0x1bcb,0x1e4b,0x800b,0x880b,0x900b,0x980b,0xa00b,0xa80b,0xb00b,0xb80b,0x344b,0x34cb,0x348b,0x388b,0, -0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x784b,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6, -8,6,8,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -6,6,6,6,6,6,6,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0,0, -0,0,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -8,8,8,6,6,6,6,8,8,6,6,0x17,0x17,0x10,0x17,0x17, -0x17,0x17,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,0,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0,0,0,0,0,0,5,5,5,5,5,5,5,6, -6,6,6,6,8,6,6,6,6,6,6,6,6,0,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x17,0x17,0x17,0x17,0,0,0,0, 0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,6,6,6,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,6,0x17,0x17,5,0, -0,0,0,0,0,0,0,0,8,5,5,5,5,0x17,0x17,0x17, -0x17,0x17,6,6,6,0x17,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,5,0x17,5,0x17,0x17,0x17,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,8,8,8,6,6, -6,6,6,6,6,6,6,8,0,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b, -0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0x1e4b,0x784b,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,8,8,8,6,6,6,8,8,6,8,6,6, -0x17,0x17,0x17,0x17,0x17,0x17,6,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,0,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,0,5,0,5,5, -5,5,0,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,0,5,5,5,5,5,5,5,5,5,5,0x17,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,8,8,8,6,6,6,6,6,6,6,6,0, -0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, -0,0,0,0,5,5,8,8,0,0,6,6,6,6,6,6, -6,0,0,0,6,6,6,6,6,0,0,0,0,0,0,0, -0,0,0,0,6,6,8,8,0,5,5,5,5,5,5,5, -5,0,0,5,5,0,0,5,5,5,5,5,5,5,5,5, -5,5,5,5,6,8,8,8,8,0,0,8,8,0,0,8, -8,8,0,0,5,0,0,0,0,0,0,8,0,0,0,0, -0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,8,8,8,6,6,6,6, -6,6,6,6,8,8,6,6,6,8,6,5,5,5,5,0x17, -0x17,0x17,0x17,0x17,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0x17, -0,0x17,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,8,8,8,6,6,6,6,6,6,8,6,8, -8,8,8,6,6,8,6,6,5,5,0x17,5,0,0,0,0, -0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, -0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,8,8,8,6,6,6,6,0,0,8,8,8,8, -6,6,8,6,6,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,5,5,5,5, -6,6,0,0,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,8,8,8,6,6,6,6,6,6,6,6,8, -8,6,8,6,6,0x17,0x17,0x17,5,0,0,0,0,0,0,0, -0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, -0,0,0,0,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0, +5,5,5,5,5,5,5,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,5,5,5,5,5,5,5,5,5,5,5,6, -8,6,8,8,6,6,6,6,6,6,8,6,0,0,0,0, -0,0,0,0,8,8,6,6,6,6,8,6,6,6,6,6, -0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x7cb,0xa4b, -0x17,0x17,0x17,0x1b,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, -0,6,6,6,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x7cb,0xa4b, -0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0,0,0,0,0,0,0,0,0, -0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0, -0,0,0,0,5,0x17,0x17,0x17,0x17,0x17,0,0,0,0,0,0, -0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x58b,0x5cb, -0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb, -0x1e4b,0,0,0,0x17,0x17,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,0,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,8, -6,6,6,6,6,6,6,0,6,6,6,6,6,6,8,6, -6,6,6,6,6,6,6,6,0,8,6,6,6,6,6,6, -6,8,6,6,8,6,6,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -0x34ca,0x354a,0x34ca,0x34ca,0x344a,0x348a,0x388a,0xf4a,0x11ca,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0, -0x17,0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0,0,0,0, -0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x64a, -0x68a,0x6ca,0x70a,0x74a,0x78a,0x58a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x58a,0x5ca, -0x60a,0x64a,0x68a,0x5ca,0x60a,0x60a,0x64a,0x68a,0x6ca,0x70a,0x74a,0x78a,0x58a,0x5ca,0x60a,0x60a, -0x64a,0x68a,0xc08a,0xc18a,0x58a,0x5ca,0x60a,0x60a,0x64a,0x68a,0x60a,0x60a,0x64a,0x64a,0x64a,0x64a, -0x6ca,0x70a,0x70a,0x70a,0x74a,0x74a,0x78a,0x78a,0x78a,0x78a,0x5ca,0x60a,0x64a,0x68a,0x6ca,0x58a, -0x5ca,0x60a,0x64a,0x64a,0x68a,0x68a,0x5ca,0x60a,0x58a,0x5ca,0x348a,0x388a,0x454a,0x348a,0x388a,0x35ca, -5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0x17,0x17, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0, +6,6,6,6,6,0x17,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0,0,0,0,0x17,0x17,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,0,0,6,6,6,6,6,0x17,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,0x17, -0x17,0x17,0x17,0x17,0x1b,0x1b,0x1b,0x1b,4,4,4,4,0x17,0x1b,0,0, -0,0,0,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0,0x7cb,0x1e4b,0x788b,0x790b,0x798b,0x7a0b,0x7a8b,0,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0,0,0,0,0,5,5,5,5,5,5,5,5,0,0,0, -0,0,0,0,0,0,0,0,5,8,8,8,8,8,8,8, +6,6,6,6,6,6,6,0x17,0x17,0x17,0x17,0x17,0x1b,0x1b,0x1b,0x1b, +4,4,4,4,0x17,0x1b,0,0,0,0,0,0,0,0,0,0, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0x7cb,0x1e4b,0x788b,0x790b,0x798b, +0x7a0b,0x7a8b,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0,0,0,0,0,5,5,5, +5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0, +5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,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,5,5,5,5, -5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0, -0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0, +8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,6,6,6,6,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,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,5,5,5,5, -5,5,5,5,5,5,5,0,0,0,0,0,5,5,5,5, -5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0, -5,5,5,5,5,5,5,5,5,5,0,0,0x1b,6,6,0x17, -0x10,0x10,0x10,0x10,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,0, +0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5, +5,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, +5,5,0,0,0x1b,6,6,0x17,0x10,0x10,0x10,0x10,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0, +0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,8,8,6,6,6,0x1b,0x1b, +0x1b,8,8,8,8,8,8,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,6, +6,6,6,6,6,6,6,0x1b,0x1b,6,6,6,6,6,6,6, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,8,8,6,6,6,0x1b,0x1b,0x1b,8,8,8,8,8,8,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,6,6,6,6,6,6,6,6,0x1b, -0x1b,6,6,6,6,6,6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,6, -6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1b,0x1b,6,6, -6,0x1b,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,0x58b,0x5cb,0x60b,0x64b, -0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb,0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x249,0x289,0x49,0x89, -0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, -0x249,0x289,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2, -2,0,2,2,2,2,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,6,6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0x1b,0x1b,6,6,6,0x1b,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,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,0x7cb,0xa4b,0xccb, +0xf4b,0x11cb,0x144b,0x16cb,0x194b,0x1bcb,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0x249,0x289,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289, +0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x49,0x89,0xc9,0x109,0x149,0x189, +0x1c9,0x209,0x249,0x289,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -1,0,1,1,0,0,1,0,0,1,1,0,0,1,1,1, -1,0,1,1,1,1,1,1,1,1,2,2,2,2,0,2, -0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2, 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,2,2,2,2,1,1,0,1,1,1,1,0, -0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, -1,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,1,1,0,1, -1,1,1,0,1,1,1,1,1,0,1,0,0,0,1,1, -1,1,1,1,1,0,2,2,2,2,2,2,2,2,2,2, +1,1,2,2,2,2,2,2,2,0,2,2,2,2,2,2, 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,2,2,2,2,2,2,0,0,1,1,1,1, +2,2,2,2,2,2,2,2,1,0,1,1,0,0,1,0, +0,1,1,0,0,1,1,1,1,0,1,1,1,1,1,1, +1,1,2,2,2,2,0,2,0,2,2,2,2,2,2,2, +0,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2, +1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1, +1,0,1,1,1,1,1,1,1,0,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,1,1,0,1,1,1,1,0,1,1,1,1, +1,0,1,0,0,0,1,1,1,1,1,1,1,0,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,0x18,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0x18, -2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x18, +1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2, +2,2,0,0,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,0x18,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,0x18,2,2,2,2,2,2,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,0x18, -2,2,2,2,2,2,1,2,0,0,0x49,0x89,0xc9,0x109,0x149,0x189, -0x1c9,0x209,0x249,0x289,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0,6,6,6, -6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6, +2,2,2,2,2,2,2,0x18,2,2,2,2,2,2,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0x18,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,2,2,0x18,2,2, +2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,2,2,2,0x18,2,2,2,2,2,2,1,2, +0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0x49,0x89,0xc9,0x109, +0x149,0x189,0x1c9,0x209,0,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,0x1b,0x1b,0x1b,0x1b,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +6,0x1b,0x1b,0x17,0x17,0x17,0x17,0x17,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,6,6,6,6,6,6,6,6,0, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,0x1b,0x1b,0x1b,0x1b,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,6,0x1b,0x1b,0x17,0x17,0x17,0x17,0x17, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6, -6,6,6,6,6,6,6,0,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,6,6,6,0,0,6,6,6,6,6, -6,6,0,6,6,0,6,6,6,6,6,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,5,5,5,0,0,0x58b,0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b, -6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0, -2,2,2,2,6,6,6,6,6,6,6,0,0,0,0,0, -0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209,0x249,0x289,0,0,0,0,0x17,0x17, -1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +6,0,0,6,6,6,6,6,6,6,0,6,6,0,6,6, +6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,5,5,5,5,5,0,0,0x58b, +0x5cb,0x60b,0x64b,0x68b,0x6cb,0x70b,0x74b,0x78b,6,6,6,6,6,6,6,0, +0,0,0,0,0,0,0,0,2,2,2,2,6,6,6,6, +6,6,6,0,0,0,0,0,0x49,0x89,0xc9,0x109,0x149,0x189,0x1c9,0x209, +0x249,0x289,0,0,0,0,0x17,0x17,1,1,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x18,0x18,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -5,5,5,5,0,5,5,5,5,5,5,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -0,5,5,0,5,0,0,5,0,5,5,5,5,5,5,5, -5,5,5,0,5,5,5,5,0,5,0,5,0,0,0,0, -0,0,5,0,0,0,0,5,0,5,0,5,0,5,5,5, -0,5,5,0,5,0,0,5,0,5,0,5,0,5,0,5, -0,5,5,0,5,0,0,5,5,5,5,0,5,5,5,5, -5,5,5,0,5,5,5,5,0,5,5,5,5,0,5,0, -5,5,5,5,5,5,5,5,5,5,0,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, -0,5,5,5,0,5,5,5,5,5,0,5,5,5,5,5, -5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0, +2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x18,0x18,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,5,5,5,5,0,5,5,5, +5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,0,5,5,0,5,0,0,5, +0,5,5,5,5,5,5,5,5,5,5,0,5,5,5,5, +0,5,0,5,0,0,0,0,0,0,5,0,0,0,0,5, +0,5,0,5,0,5,5,5,0,5,5,0,5,0,0,5, +0,5,0,5,0,5,0,5,0,5,5,0,5,0,0,5, +5,5,5,0,5,5,5,5,5,5,5,0,5,5,5,5, +0,5,5,5,5,0,5,0,5,5,5,5,5,5,5,5, +5,5,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,0,0,0,0,0,5,5,5,0,5,5,5, +5,5,0,5,5,5,5,5,5,5,5,5,5,5,5,5, +5,5,5,5,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x2cb,0x2cb,0x30b,0x34b, +0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x54b,0x54b,0,0,0,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x2cb,0x2cb,0x30b,0x34b,0x38b,0x3cb,0x40b,0x44b,0x48b,0x4cb,0x50b,0x54b, -0x54b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0x1b,0x1b, +0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0,0,0, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0,0,0,0,0,0,0,0x1b,0x1b,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0, +0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,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, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1a,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0, -0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1a,0x1a,0x1a,0x1a,0x1a, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0, -0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0, 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0,0,0,0,0,0,0,0,0x1b,0,0,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, -0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0,5,0x705,5,5,5,5,5,5, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0,0,0,0,0,0,0,0,0x1b,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,5,0x705,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,0x645,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, @@ -1302,6 +1321,10 @@ static const uint16_t propsTrie_index[20780]={ 5,5,5,5,5,5,5,0x605,5,5,5,5,5,5,5,5, 5,5,5,5,5,0x645,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0, +0,0,0,0,0,0,0,0,5,5,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5, +5,5,5,5,5,5,5,5,5,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,5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,0x785,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, @@ -1317,2228 +1340,2283 @@ static const uint16_t propsTrie_index[20780]={ static const UTrie2 propsTrie={ propsTrie_index, - propsTrie_index+4408, + propsTrie_index+4464, NULL, - 4408, - 16372, + 4464, + 16684, 0xa40, - 0x11b8, + 0x11f0, 0x0, 0x0, 0x110000, - 0x5128, + 0x5298, NULL, 0, FALSE, FALSE, 0, NULL }; -static const uint16_t propsVectorsTrie_index[28540]={ -0x4bb,0x4c3,0x4cb,0x4d3,0x4eb,0x4f3,0x4fb,0x503,0x50b,0x513,0x51b,0x523,0x52b,0x533,0x53b,0x543, -0x54a,0x552,0x55a,0x562,0x565,0x56d,0x575,0x57d,0x585,0x58d,0x595,0x59d,0x5a5,0x5ad,0x5b5,0x5bd, -0x5c5,0x5cd,0x5d4,0x5dc,0x5e4,0x5ec,0x5f4,0x5fc,0x604,0x60c,0x611,0x619,0x620,0x628,0x630,0x638, -0x640,0x648,0x650,0x658,0x65f,0x667,0x66f,0x677,0x67f,0x687,0x68f,0x697,0x69f,0x6a7,0x6af,0x6b7, -0x18ce,0xd31,0xe19,0x4db,0x4db,0xe89,0xe91,0x1a56,0x11bd,0x11d5,0x11c5,0x11cd,0x75c,0x762,0x76a,0x772, -0x77a,0x780,0x788,0x790,0x798,0x79e,0x7a6,0x7ae,0x7b6,0x7bc,0x7c4,0x7cc,0x7d4,0x7dc,0x7e4,0x7eb, -0x7f3,0x7f9,0x801,0x809,0x811,0x817,0x81f,0x827,0x82f,0x835,0x83d,0x845,0x84d,0x854,0x85c,0x864, -0x86c,0x870,0x878,0x87f,0x887,0x88f,0x897,0x89f,0x14dd,0x14e5,0x8a7,0x8af,0x8b7,0x8bf,0x8c7,0x8ce, -0x1543,0x1533,0x153b,0x1811,0x1819,0x11e5,0x8d6,0x11dd,0x1427,0x1427,0x1429,0x11f9,0x11fa,0x11ed,0x11ef,0x11f1, -0x154b,0x154d,0x8de,0x154d,0x8e6,0x8eb,0x8f3,0x1552,0x8f9,0x154d,0x8ff,0x907,0xc09,0x155a,0x155a,0x90f, -0x156a,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b,0x156b, -0x156b,0x156b,0x156b,0x1562,0x917,0x1573,0x1573,0x91f,0xb16,0xb1e,0xb26,0xb2e,0x1583,0x157b,0x927,0x92f, -0x937,0x158d,0x1595,0x93f,0x158b,0x947,0x18d6,0xd39,0xb36,0xb3e,0xb46,0xb4b,0x1787,0xc3c,0xc43,0x16ef, -0xbd9,0x18de,0xd41,0xd49,0xd51,0xd59,0xf41,0xf41,0x17d7,0x17dc,0xc75,0xc7d,0x184d,0x1855,0x197f,0xe21, -0x185d,0xcc5,0xccd,0x1865,0x6bf,0x4db,0xf21,0xd61,0x170f,0x16f7,0x1707,0x16ff,0x179f,0x1797,0x175f,0xbe9, -0x1202,0x1202,0x1202,0x1202,0x1205,0x1202,0x1202,0x120d,0x94f,0x1215,0x953,0x95b,0x1215,0x963,0x96b,0x973, -0x1225,0x121d,0x122d,0x97b,0x983,0x98b,0x993,0x99b,0x1235,0x123d,0x1245,0x124d,0x9a3,0x1255,0x125c,0x1264, -0x126c,0x1274,0x127c,0x1284,0x128c,0x1293,0x129b,0x12a3,0x12ab,0x12b3,0x12b6,0x12b8,0x159d,0x1682,0x1688,0x9ab, -0x12c0,0x9b3,0x9bb,0x13da,0x13df,0x13e2,0x13ea,0x12c8,0x13f2,0x13f2,0x12d8,0x12d0,0x12e0,0x12e8,0x12f0,0x12f8, -0x1300,0x1308,0x1310,0x1318,0x1690,0x16e7,0x1821,0x195f,0x1328,0x132f,0x1337,0x133f,0x1320,0x1347,0x1698,0x169f, -0x15a5,0x15a5,0x15a5,0x15a5,0x15a5,0x15a5,0x15a5,0x15a5,0x16a7,0x16aa,0x16a7,0x16a7,0x16b2,0x16b9,0x16bb,0x16c2, -0x16ca,0x16ce,0x16ce,0x16d1,0x16ce,0x16ce,0x16d7,0x16ce,0x1717,0x17cf,0x1829,0xb53,0xb59,0xb5f,0xb67,0xb6c, -0x1777,0xc19,0xc1d,0x17e4,0x1767,0x1767,0x1767,0xbf1,0x176f,0xc11,0x17b7,0xc65,0xbf9,0xc01,0xc01,0x186d, -0x17a7,0x1831,0xc53,0xc55,0x9c3,0x15ad,0x15ad,0x9cb,0x15b5,0x15b5,0x15b5,0x15b5,0x15b5,0x15b5,0x9d3,0x6c3, -0x140f,0x1431,0x9db,0x1439,0x9e3,0x1441,0x1449,0x1451,0x9eb,0x9f0,0x1459,0x1460,0x9f5,0x9fd,0x17c7,0xbe1, -0xa05,0x14b7,0x14be,0x1468,0x14c6,0x14cd,0x1470,0xa0d,0x1489,0x1489,0x148b,0x1478,0x1480,0x1480,0x1481,0x14d5, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, -0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x1174,0x171f,0x171f, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493, -0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x1493,0x149a,0x117c,0x1182, -0x15c5,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb, -0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb, -0x15cb,0x15cb,0x15cb,0x15cb,0xa15,0x15d3,0xa1d,0x18e6,0x1879,0x1879,0x1879,0x1879,0x1879,0x1879,0x1879,0x1879, -0x1875,0xcd5,0x1889,0x1881,0x188b,0x18ee,0x18ee,0xd69,0x177f,0x17ec,0x1841,0x1845,0x1839,0xc85,0xc8b,0xc8e, -0x17af,0xc5d,0x17f4,0xc96,0x1893,0x1896,0xcdd,0xd71,0x18a6,0x189e,0xce5,0xd79,0x18f6,0x18fa,0xd81,0xfe7, -0x18ae,0xced,0xcf5,0x1902,0x1912,0x190a,0xd89,0xee4,0xe29,0xe31,0x1ac9,0xf9f,0x1b6e,0x1b6e,0x191a,0xd91, -0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526, -0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528, -0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a, -0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525, -0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527, -0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529, -0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b, -0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526, -0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528, -0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a, -0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525, -0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527, -0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529, -0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b, -0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526, -0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528, -0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a, -0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525, -0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527, -0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529, -0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b, -0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0x152b,0x1525,0x1526,0x1527,0x1528,0x1529,0x152a,0xa25,0xd99,0xd9c, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd, -0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa, -0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x13fa,0x14a2,0x14a2,0x14a2,0x14a2,0x14a2,0x14a2,0x14a2,0x14a2, -0x14a7,0x14af,0x16df,0x118a,0x17bf,0x17bf,0x118e,0x1195,0xa2d,0xa35,0xa3d,0x1367,0x136e,0x1376,0xa45,0x137e, -0x13af,0x13af,0x1357,0x135f,0x1386,0x13a6,0x13a7,0x13b7,0x138e,0x134f,0xa4d,0x1396,0xa55,0x139e,0xa5d,0xa61, -0xc6d,0x13bf,0xa69,0xa71,0x13c7,0x13cd,0x13d2,0xa79,0xa89,0x1417,0x141f,0x1402,0x1407,0xa91,0xa99,0xa81, -0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed, -0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14ed,0x14f5,0x14f5,0x14f5,0x14f5, -0x136c,0x136c,0x13ac,0x13ec,0x142c,0x146c,0x14ac,0x14ec,0x1528,0x1568,0x1594,0x15d4,0x1614,0x1654,0x1694,0x16d4, -0x1714,0x1750,0x1790,0x17d0,0x1810,0x1844,0x1880,0x18c0,0x1900,0x1940,0x197c,0x19bc,0x19fc,0x1a3c,0x1a7c,0x1abc, -0xa80,0xac0,0xb00,0xe4d,0xb40,0xa40,0xb80,0xa40,0xe73,0xa40,0xa40,0xa40,0xa40,0xbc0,0x12a9,0x12a9, -0xeb3,0xef3,0xa40,0xa40,0xa40,0xa40,0xdd2,0xc00,0xa40,0xa40,0xc40,0xc80,0xcc0,0xe12,0xd92,0xd02, -0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9,0x11e9, -0x11e9,0x11e9,0x11e9,0x11e9,0xf33,0x1229,0x1069,0x10a9,0x1269,0xf73,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfe9, -0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9, -0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0xfa9,0x1029, +static const uint16_t propsVectorsTrie_index[29236]={ +0x4c4,0x4cc,0x4d4,0x4dc,0x4f4,0x4fc,0x504,0x50c,0x514,0x51c,0x524,0x52c,0x534,0x53c,0x544,0x54c, +0x553,0x55b,0x563,0x56b,0x56e,0x576,0x57e,0x586,0x58e,0x596,0x59e,0x5a6,0x5ae,0x5b6,0x5be,0x5c6, +0x5ce,0x5d6,0x5dd,0x5e5,0x5ed,0x5f5,0x5fd,0x605,0x60d,0x615,0x61a,0x622,0x629,0x631,0x639,0x641, +0x649,0x651,0x659,0x661,0x668,0x670,0x678,0x680,0x688,0x690,0x698,0x6a0,0x6a8,0x6b0,0x6b8,0x6c0, +0x193e,0xd41,0xe2e,0x6c8,0x4e4,0xe95,0xe9d,0x1ad4,0x120d,0x1225,0x1215,0x121d,0x781,0x787,0x78f,0x797, +0x79f,0x7a5,0x7ad,0x7b5,0x7bd,0x7c3,0x7cb,0x7d3,0x7db,0x7e1,0x7e9,0x7f1,0x7f9,0x801,0x809,0x810, +0x818,0x81e,0x826,0x82e,0x836,0x83c,0x844,0x84c,0x854,0x122d,0x85c,0x864,0x86c,0x873,0x87b,0x883, +0x88b,0x88f,0x897,0x89e,0x8a6,0x8ae,0x8b6,0x8be,0x153d,0x1545,0x8c6,0x8ce,0x8d6,0x8de,0x8e6,0x8ed, +0x15a3,0x1593,0x159b,0x1879,0x1881,0x123d,0x8f5,0x1235,0x147f,0x147f,0x1481,0x1251,0x1252,0x1245,0x1247,0x1249, +0x15ab,0x15ad,0x8fd,0x15ad,0x905,0x90a,0x912,0x15b2,0x918,0x15ad,0x91e,0x926,0xc18,0x15ba,0x15ba,0x92e, +0x15ca,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb,0x15cb, +0x15cb,0x15cb,0x15cb,0x15c2,0x936,0x15d3,0x15d3,0x93e,0xb25,0xb2d,0xb35,0xb3d,0x15e3,0x15db,0x946,0x94e, +0x956,0x15ed,0x15f5,0x95e,0x15eb,0x966,0x1946,0xd49,0xb45,0xb4d,0xb55,0xb5a,0x17e7,0xc4b,0xc52,0x174f, +0xbe8,0x194e,0xd51,0xd59,0xd61,0xd69,0xf4d,0xf4d,0x183f,0x1844,0xc85,0xc8d,0x18b5,0x18bd,0x19ef,0xe36, +0x18c5,0xcd5,0xcdd,0x18cd,0x6d0,0x4e4,0xf2d,0xd71,0x176f,0x1757,0x1767,0x175f,0x17ff,0x17f7,0x17bf,0xbf8, +0x125a,0x125a,0x125a,0x125a,0x125d,0x125a,0x125a,0x1265,0x96e,0x126d,0x972,0x97a,0x126d,0x982,0x98a,0x992, +0x127d,0x1275,0x1285,0x99a,0x9a2,0x128d,0x9aa,0x9b2,0x1295,0x129d,0x12a5,0x12ad,0x9ba,0x12b5,0x12bc,0x12c4, +0x12cc,0x12d4,0x12dc,0x12e4,0x12ec,0x12f3,0x12fb,0x1303,0x130b,0x1313,0x1316,0x1318,0x15fd,0x16e2,0x16e8,0x182f, +0x1320,0x9c2,0x9ca,0x143a,0x143f,0x1442,0x144a,0x1328,0x1452,0x1452,0x1338,0x1330,0x1340,0x1348,0x1350,0x1358, +0x1360,0x1368,0x1370,0x1378,0x16f0,0x1747,0x1889,0x19cf,0x1388,0x138f,0x1397,0x139f,0x1380,0x13a7,0x16f8,0x16ff, +0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1707,0x170a,0x1707,0x1707,0x1712,0x1719,0x171b,0x1722, +0x172a,0x172e,0x172e,0x1731,0x172e,0x172e,0x1737,0x172e,0x1777,0x1837,0x1891,0xb62,0xb68,0xb6e,0xb76,0xb7b, +0x17d7,0xc28,0xc2c,0x184c,0x17c7,0x17c7,0x17c7,0xc00,0x17cf,0xc20,0x1817,0xc75,0xc08,0xc10,0xc10,0x18d5, +0x1807,0x1899,0xc62,0xc65,0x9d2,0x160d,0x160d,0x9da,0x1615,0x1615,0x1615,0x1615,0x1615,0x1615,0x9e2,0x6d4, +0x1489,0x1491,0x9ea,0x1499,0x9f2,0x14a1,0x14a9,0x14b1,0x9fa,0x9ff,0x14b9,0x14c0,0xa04,0xa0c,0x1827,0xbf0, +0xa14,0x1517,0x151e,0x14c8,0x1526,0x152d,0x14d0,0xa1c,0x14e9,0x14e9,0x14eb,0x14d8,0x14e0,0x14e0,0x14e1,0x1535, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x11c2,0x177f,0x177f, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3, +0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14f3,0x14fa,0x1936,0x11ca, +0x1625,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b, +0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b,0x162b, +0x162b,0x162b,0x162b,0x162b,0xa24,0x1633,0xa2c,0x1956,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1, +0x18dd,0xce5,0x18f1,0x18e9,0x18f3,0x195e,0x195e,0xd79,0x17df,0x1854,0x18a9,0x18ad,0x18a1,0xc95,0xc9b,0xc9e, +0x180f,0xc6d,0x185c,0xca6,0x18fb,0x18fe,0xced,0xd81,0x190e,0x1906,0xcf5,0xd89,0x1966,0x196a,0xd91,0xff3, +0x1916,0xcfd,0xd05,0x1972,0x1982,0x197a,0xd99,0xef0,0xe3e,0xe46,0x1b47,0xfab,0x1bec,0x1bec,0x198a,0xda1, +0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586, +0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588, +0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a, +0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585, +0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587, +0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589, +0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b, +0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586, +0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588, +0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a, +0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585, +0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587, +0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589, +0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b, +0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586, +0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588, +0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a, +0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585, +0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587, +0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589, +0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b, +0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0x158b,0x1585,0x1586,0x1587,0x1588,0x1589,0x158a,0xa34,0xda9,0xdac, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d, +0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d,0x155d, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a, +0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x145a,0x1502,0x1502,0x1502,0x1502,0x1502,0x1502,0x1502,0x1502, +0x1507,0x150f,0x173f,0x11d2,0x181f,0x181f,0x11d6,0x11dd,0xa3c,0xa44,0xa4c,0x13c7,0x13ce,0x13d6,0xa54,0x13de, +0x140f,0x140f,0x13b7,0x13bf,0x13e6,0x1406,0x1407,0x1417,0x13ee,0x13af,0xa5c,0x13f6,0xa64,0x13fe,0xa6c,0xa70, +0xc7d,0x141f,0xa78,0xa80,0x1427,0x142d,0x1432,0xa88,0xa98,0x146f,0x1477,0x1462,0x1467,0xaa0,0xaa8,0xa90, +0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d, +0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x154d,0x1555,0x1555,0x1555,0x1555, +0x1390,0x1390,0x13d0,0x1410,0x1450,0x1490,0x14d0,0x1510,0x154c,0x158c,0x15b8,0x15f8,0x1638,0x1678,0x16b8,0x16f8, +0x1738,0x1774,0x17b4,0x17f4,0x1834,0x1868,0x18a4,0x18e4,0x1924,0x1964,0x19a0,0x19e0,0x1a20,0x1a60,0x1aa0,0x1ae0, +0xa80,0xac0,0xb00,0xb3b,0xb7b,0xa40,0xbbb,0xa40,0xe65,0xa40,0xa40,0xa40,0xa40,0xbfb,0x1290,0x1290, +0xea5,0xee5,0xa40,0xa40,0xa40,0xa40,0xc3b,0xc5b,0xa40,0xa40,0xc9b,0xcdb,0xd1b,0xe2d,0xded,0xd5d, +0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0,0x11d0, +0x11d0,0x11d0,0x11d0,0x11d0,0xf25,0x1210,0x1045,0x1085,0x1250,0x1090,0x12d0,0x12d0,0x12d0,0xf65,0xf85,0xfc5, +0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85, +0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0xf85,0x1005, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, 0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, -0xd42,0xd52,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, -0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xcc2, -0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169, -0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x1169,0x10e9, -0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9, -0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x11a9,0x1129, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0xb74,0xb7b,0xb83,0xb8b,0x1727,0x1727,0x1727,0xb93,0xb9b,0xb9e,0x1757,0x174f,0xbd1,0xcfd,0xd01,0xd05, -0x4db,0x4db,0x4db,0x4db,0xd0d,0x18b6,0xd15,0xf39,0x15db,0xaa1,0xaa7,0xff7,0xba6,0x178f,0xc4b,0x4db, -0x15f0,0x15e3,0x15e8,0x172f,0xbae,0xbb6,0x1142,0x1148,0x1ab1,0xf56,0x1aa1,0x6cb,0x4db,0x4db,0x4db,0x4db, -0x1ad1,0x1ad1,0x1ad1,0x1ad1,0x1ad1,0x1ad1,0x1ad1,0x1ad1,0x1ad1,0xfa7,0xfaf,0xfb7,0x4db,0x4db,0x4db,0x4db, -0xbbe,0xbc1,0xda4,0x1b19,0xfef,0x6d3,0x4db,0x1088,0xc9e,0xd1d,0x4db,0x4db,0x1a66,0xeec,0xef4,0x1b59, -0xc25,0xc2c,0xc34,0x1922,0x1af9,0x4db,0x1ad9,0xfc7,0x192a,0xdac,0xdb4,0xdbc,0x1017,0x6db,0x4db,0x4db, -0x1932,0x1932,0x6e3,0x4db,0x1b86,0x10a0,0x1b7e,0x10a8,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0xdc4,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x1987,0x1989,0xe39,0xe40,0x1942,0x193a,0xdcc,0xf19,0x1a5e,0xed4,0xedc,0xfbf,0x1a76,0x1a7a,0xf11,0x1037, -0xf8a,0xf8f,0x6eb,0x4db,0x1090,0x1098,0x1ac1,0xf97,0xf6c,0xf72,0xf7a,0xf82,0x4db,0x4db,0x4db,0x4db, -0x1bc6,0x1bbe,0x1132,0x113a,0x1b41,0x1b39,0x105e,0x4db,0x4db,0x4db,0x4db,0x4db,0x1b29,0x101f,0x1027,0x102f, -0x1af1,0x1ae9,0xfd7,0x112a,0x1a82,0xf29,0x6f3,0x4db,0x106e,0x1076,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc, -0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x17fc,0x1801,0xca6,0xcad,0xcad,0xcad, -0x1809,0x1809,0x1809,0xcb5,0x1b76,0x1b76,0x1b76,0x1b76,0x1b76,0x1b76,0x6fb,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a, -0x194a,0x194a,0x194c,0x194a,0x1954,0x194a,0x194a,0x194a,0x194a,0x194a,0x194a,0x1957,0x194a,0x194a,0x194a,0x194a, -0x194a,0x703,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991,0x1991, -0x1991,0xe48,0xfdf,0x70b,0x4db,0x4db,0x70f,0xf31,0x1b11,0x1b09,0xfff,0x1007,0x717,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x1a6e,0x1a6e,0xefc,0xf01,0xf09,0x4db,0x4db,0x1114, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x1aa9,0x1aa9,0x1aa9,0xf49,0xf4e,0x71f,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x15f8,0x15f8,0x15f8,0x15f8,0x15f8,0x15f8,0x15f8,0xaaf,0x1608,0xab7,0x1609,0x1600,0x1611,0x1617,0x161f,0xabf, -0x1747,0x1747,0x727,0x4db,0x4db,0x4db,0x4db,0x4db,0x1737,0x1737,0xbc9,0xcbd,0x4db,0x4db,0x4db,0x4db, -0x1650,0x1657,0xac7,0x165a,0xacf,0xad7,0xadf,0x1654,0xae7,0xaef,0xaf7,0x1659,0x1661,0x1650,0x1657,0x1653, -0x165a,0x1662,0x1651,0x1658,0x1654,0xafe,0x1627,0x162f,0x1636,0x163d,0x162a,0x1632,0x1639,0x1640,0xb06,0x1648, -0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e,0x1b9e, -0x1b8e,0x1b91,0x1b8e,0x1b98,0x10e0,0x72f,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x110c,0x737,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x73b,0x103f,0x1b31,0x1045,0x1b31,0x104d,0x1052,0x1056,0x1056,0x10b0,0x10b8,0x10c0,0x10c8,0x10d0,0x10c8, -0x10d8,0x10c8,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743, -0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743, -0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743,0x743, -0x743,0x744,0xb0e,0x166a,0x166a,0x166a,0x74c,0x74c,0x74c,0x74c,0x173f,0x173f,0x173f,0x173f,0x173f,0x173f, -0x173f,0x754,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c, -0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c, -0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c, -0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c,0x74c, -0x74c,0x74c,0x18be,0xd25,0x18c6,0x18c6,0xd29,0xe59,0xe61,0xe69,0xdd4,0xdda,0x196f,0xde2,0x1967,0xdea, -0xdee,0xdf5,0xdfd,0xe04,0xe0c,0xe11,0xe11,0xe11,0xe11,0xe11,0x19c0,0x19c8,0x19c0,0x19ce,0x19d6,0x19a1, -0x19de,0x19e6,0x19c0,0x19ee,0x19f6,0x19fd,0x1a05,0x19a9,0x19c0,0x1a08,0x19b1,0x19b8,0x1a10,0x1a16,0x1a92,0x1a99, -0x1a8a,0x1a1e,0x1a26,0x1a2e,0x1a36,0x1b01,0x1a3e,0x1a46,0xe71,0xe79,0x1999,0x1999,0x1999,0xe81,0x1ab9,0x1ab9, -0xf5e,0xf64,0xe50,0xe51,0xe51,0xe51,0xe51,0xe51,0xe51,0xe51,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x1ae1,0x1ae1,0x1ae1,0x1ae1,0x1ae1,0x1ae1,0xfcf,0x4db,0x1bb6,0x1bae,0x10e8,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0xe99,0xea1,0xea9,0xeb1,0xeb9,0xec1,0xec8,0xecc,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x1b51,0x1b49,0x1066,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x1b21,0x100f,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x10f0,0x10f5,0x10fd, -0x1104,0x111c,0x1122,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61,0x1b61, -0x1b61,0x1b66,0x1b61,0x1b61,0x1b61,0x107e,0x1080,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1150,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6, -0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1bd6,0x1158,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db,0x4db, -0x4db,0x4db,0x4db,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x119d,0x1160,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1168,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x167a,0x167a,0x167a,0x167a,0x167a,0x167a,0x167a, -0x167a,0x167a,0x167a,0x167a,0x167a,0x167a,0x167a,0x167a,0x167a,0x11a5,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x116c,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160, -0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x1160,0x116c,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x11ad,0x1a4e,0x1a4e,0x1a4e,0x1a4e,0x1a4e,0x1a4e,0x11b5,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1505,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x150d,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515, -0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x1515,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d, -0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x151d,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672, -0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1672,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977, -0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1977,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6, -0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1ba6,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce, -0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x1bce,0x4ba,0x4ba,0x4ba,0x273,0x273,0x273,0x273, -0x273,0x273,0x273,0x273,0x273,0x276,0x27f,0x279,0x279,0x27c,0x273,0x273,0x273,0x273,0x273,0x273, -0x273,0x273,0x273,0x273,0x273,0x273,0x273,0x273,0x273,0x273,0x273,0x273,0x7a1,0x79b,0x780,0x777, -0x76e,0x76b,0x762,0x77d,0x768,0x774,0x777,0x792,0x789,0x77a,0x79e,0x771,0x75f,0x75f,0x75f,0x75f, -0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x786,0x783,0x78c,0x78c,0x78c,0x79b,0x762,0x7ad,0x7ad,0x7ad, -0x7ad,0x7ad,0x7ad,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7, -0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x7a7,0x768,0x76e,0x774,0x798,0x75c,0x795,0x7aa,0x7aa,0x7aa, -0x7aa,0x7aa,0x7aa,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4, -0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x7a4,0x768,0x78f,0x765,0x78c,0x273,0,0,0,0, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, +0xd9d,0xdad,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40, +0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xa40,0xd1d, +0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150, +0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x1150,0x10d0, +0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190, +0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1190,0x1110, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0xb83,0xb8a,0xb92,0xb9a,0x1787,0x1787,0x1787,0xba2,0xbaa,0xbad,0x17b7,0x17af,0xbe0,0xd0d,0xd11,0xd15, +0x4e4,0x4e4,0x4e4,0x4e4,0xd1d,0x191e,0xd25,0xf45,0x163b,0xab0,0xab6,0x1003,0xbb5,0x17ef,0xc5a,0x4e4, +0x1650,0x1643,0x1648,0x178f,0xbbd,0xbc5,0x115c,0x1162,0x1b2f,0xf62,0x1b1f,0x6dc,0x4e4,0x4e4,0x4e4,0x4e4, +0x1b4f,0x1b4f,0x1b4f,0x1b4f,0x1b4f,0x1b4f,0x1b4f,0x1b4f,0x1b4f,0xfb3,0xfbb,0xfc3,0x4e4,0x4e4,0x4e4,0x4e4, +0xbcd,0xbd0,0xdb4,0x1b97,0xffb,0x6e4,0x4e4,0x1094,0xcae,0xd2d,0x4e4,0x4e4,0x1ae4,0xef8,0xf00,0x1bd7, +0xc34,0xc3b,0xc43,0x1992,0x1b77,0x4e4,0x1b57,0xfd3,0x199a,0xdbc,0xdc4,0xdcc,0x1023,0x6ec,0x4e4,0x4e4, +0x19a2,0x19a2,0x6f4,0x4e4,0x1c04,0x10ac,0x1bfc,0x10b4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0xdd4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x19f7,0x19f9,0xe4e,0xe55,0x19aa,0x19b2,0xddc,0xf25,0x1adc,0xee0,0xee8,0xfcb,0x1af4,0x1af8,0xf1d,0x1043, +0xf96,0xf9b,0x6fc,0x4e4,0x109c,0x10a4,0x1b3f,0xfa3,0xf78,0xf7e,0xf86,0xf8e,0x4e4,0x4e4,0x4e4,0x4e4, +0x1c44,0x1c3c,0x114c,0x1154,0x1bbf,0x1bb7,0x106a,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1ba7,0x102b,0x1033,0x103b, +0x1b6f,0x1b67,0xfe3,0x1144,0x1b00,0xf35,0x704,0x4e4,0x107a,0x1082,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x1bcf,0x1bc7,0x1072,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1c6c,0x1c64,0x11a6,0x1c5c,0x119e, +0x70c,0x1b9f,0x101b,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x110a,0x110f,0x1117,0x111e,0x1136, +0x113c,0x4e4,0x4e4,0x1182,0x1186,0x118e,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1864,0x1864,0x1864,0x1864,0x1864, +0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1864, +0x1864,0x1864,0x1864,0x1864,0x1864,0x1864,0x1869,0xcb6,0xcbd,0xcbd,0xcbd,0x1871,0x1871,0x1871,0xcc5,0x1bf4, +0x1bf4,0x1bf4,0x1bf4,0x1bf4,0x1bf4,0x714,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba, +0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19bc,0x19ba,0x19c4, +0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x19c7,0x19ba,0x19ba,0x19ba,0x19ba,0x19ba,0x71c,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01, +0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0x1a01,0xe5d,0xfeb,0x724,0x4e4, +0x4e4,0x728,0xf3d,0x1b8f,0x1b87,0x100b,0x1013,0x730,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x1aec,0x1aec,0xf08,0xf0d,0xf15,0x4e4,0x4e4,0x112e,0x1a11,0x1c74,0x1c74,0x1c74,0x1c74, +0x1c74,0x1c74,0x1c74,0x117a,0x738,0x4e4,0x73c,0x1c84,0x1c84,0x1c84,0x1c84,0x1c84,0x1c84,0x1c84,0x1c84,0x1c84, +0x1c84,0x1c84,0x1196,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1b27,0x1b27,0x1b27,0xf55,0xf5a, +0x744,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1658,0x1658,0x1658,0x1658,0x1658, +0x1658,0x1658,0xabe,0x1668,0xac6,0x1669,0x1660,0x1671,0x1677,0x167f,0xace,0x17a7,0x17a7,0x74c,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x1797,0x1797,0xbd8,0xccd,0x4e4,0x4e4,0x4e4,0x4e4,0x16b0,0x16b7,0xad6,0x16ba,0xade, +0xae6,0xaee,0x16b4,0xaf6,0xafe,0xb06,0x16b9,0x16c1,0x16b0,0x16b7,0x16b3,0x16ba,0x16c2,0x16b1,0x16b8,0x16b4, +0xb0d,0x1687,0x168f,0x1696,0x169d,0x168a,0x1692,0x1699,0x16a0,0xb15,0x16a8,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c, +0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c1c,0x1c0c,0x1c0f,0x1c0c,0x1c16,0x10fa, +0x754,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1126,0x75c,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x760,0x104b,0x1baf,0x1051, +0x1baf,0x1059,0x105e,0x1062,0x1062,0x10bc,0x10c4,0x10cc,0x10d4,0x10dc,0x10e2,0x10ea,0x10f2,0x768,0x768,0x768, +0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768, +0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768, +0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x768,0x769,0xb1d,0x16ca,0x16ca, +0x16ca,0x771,0x771,0x771,0x771,0x179f,0x179f,0x179f,0x179f,0x179f,0x179f,0x179f,0x779,0x771,0x771,0x771, +0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771, +0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771, +0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771, +0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x771,0x1926,0xd35,0x192e, +0x192e,0xd39,0xe65,0xe6d,0xe75,0xde4,0xdea,0x19df,0xdf2,0x19d7,0xdfa,0xdfe,0xe05,0xe0d,0xe14,0xe1c, +0xe24,0xe26,0xe26,0xe26,0xe26,0x1a38,0x1a40,0x1a48,0x1a4c,0x1a54,0x1a19,0x1a5c,0x1a64,0x1a48,0x1a6c,0x1a74, +0x1a7b,0x1a83,0x1a21,0x1a48,0x1a86,0x1a29,0x1a30,0x1a8e,0x1a94,0x1b10,0x1b17,0x1b08,0x1a9c,0x1aa4,0x1aac,0x1ab4, +0x1b7f,0x1abc,0x1ac4,0xe7d,0xe85,0x1a09,0x1a09,0x1a09,0xe8d,0x1b37,0x1b37,0xf6a,0xf70,0x1b5f,0x1b5f,0x1b5f, +0x1b5f,0x1b5f,0x1b5f,0xfdb,0x4e4,0x1c34,0x1c2c,0x1102,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0xea5,0xead,0xeb5, +0xebd,0xec5,0xecd,0xed4,0xed8,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf,0x1bdf, +0x1bdf,0x1bdf,0x1bdf,0x1be4,0x1bdf,0x1bdf,0x1bdf,0x108a,0x108c,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x116a,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54, +0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1c54,0x1172,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x4e4, +0x4e4,0x4e4,0x4e4,0x4e4,0x4e4,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x11e5,0x11ae,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x11b6,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x16da,0x16da,0x16da,0x16da,0x16da,0x16da,0x16da,0x16da,0x16da,0x16da,0x16da, +0x16da,0x16da,0x16da,0x16da,0x16da,0x11ed,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ba,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae,0x11ae, +0x11ae,0x11ae,0x11ae,0x11ae,0x11ba,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x11f5,0x1acc, +0x1acc,0x1acc,0x1acc,0x1acc,0x1acc,0x11fd,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1205,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1565, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x156d, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d,0x157d, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2,0x16d2, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7,0x19e7, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24,0x1c24, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c,0x1c4c, +0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c,0x1c7c, +0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x285,0x28e,0x288,0x288,0x28b,0x282,0x282, +0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282, +0x7b0,0x7aa,0x78f,0x786,0x77d,0x77a,0x771,0x78c,0x777,0x783,0x786,0x7a1,0x798,0x789,0x7ad,0x780, +0x76e,0x76e,0x76e,0x76e,0x76e,0x76e,0x76e,0x76e,0x76e,0x76e,0x795,0x792,0x79b,0x79b,0x79b,0x7aa, +0x771,0x7bc,0x7bc,0x7bc,0x7bc,0x7bc,0x7bc,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6, +0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x7b6,0x777,0x77d,0x783,0x7a7,0x76b, +0x7a4,0x7b9,0x7b9,0x7b9,0x7b9,0x7b9,0x7b9,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3, +0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x7b3,0x777,0x79e,0x774,0x79b,0x282, 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,0x282,0x282,0x282,0x282, -0x282,0x291,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282, -0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x282,0x285,0x5fa,0x7b6,0x7b9, -0x600,0x7b9,0x7b3,0x5f7,0x5ee,0x28b,0x60c,0x28e,0x7bc,0x5e5,0x603,0x7b0,0x5fd,0x609,0x5eb,0x5eb, -0x5f1,0x288,0x5f7,0x5f4,0x5ee,0x5eb,0x60c,0x28e,0x5e8,0x5e8,0x5e8,0x5fa,0x297,0x297,0x297,0x297, -0x297,0x297,0x615,0x297,0x297,0x297,0x297,0x297,0x297,0x297,0x297,0x297,0x615,0x297,0x297,0x297, -0x297,0x297,0x297,0x606,0x615,0x297,0x297,0x297,0x297,0x297,0x615,0x60f,0x612,0x612,0x294,0x294, -0x294,0x294,0x60f,0x294,0x612,0x612,0x612,0x294,0x612,0x612,0x294,0x294,0x60f,0x294,0x612,0x612, -0x294,0x294,0x294,0x606,0x60f,0x612,0x612,0x294,0x612,0x294,0x60f,0x294,0x2a3,0x61b,0x2a3,0x29a, -0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a0,0x618,0x2a3,0x61b, -0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x61b,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a, -0x2a3,0x29a,0x621,0x618,0x2a3,0x29a,0x2a3,0x61b,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x618,0x624,0x61e, -0x2a3,0x29a,0x2a3,0x29a,0x618,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x624,0x61e,0x621,0x618,0x2a3, -0x61b,0x2a3,0x29a,0x2a3,0x61b,0x627,0x621,0x618,0x2a3,0x61b,0x2a3,0x29a,0x2a3,0x29a,0x621,0x618, -0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a, -0x2a3,0x29a,0x621,0x618,0x2a3,0x29a,0x2a3,0x61b,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a, -0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x2a3,0x29a,0x2a3,0x29a,0x2a3,0x29a,0x29d,0x2a6,0x2b2,0x2b2,0x2a6, -0x2b2,0x2a6,0x2b2,0x2b2,0x2a6,0x2b2,0x2b2,0x2b2,0x2a6,0x2a6,0x2b2,0x2b2,0x2b2,0x2b2,0x2a6,0x2b2, -0x2b2,0x2a6,0x2b2,0x2b2,0x2b2,0x2a6,0x2a6,0x2a6,0x2b2,0x2b2,0x2a6,0x2b2,0x2b5,0x2a9,0x2b2,0x2a6, -0x2b2,0x2a6,0x2b2,0x2b2,0x2a6,0x2b2,0x2a6,0x2a6,0x2b2,0x2a6,0x2b2,0x2b5,0x2a9,0x2b2,0x2b2,0x2b2, -0x2a6,0x2b2,0x2a6,0x2b2,0x2b2,0x2a6,0x2a6,0x2af,0x2b2,0x2a6,0x2a6,0x2a6,0x2af,0x2af,0x2af,0x2af, -0x2b8,0x2b8,0x2ac,0x2b8,0x2b8,0x2ac,0x2b8,0x2b8,0x2ac,0x2b5,0x62a,0x2b5,0x62a,0x2b5,0x62a,0x2b5, -0x62a,0x2b5,0x62a,0x2b5,0x62a,0x2b5,0x62a,0x2b5,0x62a,0x2a6,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9, -0x2b2,0x2a6,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2a9,0x2b8,0x2b8,0x2ac, -0x2b5,0x2a9,0x990,0x990,0x993,0x98d,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9, -0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9,0x2b5,0x2a9, -0x993,0x98d,0x993,0x98d,0x990,0x98a,0x993,0x98d,0xb4f,0xc51,0x990,0x98a,0x990,0x98a,0x993,0x98d, -0x993,0x98d,0x993,0x98d,0x993,0x98d,0x993,0x98d,0x993,0x98d,0x993,0x98d,0xc51,0xc51,0xc51,0xd4a, -0xd4a,0xd4a,0xd4d,0xd4d,0xd4a,0xd4d,0xd4d,0xd4a,0xd4a,0xd4d,0xe8e,0xe91,0xe91,0xe91,0xe91,0xe8e, -0xe91,0xe8e,0xe91,0xe8e,0xe91,0xe8e,0xe91,0xe8e,0x2bb,0x62d,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb, -0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x62d,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb, -0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb, -0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2be,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb, -0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x2bb,0x996,0x996,0x996, -0x996,0x996,0xc54,0xc54,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2cd,0x2cd,0x2cd, -0x2cd,0x2cd,0x2cd,0x2cd,0x2ca,0x2ca,0x2c1,0x2c1,0x633,0x2c1,0x2cd,0x636,0x2d0,0x636,0x636,0x636, -0x2d0,0x636,0x2cd,0x2cd,0x639,0x2d3,0x2c1,0x2c1,0x2c1,0x2c1,0x2c1,0x2c7,0x630,0x630,0x630,0x630, -0x2c4,0x630,0x2c1,0xac8,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2c1,0x2c1,0x2c1,0x2c1,0x2c1,0x99f,0x99f, -0x99c,0x999,0x99c,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57,0xc57, -0xc57,0xc57,0xc57,0xc57,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c, -0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c, -0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c, -0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c,0x63c, -0x63c,0x63c,0x63c,0x63c,0x63f,0x63f,0x8f4,0x63f,0x63f,0x8f7,0xacb,0xacb,0xacb,0xacb,0xacb,0xacb, -0xacb,0xacb,0xacb,0xc09,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xe55,0xe55,0xe55,0xe55, -0xe58,0xd1d,0xd1d,0xd1d,0x642,0x642,0xace,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e, -0xc4e,0xc4e,0xc4e,0xc4e,0xf3c,0xf39,0xf3c,0xf39,0x2e2,0x2eb,0xf3c,0xf39,9,9,0x2f1,0xe94, -0xe94,0xe94,0x2d9,0x1491,9,9,9,9,0x2ee,0x2dc,0x300,0x2df,0x300,0x300,0x300,9, -0x300,9,0x300,0x300,0x2f7,0x648,0x648,0x648,0x648,0x648,0x648,0x648,0x648,0x648,0x648,0x648, -0x648,0x648,0x648,0x648,0x648,0x648,9,0x648,0x648,0x648,0x648,0x648,0x648,0x648,0x300,0x300, -0x2f7,0x2f7,0x2f7,0x2f7,0x2f7,0x645,0x645,0x645,0x645,0x645,0x645,0x645,0x645,0x645,0x645,0x645, -0x645,0x645,0x645,0x645,0x645,0x645,0x2f4,0x645,0x645,0x645,0x645,0x645,0x645,0x645,0x2f7,0x2f7, -0x2f7,0x2f7,0x2f7,0xf3c,0x303,0x303,0x306,0x300,0x300,0x303,0x2fa,0x9a2,0xb58,0xb55,0x2fd,0x9a2, -0x2fd,0x9a2,0x2fd,0x9a2,0x2fd,0x9a2,0x2e8,0x2e5,0x2e8,0x2e5,0x2e8,0x2e5,0x2e8,0x2e5,0x2e8,0x2e5, -0x2e8,0x2e5,0x2e8,0x2e5,0x303,0x303,0x2fa,0x2f4,0xb07,0xb04,0xb52,0xc5d,0xc5a,0xc60,0xc5d,0xc5a, -0xd50,0xd53,0xd53,0xd53,0x9b1,0x654,0x312,0x315,0x312,0x312,0x312,0x315,0x312,0x312,0x312,0x312, -0x315,0x9b1,0x315,0x312,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x654,0x651,0x651, -0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651,0x651, -0x651,0x651,0x651,0x651,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64e,0x64b,0x64b, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x291,0x291,0x291,0x291,0x291,0x2a0,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291, +0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291,0x291, +0x294,0x609,0x7c5,0x7c8,0x60f,0x7c8,0x7c2,0x606,0x5fd,0x29a,0x61b,0x29d,0x7cb,0x5f4,0x612,0x7bf, +0x60c,0x618,0x5fa,0x5fa,0x600,0x297,0x606,0x603,0x5fd,0x5fa,0x61b,0x29d,0x5f7,0x5f7,0x5f7,0x609, +0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x624,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6, +0x624,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x615,0x624,0x2a6,0x2a6,0x2a6,0x2a6,0x2a6,0x624,0x61e, +0x621,0x621,0x2a3,0x2a3,0x2a3,0x2a3,0x61e,0x2a3,0x621,0x621,0x621,0x2a3,0x621,0x621,0x2a3,0x2a3, +0x61e,0x2a3,0x621,0x621,0x2a3,0x2a3,0x2a3,0x615,0x61e,0x621,0x621,0x2a3,0x621,0x2a3,0x61e,0x2a3, +0x2b2,0x62a,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9, +0x2af,0x627,0x2b2,0x62a,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x62a,0x2b2,0x2a9,0x2b2,0x2a9, +0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x630,0x627,0x2b2,0x2a9,0x2b2,0x62a,0x2b2,0x2a9,0x2b2,0x2a9, +0x2b2,0x627,0x633,0x62d,0x2b2,0x2a9,0x2b2,0x2a9,0x627,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x633, +0x62d,0x630,0x627,0x2b2,0x62a,0x2b2,0x2a9,0x2b2,0x62a,0x636,0x630,0x627,0x2b2,0x62a,0x2b2,0x2a9, +0x2b2,0x2a9,0x630,0x627,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9, +0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x630,0x627,0x2b2,0x2a9,0x2b2,0x62a,0x2b2,0x2a9,0x2b2,0x2a9, +0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2b2,0x2a9,0x2b2,0x2a9,0x2b2,0x2a9,0x2ac, +0x2b5,0x2c1,0x2c1,0x2b5,0x2c1,0x2b5,0x2c1,0x2c1,0x2b5,0x2c1,0x2c1,0x2c1,0x2b5,0x2b5,0x2c1,0x2c1, +0x2c1,0x2c1,0x2b5,0x2c1,0x2c1,0x2b5,0x2c1,0x2c1,0x2c1,0x2b5,0x2b5,0x2b5,0x2c1,0x2c1,0x2b5,0x2c1, +0x2c4,0x2b8,0x2c1,0x2b5,0x2c1,0x2b5,0x2c1,0x2c1,0x2b5,0x2c1,0x2b5,0x2b5,0x2c1,0x2b5,0x2c1,0x2c4, +0x2b8,0x2c1,0x2c1,0x2c1,0x2b5,0x2c1,0x2b5,0x2c1,0x2c1,0x2b5,0x2b5,0x2be,0x2c1,0x2b5,0x2b5,0x2b5, +0x2be,0x2be,0x2be,0x2be,0x2c7,0x2c7,0x2bb,0x2c7,0x2c7,0x2bb,0x2c7,0x2c7,0x2bb,0x2c4,0x639,0x2c4, +0x639,0x2c4,0x639,0x2c4,0x639,0x2c4,0x639,0x2c4,0x639,0x2c4,0x639,0x2c4,0x639,0x2b5,0x2c4,0x2b8, +0x2c4,0x2b8,0x2c4,0x2b8,0x2c1,0x2b5,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8, +0x2b8,0x2c7,0x2c7,0x2bb,0x2c4,0x2b8,0x9a2,0x9a2,0x9a5,0x99f,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8, +0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8,0x2c4,0x2b8, +0x2c4,0x2b8,0x2c4,0x2b8,0x9a5,0x99f,0x9a5,0x99f,0x9a2,0x99c,0x9a5,0x99f,0xb61,0xc63,0x9a2,0x99c, +0x9a2,0x99c,0x9a5,0x99f,0x9a5,0x99f,0x9a5,0x99f,0x9a5,0x99f,0x9a5,0x99f,0x9a5,0x99f,0x9a5,0x99f, +0xc63,0xc63,0xc63,0xd5c,0xd5c,0xd5c,0xd5f,0xd5f,0xd5c,0xd5f,0xd5f,0xd5c,0xd5c,0xd5f,0xea3,0xea6, +0xea6,0xea6,0xea6,0xea3,0xea6,0xea3,0xea6,0xea3,0xea6,0xea3,0xea6,0xea3,0x2ca,0x63c,0x2ca,0x2ca, +0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x63c,0x2ca,0x2ca, +0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca, +0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2cd,0x2ca,0x2ca,0x2ca, +0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca,0x2ca, +0x2ca,0x9a8,0x9a8,0x9a8,0x9a8,0x9a8,0xc66,0xc66,0x2e5,0x2e5,0x2e5,0x2e5,0x2e5,0x2e5,0x2e5,0x2e5, +0x2e5,0x2dc,0x2dc,0x2dc,0x2dc,0x2dc,0x2dc,0x2dc,0x2d9,0x2d9,0x2d6,0x2d6,0x642,0x2d6,0x2dc,0x645, +0x2df,0x645,0x645,0x645,0x2df,0x645,0x2dc,0x2dc,0x648,0x2e2,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6,0x2d6, +0x63f,0x63f,0x63f,0x63f,0x2d3,0x63f,0x2d6,0xada,0x2e5,0x2e5,0x2e5,0x2e5,0x2e5,0x2d0,0x2d0,0x2d0, +0x2d0,0x2d0,0x9b1,0x9b1,0x9ae,0x9ab,0x9ae,0xc69,0xc69,0xc69,0xc69,0xc69,0xc69,0xc69,0xc69,0xc69, +0xc69,0xc69,0xc69,0xc69,0xc69,0xc69,0xc69,0xc69,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b, +0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b, 0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b, -0x9ab,0x64e,0x30c,0x30f,0x30c,0x30c,0x30c,0x30f,0x30c,0x30c,0x30c,0x30c,0x30f,0x9ab,0x30f,0x30c, -0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c, -0x312,0x30c,0x312,0x30c,0x312,0x30c,0x315,0x30f,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c, -0x312,0x30c,0x309,0x900,0x903,0x8e5,0x8e5,0x10e6,0x9a5,0x9a5,0xb5e,0xb5b,0x9ae,0x9a8,0x9ae,0x9a8, -0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c, -0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c, -0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c,0x312,0x30c, -0x312,0x315,0x30f,0x312,0x30c,0xb5e,0xb5b,0x312,0x30c,0xb5e,0xb5b,0x312,0x30c,0xb5e,0xb5b,0xe97, -0x315,0x30f,0x315,0x30f,0x312,0x30c,0x315,0x30f,0x312,0x30c,0x315,0x30f,0x315,0x30f,0x315,0x30f, -0x312,0x30c,0x315,0x30f,0x315,0x30f,0x315,0x30f,0x312,0x30c,0x315,0x30f,0x9b1,0x9ab,0x315,0x30f, -0x315,0x30f,0x315,0x30f,0x315,0x30f,0xd59,0xd56,0x315,0x30f,0xe9a,0xe97,0xe9a,0xe97,0xe9a,0xe97, -0xbca,0xbc7,0xbca,0xbc7,0xbca,0xbc7,0xbca,0xbc7,0xbca,0xbc7,0xbca,0xbc7,0xbca,0xbc7,0xbca,0xbc7, -0xec7,0xec4,0xec7,0xec4,0xfba,0xfb7,0xfba,0xfb7,0xfba,0xfb7,0xfba,0xfb7,0xfba,0xfb7,0xfba,0xfb7, -0xfba,0xfb7,0xfba,0xfb7,0x111f,0x111c,0x12f9,0x12f6,0x14ca,0x14c7,0x14ca,0x14c7,0x14ca,0x14c7,0x14ca,0x14c7, -0xc,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324, -0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0x324,0xc,0xc,0x327,0x318,0x318, -0x318,0x31b,0x318,0x318,0xc,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e, -0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e, -0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x31e,0x321,0xc,0x86a,0x9b4,0xc,0xc,0x1494,0x1494,0x13ad, -0xf,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924, -0x924,0x924,0xd5c,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924, -0x32a,0x32a,0x32a,0x32a,0x32a,0x32a,0x32a,0x32a,0x32a,0x32a,0xe9d,0x32a,0x32a,0x32a,0x336,0x32a, -0x32d,0x32a,0x32a,0x339,0x927,0xd5f,0xd62,0xd5f,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, -0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c, -0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0xf,0xf,0xf,0xf,0xf, -0x33c,0x33c,0x33c,0x333,0x330,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf,0xf, -0xc63,0xc63,0xc63,0xc63,0x13b0,0x1497,0xf45,0xf45,0xf45,0xf42,0xf42,0xd6b,0x870,0xc72,0xc6f,0xc6f, -0xc66,0xc66,0xc66,0xc66,0xc66,0xc66,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0x86d,0x148b,0x12,0xd68,0x873, -0x12c0,0x357,0x35a,0x35a,0x35a,0x35a,0x35a,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357, -0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0xf48,0xf48,0xf48,0xf48,0xf48, -0x876,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb, -0x8eb,0x8eb,0x8eb,0xafe,0xafe,0xafe,0xc66,0xc6c,0xc69,0xd65,0xd65,0xd65,0xd65,0xd65,0xd65,0x12bd, -0x906,0x906,0x906,0x906,0x906,0x906,0x906,0x906,0x906,0x906,0x351,0x34e,0x34b,0x348,0xb61,0xb61, -0x8e8,0x357,0x357,0x363,0x357,0x35d,0x35d,0x35d,0x35d,0x357,0x357,0x357,0x357,0x357,0x357,0x357, -0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357, -0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357, -0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357, -0x357,0x357,0x357,0x357,0x9ba,0x9ba,0x357,0x357,0x357,0x357,0x357,0x9ba,0x35a,0x357,0x35a,0x357, -0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x357,0x9ba,0x357,0x357,0x357,0x35a, -0x366,0x357,0x342,0x342,0x342,0x342,0x342,0x342,0x342,0x33f,0x348,0x345,0x345,0x342,0x342,0x342, -0x342,0x360,0x360,0x342,0x342,0x348,0x345,0x345,0x345,0x342,0xc75,0xc75,0x354,0x354,0x354,0x354, -0x354,0x354,0x354,0x354,0x354,0x354,0x9ba,0x9ba,0x9ba,0x9b7,0x9b7,0xc75,0x9d2,0x9d2,0x9d2,0x9cc, -0x9cc,0x9cc,0x9cc,0x9cc,0x9cc,0x9cc,0x9cc,0x9c9,0x9cc,0x9c9,0x15,0x9bd,0x9cf,0x9c0,0x9cf,0x9cf, -0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf, -0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0x9cf,0xc78,0xc78,0xc78,0x9c6,0x9c6,0x9c6,0x9c6, -0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c6,0x9c3,0x9c3,0x9c3,0x9c3, -0x9c3,0x9c3,0x9c3,0x9c3,0x9c3,0x9c3,0x9c3,0x15,0x15,0xc78,0xc78,0xc78,0xdcb,0xdcb,0xdcb,0xdcb, -0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb, -0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xdcb,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc, -0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0xfcc,0x9d8,0x9d8,0x9d8,0x9d8, -0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8, -0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8,0x9d8, -0x9d8,0x9d8,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0xb64,0x18,0x18, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xedf,0xedf,0xedf,0xedf, -0xedf,0xedf,0xedf,0xedf,0xedf,0xedf,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2, -0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2, -0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xed6,0xed6,0xed6,0xed6,0xed6,0xed6,0xed6,0xed6,0xed6, -0xee5,0xee5,0xed9,0xed9,0xedc,0xeeb,0xee8,0x111,0x111,0x111,0x111,0x111,0x17d3,0x17d3,0x17d3,0x17d3, -0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xada,0xada,0xadd,0xadd, -0xada,0xada,0xada,0xada,0xada,0xada,0xada,0xada,0x75,0x75,0x75,0x75,0x1551,0x1551,0x1551,0x1551, -0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x154e,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1fe,0x1fe,0x1fe,0x1fe, -0x1fe,0x1fe,0x1fe,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x20a,0x20a,0x20a,0x20a, -0x20a,0x20a,0x20a,0x20a,0x20a,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x120f,0x120f,0x120f,0x120f, -0x120f,0x120f,0x120f,0x120f,0x120f,0x17d,0x17d,0x17d,0x17d,0x17d,0x17d,0x17d,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1e0,0x1e0,0x1e0,0x1e0, -0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1467,0x1467,0x1467,0x1467, -0x1467,0x1467,0x1467,0x1467,0x1467,0x1467,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x173d,0x173d,0x173d,0x173d, -0x225,0x225,0x225,0x225,0x225,0x225,0x225,0x225,0x225,0x225,0x225,0x225,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1233,0x1233,0x1233,0x1233, -0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x186,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x15f6,0x15f6,0x15f6,0x15f6, -0x15f6,0x15f6,0x15f6,0x15f6,0x15f6,0x15f6,0x1f8,0x1f8,0x1f8,0x1f8,0x15fc,0x15fc,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x1548,0x1548,0x1548,0x1548, -0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1632,0x1632,0x1632,0x1632, -0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x16aa,0x16aa,0x16aa,0x16aa, -0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0xdc2,0xdc2,0xdbf,0xdbf, -0xdbf,0xdc2,0xde,0xde,0xde,0xde,0xde,0xde,0xde,0xde,0xde,0xde,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x234,0x1755,0x1755,0x1755, -0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0x17d6,0x17d6,0x240,0x17d6, -0x17d6,0x240,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x240,0x240,0x240,0x240,0x240,0,0,0,0, +0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b, +0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64b,0x64e,0x64e,0x906,0x64e,0x64e,0x909,0xadd,0xadd, +0xadd,0xadd,0xadd,0xadd,0xadd,0xadd,0xadd,0xc1b,0xd2c,0xd2c,0xd2c,0xd2c,0xd2c,0xd2c,0xd2c,0xd2c, +0xe6a,0xe6a,0xe6a,0xe6a,0xe6d,0xd2f,0xd2f,0xd2f,0x651,0x651,0xae0,0xc60,0xc60,0xc60,0xc60,0xc60, +0xc60,0xc60,0xc60,0xc60,0xc60,0xc60,0xc60,0xc60,0xf51,0xf4e,0xf51,0xf4e,0x2f1,0x2fa,0xf51,0xf4e, +9,9,0x300,0xea9,0xea9,0xea9,0x2e8,0x14a6,9,9,9,9,0x2fd,0x2eb,0x30f,0x2ee, +0x30f,0x30f,0x30f,9,0x30f,9,0x30f,0x30f,0x306,0x657,0x657,0x657,0x657,0x657,0x657,0x657, +0x657,0x657,0x657,0x657,0x657,0x657,0x657,0x657,0x657,0x657,9,0x657,0x657,0x657,0x657,0x657, +0x657,0x657,0x30f,0x30f,0x306,0x306,0x306,0x306,0x306,0x654,0x654,0x654,0x654,0x654,0x654,0x654, +0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x654,0x303,0x654,0x654,0x654,0x654,0x654, +0x654,0x654,0x306,0x306,0x306,0x306,0x306,0xf51,0x312,0x312,0x315,0x30f,0x30f,0x312,0x309,0x9b4, +0xb6a,0xb67,0x30c,0x9b4,0x30c,0x9b4,0x30c,0x9b4,0x30c,0x9b4,0x2f7,0x2f4,0x2f7,0x2f4,0x2f7,0x2f4, +0x2f7,0x2f4,0x2f7,0x2f4,0x2f7,0x2f4,0x2f7,0x2f4,0x312,0x312,0x309,0x303,0xb19,0xb16,0xb64,0xc6f, +0xc6c,0xc72,0xc6f,0xc6c,0xd62,0xd65,0xd65,0xd65,0x9c3,0x663,0x321,0x324,0x321,0x321,0x321,0x324, +0x321,0x321,0x321,0x321,0x324,0x9c3,0x324,0x321,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660, +0x660,0x663,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660, +0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x660,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a, +0x65a,0x65d,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a,0x65a, +0x65a,0x65a,0x65a,0x65a,0x9bd,0x65d,0x31b,0x31e,0x31b,0x31b,0x31b,0x31e,0x31b,0x31b,0x31b,0x31b, +0x31e,0x9bd,0x31e,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b, +0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x324,0x31e,0x321,0x31b,0x321,0x31b, +0x321,0x31b,0x321,0x31b,0x321,0x31b,0x318,0x912,0x915,0x8f7,0x8f7,0x10fb,0x9b7,0x9b7,0xb70,0xb6d, +0x9c0,0x9ba,0x9c0,0x9ba,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b, +0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b, +0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b,0x321,0x31b, +0x321,0x31b,0x321,0x31b,0x321,0x324,0x31e,0x321,0x31b,0xb70,0xb6d,0x321,0x31b,0xb70,0xb6d,0x321, +0x31b,0xb70,0xb6d,0xeac,0x324,0x31e,0x324,0x31e,0x321,0x31b,0x324,0x31e,0x321,0x31b,0x324,0x31e, +0x324,0x31e,0x324,0x31e,0x321,0x31b,0x324,0x31e,0x324,0x31e,0x324,0x31e,0x321,0x31b,0x324,0x31e, +0x9c3,0x9bd,0x324,0x31e,0x324,0x31e,0x324,0x31e,0x324,0x31e,0xd6b,0xd68,0x324,0x31e,0xeaf,0xeac, +0xeaf,0xeac,0xeaf,0xeac,0xbdc,0xbd9,0xbdc,0xbd9,0xbdc,0xbd9,0xbdc,0xbd9,0xbdc,0xbd9,0xbdc,0xbd9, +0xbdc,0xbd9,0xbdc,0xbd9,0xedc,0xed9,0xedc,0xed9,0xfcf,0xfcc,0xfcf,0xfcc,0xfcf,0xfcc,0xfcf,0xfcc, +0xfcf,0xfcc,0xfcf,0xfcc,0xfcf,0xfcc,0xfcf,0xfcc,0x1134,0x1131,0x130e,0x130b,0x14df,0x14dc,0x14df,0x14dc, +0x14df,0x14dc,0x14df,0x14dc,0xc,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333, +0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0x333,0xc, +0xc,0x336,0x327,0x327,0x327,0x32a,0x327,0x327,0xc,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d, +0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d, +0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x32d,0x330,0xc,0x870,0x9c6,0xc, +0xc,0x14a9,0x14a9,0x13c2,0xf,0x936,0x936,0x936,0x936,0x936,0x936,0x936,0x936,0x936,0x936,0x936, +0x936,0x936,0x936,0x936,0x936,0x936,0xd6e,0x936,0x936,0x936,0x936,0x936,0x936,0x936,0x936,0x936, +0x936,0x936,0x936,0x936,0x339,0x339,0x339,0x339,0x339,0x339,0x339,0x339,0x339,0x339,0xeb2,0x339, +0x339,0x339,0x345,0x339,0x33c,0x339,0x339,0x348,0x939,0xd71,0xd74,0xd71,0xf,0xf,0xf,0xf, +0xf,0xf,0xf,0xf,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b, +0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0x34b,0xf, +0xf,0xf,0xf,0xf,0x34b,0x34b,0x34b,0x342,0x33f,0xf,0xf,0xf,0xf,0xf,0xf,0xf, +0xf,0xf,0xf,0xf,0xc87,0xc87,0xc87,0xc87,0x13c5,0x14ac,0xf5a,0xf5a,0xf5a,0xf57,0xf57,0xd7d, +0x876,0xc81,0xc7e,0xc7e,0xc75,0xc75,0xc75,0xc75,0xc75,0xc75,0xf54,0xf54,0xf54,0xf54,0xf54,0x873, +0x14a3,0x12,0xd7a,0x879,0x12d5,0x366,0x369,0x369,0x369,0x369,0x369,0x366,0x366,0x366,0x366,0x366, +0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0xf5d, +0xf5d,0xf5d,0xf5d,0xf5d,0x87c,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x8fd, +0x8fd,0x8fd,0x8fd,0x8fd,0x8fd,0x8fd,0x8fd,0xb10,0xb10,0xb10,0xc75,0xc7b,0xc78,0xd77,0xd77,0xd77, +0xd77,0xd77,0xd77,0x12d2,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x360,0x35d, +0x35a,0x357,0xb73,0xb73,0x8fa,0x366,0x366,0x372,0x366,0x36c,0x36c,0x36c,0x36c,0x366,0x366,0x366, +0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366, +0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366, +0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366, +0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x9cc,0x9cc,0x366,0x366,0x366,0x366,0x366,0x9cc, +0x369,0x366,0x369,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x366,0x9cc, +0x366,0x366,0x366,0x369,0x375,0x366,0x351,0x351,0x351,0x351,0x351,0x351,0x351,0x34e,0x357,0x354, +0x354,0x351,0x351,0x351,0x351,0x36f,0x36f,0x351,0x351,0x357,0x354,0x354,0x354,0x351,0xc84,0xc84, +0x363,0x363,0x363,0x363,0x363,0x363,0x363,0x363,0x363,0x363,0x9cc,0x9cc,0x9cc,0x9c9,0x9c9,0xc84, +0x9e1,0x9e1,0x9e1,0x9db,0x9db,0x9db,0x9db,0x9db,0x9db,0x9db,0x9db,0x9d8,0x9db,0x9d8,0x15,0x9e4, +0x9de,0x9cf,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de, +0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0x9de,0xc8a,0xc8a,0xc8a, +0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5,0x9d5, +0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x9d2,0x15,0x15,0xc8a,0xc8a,0xc8a, +0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0, +0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xde0,0xfe1,0xfe1, +0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1,0xfe1, +0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea, +0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea, +0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9e7,0x9e7,0x9e7,0x9e7,0x9e7,0x9e7,0x9e7,0x9e7,0x9e7,0x9e7, +0x9e7,0xb76,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7, +0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7, +0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xef7,0xeeb,0xeeb,0xeeb,0xeeb,0xeeb, +0xeeb,0xeeb,0xeeb,0xeeb,0xefa,0xefa,0xeee,0xeee,0xef1,0xf00,0xefd,0x10e,0x10e,0x10e,0x10e,0x10e, +0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x18a2,0x25e,0x25e,0x25e,0x25e,0x25e, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x237,0x237,0x237,0x237,0x237,0x237,0x237, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xaec,0xaec,0xaef,0xaef,0xaec,0xaec,0xaec,0xaec,0xaec,0xaec,0xaec,0xaec,0x72,0x72,0x72,0x72, +0x1563,0x1563,0x1563,0x1563,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1c5,0x1560, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1f8,0x1f8,0x1f8,0x1f8,0x1f8,0x1f8,0x1f8,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x1656,0x1656,0x1656,0x1656,0x1656,0x1656,0x1656, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x17a,0x17a,0x17a,0x17a,0x17a,0x17a,0x17a, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x147c,0x147c,0x147c,0x147c,0x147c,0x147c,0x147c,0x147c,0x147c,0x147c,0x1bf,0x1bf,0x1bf,0x1bf,0x1bf,0x1bf, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1890,0x1893,0x1893,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1752,0x1752,0x1752,0x1752,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f,0x21f, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x183, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x1608,0x1608,0x1608,0x1608,0x1608,0x1608,0x1608,0x1608,0x1608,0x1608,0x1f2,0x1f2,0x1f2,0x1f2,0x160e,0x160e, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a, +0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252, 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,0x921,0x921,3,3,3,3, +0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1, +0x16bc,0x16bc,0x16bc,0x16bc,0x207,0x207,0x207,0x207,0x207,0x207,0x207,0x207,0x207,0x207,0x207,0x207, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0xdd7,0xdd7,0xdd4,0xdd4,0xdd4,0xdd7,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x22e,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x17eb,0x17eb,0x23a,0x17eb,0x17eb,0x23a,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x23a,0x23a,0x23a,0x23a,0x23a, +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,0x933,0x933, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,0x921,0x921, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +3,3,0x933,0x933,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -0x149d,0x37e,0x38d,0x38d,0x1b,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x1b,0x1b,0x393, -0x393,0x1b,0x1b,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x393, -0x393,0x1b,0x393,0x393,0x393,0x393,0x393,0x393,0x393,0x1b,0x393,0x1b,0x1b,0x1b,0x393,0x393, -0x393,0x393,0x1b,0x1b,0x381,0xc7e,0x37e,0x38d,0x38d,0x37e,0x37e,0x37e,0x37e,0x1b,0x1b,0x38d, -0x38d,0x1b,0x1b,0x390,0x390,0x384,0xd71,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x37e, -0x1b,0x1b,0x1b,0x1b,0x396,0x396,0x1b,0x396,0x393,0x393,0x37e,0x37e,0x1b,0x1b,0x90c,0x90c, -0x90c,0x90c,0x90c,0x90c,0x90c,0x90c,0x90c,0x90c,0x393,0x393,0x38a,0x38a,0x387,0x387,0x387,0x387, -0x387,0x38a,0x387,0x10f5,0x1b,0x1b,0x1b,0x1b,0x1e,0xc81,0x399,0xc84,0x1e,0x3a5,0x3a5,0x3a5, -0x3a5,0x3a5,0x3a5,0x1e,0x1e,0x1e,0x1e,0x3a5,0x3a5,0x1e,0x1e,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5, -0x3a5,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5,0x1e,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5,0x3a5, -0x3a5,0x1e,0x3a5,0x3a8,0x1e,0x3a5,0x3a8,0x1e,0x3a5,0x3a5,0x1e,0x1e,0x39c,0x1e,0x3a2,0x3a2, -0x3a2,0x399,0x399,0x1e,0x1e,0x1e,0x1e,0x399,0x399,0x1e,0x1e,0x399,0x399,0x39f,0x1e,0x1e, -0x1e,0xf51,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x3a8,0x3a8,0x3a8,0x3a5,0x1e,0x3a8,0x1e, -0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x90f,0x90f,0x90f,0x90f,0x90f,0x90f,0x90f,0x90f,0x90f,0x90f, -0x399,0x399,0x3a5,0x3a5,0x3a5,0xf51,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e, -0x21,0x3ab,0x3ab,0x3b4,0x21,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0xc8d,0x3b7,0x21,0x3b7, -0x3b7,0x3b7,0x21,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7, -0x3b7,0x21,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x3b7,0x21,0x3b7,0x3b7,0x21,0x3b7,0x3b7,0x3b7, -0x3b7,0x3b7,0x21,0x21,0x3ae,0x3b7,0x3b4,0x3b4,0x3b4,0x3ab,0x3ab,0x3ab,0x3ab,0x3ab,0x21,0x3ab, -0x3ab,0x3b4,0x21,0x3b4,0x3b4,0x3b1,0x21,0x21,0x3b7,0x21,0x21,0x21,0x21,0x21,0x21,0x21, -0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x3b7,0xc8d,0xc87,0xc87,0x21,0x21,0x912,0x912, -0x912,0x912,0x912,0x912,0x912,0x912,0x912,0x912,0x13b3,0xc8a,0x21,0x21,0x21,0x21,0x21,0x21, -0x21,0x16b9,0x21,0x21,0x21,0x21,0x21,0x21,0x24,0x3ba,0x3c9,0x3c9,0x24,0x3cf,0x3cf,0x3cf, -0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x24,0x24,0x3cf,0x3cf,0x24,0x24,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf, -0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x24,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf,0x3cf, -0x3cf,0x24,0x3cf,0x3cf,0x24,0xc90,0x3cf,0x3cf,0x3cf,0x3cf,0x24,0x24,0x3bd,0x3cf,0x3ba,0x3ba, -0x3c9,0x3ba,0x3ba,0x3ba,0xf54,0x24,0x24,0x3c9,0x3cc,0x24,0x24,0x3cc,0x3cc,0x3c0,0x24,0x24, -0x24,0x24,0x24,0x24,0x24,0x24,0x3ba,0x3ba,0x24,0x24,0x24,0x24,0x3d2,0x3d2,0x24,0x3cf, -0x3cf,0x3cf,0xf54,0xf54,0x24,0x24,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6, -0x3c3,0xc90,0x12cc,0x12cc,0x12cc,0x12cc,0x12cc,0x12cc,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, -0x27,0x27,0x3d5,0x3e1,0x27,0x3e1,0x3e1,0x3e1,0x3e1,0x3e1,0x3e1,0x27,0x27,0x27,0x3e1,0x3e1, -0x3e1,0x27,0x3e1,0x3e1,0x3e4,0x3e1,0x27,0x27,0x27,0x3e1,0x3e1,0x27,0x3e1,0x27,0x3e1,0x3e1, -0x27,0x27,0x27,0x3e1,0x3e1,0x27,0x27,0x27,0x3e1,0x3e1,0x91b,0x27,0x27,0x27,0x3e1,0x3e1, -0x3e1,0x3e1,0x3e1,0x3e1,0x3e1,0x91b,0xd74,0x3e1,0x3e1,0x3e1,0x27,0x27,0x27,0x27,0x3d5,0x3db, -0x3d5,0x3db,0x3db,0x27,0x27,0x27,0x3db,0x3db,0x3db,0x27,0x3de,0x3de,0x3de,0x3d8,0x27,0x27, -0xf57,0x27,0x27,0x27,0x27,0x27,0x27,0x3d5,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27, -0x27,0x27,0xe8b,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x918,0x915,0x915,0x915,0xc93, -0xc93,0xc93,0xc93,0xc93,0xc93,0xc96,0xc93,0x27,0x27,0x27,0x27,0x27,0x14a0,0x3f3,0x3f3,0x3f3, -0x2a,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x2a,0x3f6,0x3f6,0x3f6,0x2a,0x3f6,0x3f6, -0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x2a,0x3f6,0x3f6, -0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x14a3,0x3f6,0x3f6,0x3f6,0x3f6,0x3f6,0x2a,0x2a, -0x2a,0xf60,0x3e7,0x3e7,0x3e7,0x3f3,0x3f3,0x3f3,0x3f3,0x2a,0x3e7,0x3e7,0x3ea,0x2a,0x3e7,0x3e7, -0x3e7,0x3ed,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x3e7,0x3e7,0x2a,0xf60,0xf60,0x16bc,0x2a, -0x2a,0x2a,0x2a,0x2a,0x3f6,0x3f6,0xf5a,0xf5a,0x2a,0x2a,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0, -0x3f0,0x3f0,0x3f0,0x3f0,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0xf5d,0xf5d,0xf5d,0xf5d, -0xf5d,0xf5d,0xf5d,0xf5d,0x1779,0x14a6,0x402,0x402,0x2d,0x408,0x408,0x408,0x408,0x408,0x408,0x408, -0x408,0x2d,0x408,0x408,0x408,0x2d,0x408,0x408,0x408,0x408,0x408,0x408,0x408,0x408,0x408,0x408, -0x408,0x408,0x408,0x408,0x408,0x2d,0x408,0x408,0x408,0x408,0x408,0x408,0x408,0x408,0x408,0x408, -0x2d,0x408,0x408,0x408,0x408,0x408,0x2d,0x2d,0xc99,0xc9c,0x402,0x3f9,0x405,0x402,0x3f9,0x402, -0x402,0x2d,0x3f9,0x405,0x405,0x2d,0x405,0x405,0x3f9,0x3fc,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, -0x2d,0x3f9,0x3f9,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x408,0x2d,0x408,0x408,0xea3,0xea3, -0x2d,0x2d,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x2d,0xea6,0xea6,0x2d, -0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x30,0x14a9,0x414,0x414, -0x30,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x30,0x41a,0x41a,0x41a,0x30,0x41a,0x41a, -0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x12cf,0x41a,0x41a, -0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x41a,0x12cf,0x30, -0x30,0xf6c,0x40b,0x414,0x414,0x40b,0x40b,0x40b,0xf63,0x30,0x414,0x414,0x414,0x30,0x417,0x417, -0x417,0x40e,0x12d2,0x177c,0x30,0x30,0x30,0x30,0x177f,0x177f,0x177f,0x40b,0x177c,0x177c,0x177c,0x177c, -0x177c,0x177c,0x177c,0x16bf,0x41a,0x41a,0xf63,0xf63,0x30,0x30,0x411,0x411,0x411,0x411,0x411,0x411, -0x411,0x411,0x411,0x411,0xf66,0xf66,0xf66,0xf66,0xf66,0xf66,0x177c,0x177c,0x177c,0xf69,0xf6c,0xf6c, -0xf6c,0xf6c,0xf6c,0xf6c,0x33,0x33,0x9e4,0x9e4,0x33,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea, -0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x33,0x33,0x33,0x9ea,0x9ea, -0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea, -0x9ea,0x9ea,0x33,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x33,0x9ea,0x33,0x33, -0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x9ea,0x33,0x33,0x33,0x9de,0x33,0x33,0x33,0x33,0x9db, -0x9e4,0x9e4,0x9db,0x9db,0x9db,0x33,0x9db,0x33,0x9e4,0x9e4,0x9e7,0x9e4,0x9e7,0x9e7,0x9e7,0x9db, -0x33,0x33,0x33,0x33,0x33,0x33,0x14ac,0x14ac,0x14ac,0x14ac,0x14ac,0x14ac,0x14ac,0x14ac,0x14ac,0x14ac, -0x33,0x33,0x9e4,0x9e4,0x9e1,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, -0x36,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435, -0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435,0x435, -0x435,0x420,0x435,0x432,0x420,0x420,0x420,0x420,0x420,0x420,0x426,0x36,0x36,0x36,0x36,0x41d, -0x43b,0x43b,0x43b,0x43b,0x43b,0x435,0x438,0x423,0x423,0x423,0x423,0x423,0x423,0x420,0x423,0x429, -0x42f,0x42f,0x42f,0x42f,0x42f,0x42f,0x42f,0x42f,0x42f,0x42f,0x42c,0x42c,0x36,0x36,0x36,0x36, +6,6,6,6,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35, +0xd35,0xd35,0xd35,0xd35,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,0x14b2,0x38d,0x39c,0x39c,0x1b,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2, +0x3a2,0x1b,0x1b,0x3a2,0x3a2,0x1b,0x1b,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2, +0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x1b,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x3a2,0x1b,0x3a2,0x1b, +0x1b,0x1b,0x3a2,0x3a2,0x3a2,0x3a2,0x1b,0x1b,0x390,0xc90,0x38d,0x39c,0x39c,0x38d,0x38d,0x38d, +0x38d,0x1b,0x1b,0x39c,0x39c,0x1b,0x1b,0x39f,0x39f,0x393,0xd83,0x1b,0x1b,0x1b,0x1b,0x1b, +0x1b,0x1b,0x1b,0x38d,0x1b,0x1b,0x1b,0x1b,0x3a5,0x3a5,0x1b,0x3a5,0x3a2,0x3a2,0x38d,0x38d, +0x1b,0x1b,0x91e,0x91e,0x91e,0x91e,0x91e,0x91e,0x91e,0x91e,0x91e,0x91e,0x3a2,0x3a2,0x399,0x399, +0x396,0x396,0x396,0x396,0x396,0x399,0x396,0x110a,0x184b,0x1848,0x1b,0x1b,0x1e,0xc93,0x3a8,0xc96, +0x1e,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x1e,0x1e,0x1e,0x1e,0x3b4,0x3b4,0x1e,0x1e,0x3b4, +0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x1e,0x3b4,0x3b4, +0x3b4,0x3b4,0x3b4,0x3b4,0x3b4,0x1e,0x3b4,0x3b7,0x1e,0x3b4,0x3b7,0x1e,0x3b4,0x3b4,0x1e,0x1e, +0x3ab,0x1e,0x3b1,0x3b1,0x3b1,0x3a8,0x3a8,0x1e,0x1e,0x1e,0x1e,0x3a8,0x3a8,0x1e,0x1e,0x3a8, +0x3a8,0x3ae,0x1e,0x1e,0x1e,0xf66,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x3b7,0x3b7,0x3b7, +0x3b4,0x1e,0x3b7,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x921,0x921,0x921,0x921,0x921,0x921, +0x921,0x921,0x921,0x921,0x3a8,0x3a8,0x3b4,0x3b4,0x3b4,0xf66,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e, +0x1e,0x1e,0x1e,0x1e,0x21,0x3ba,0x3ba,0x3c3,0x21,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6, +0xc9f,0x3c6,0x21,0x3c6,0x3c6,0x3c6,0x21,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6, +0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x21,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x21,0x3c6,0x3c6, +0x21,0x3c6,0x3c6,0x3c6,0x3c6,0x3c6,0x21,0x21,0x3bd,0x3c6,0x3c3,0x3c3,0x3c3,0x3ba,0x3ba,0x3ba, +0x3ba,0x3ba,0x21,0x3ba,0x3ba,0x3c3,0x21,0x3c3,0x3c3,0x3c0,0x21,0x21,0x3c6,0x21,0x21,0x21, +0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x3c6,0xc9f,0xc99,0xc99, +0x21,0x21,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x924,0x13c8,0xc9c,0x21,0x21, +0x21,0x21,0x21,0x21,0x21,0x16ce,0x184e,0x184e,0x184e,0x1851,0x1851,0x1851,0x24,0x3c9,0x3d8,0x3d8, +0x24,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x24,0x24,0x3de,0x3de,0x24,0x24,0x3de, +0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x3de,0x24,0x3de,0x3de, +0x3de,0x3de,0x3de,0x3de,0x3de,0x24,0x3de,0x3de,0x24,0xca2,0x3de,0x3de,0x3de,0x3de,0x24,0x24, +0x3cc,0x3de,0x3c9,0x3c9,0x3d8,0x3c9,0x3c9,0x3c9,0xf69,0x24,0x24,0x3d8,0x3db,0x24,0x24,0x3db, +0x3db,0x3cf,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x3c9,0x3c9,0x24,0x24,0x24,0x24, +0x3e1,0x3e1,0x24,0x3de,0x3de,0x3de,0xf69,0xf69,0x24,0x24,0x3d5,0x3d5,0x3d5,0x3d5,0x3d5,0x3d5, +0x3d5,0x3d5,0x3d5,0x3d5,0x3d2,0xca2,0x12e1,0x12e1,0x12e1,0x12e1,0x12e1,0x12e1,0x24,0x24,0x24,0x24, +0x24,0x24,0x24,0x24,0x27,0x27,0x3e4,0x3f0,0x27,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0,0x27, +0x27,0x27,0x3f0,0x3f0,0x3f0,0x27,0x3f0,0x3f0,0x3f3,0x3f0,0x27,0x27,0x27,0x3f0,0x3f0,0x27, +0x3f0,0x27,0x3f0,0x3f0,0x27,0x27,0x27,0x3f0,0x3f0,0x27,0x27,0x27,0x3f0,0x3f0,0x92d,0x27, +0x27,0x27,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0,0x3f0,0x92d,0xd86,0x3f0,0x3f0,0x3f0,0x27,0x27, +0x27,0x27,0x3e4,0x3ea,0x3e4,0x3ea,0x3ea,0x27,0x27,0x27,0x3ea,0x3ea,0x3ea,0x27,0x3ed,0x3ed, +0x3ed,0x3e7,0x27,0x27,0xf6c,0x27,0x27,0x27,0x27,0x27,0x27,0x3e4,0x27,0x27,0x27,0x27, +0x27,0x27,0x27,0x27,0x27,0x27,0xea0,0x92a,0x92a,0x92a,0x92a,0x92a,0x92a,0x92a,0x92a,0x92a, +0x927,0x927,0x927,0xca5,0xca5,0xca5,0xca5,0xca5,0xca5,0xca8,0xca5,0x27,0x27,0x27,0x27,0x27, +0x14b5,0x402,0x402,0x402,0x2a,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x2a,0x405,0x405, +0x405,0x2a,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405, +0x405,0x2a,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x14b8,0x405,0x405,0x405, +0x405,0x405,0x2a,0x2a,0x2a,0xf75,0x3f6,0x3f6,0x3f6,0x402,0x402,0x402,0x402,0x2a,0x3f6,0x3f6, +0x3f9,0x2a,0x3f6,0x3f6,0x3f6,0x3fc,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x3f6,0x3f6,0x2a, +0xf75,0xf75,0x16d1,0x2a,0x2a,0x2a,0x2a,0x2a,0x405,0x405,0xf6f,0xf6f,0x2a,0x2a,0x3ff,0x3ff, +0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x3ff,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a, +0xf72,0xf72,0xf72,0xf72,0xf72,0xf72,0xf72,0xf72,0x178e,0x14bb,0x411,0x411,0x2d,0x417,0x417,0x417, +0x417,0x417,0x417,0x417,0x417,0x2d,0x417,0x417,0x417,0x2d,0x417,0x417,0x417,0x417,0x417,0x417, +0x417,0x417,0x417,0x417,0x417,0x417,0x417,0x417,0x417,0x2d,0x417,0x417,0x417,0x417,0x417,0x417, +0x417,0x417,0x417,0x417,0x2d,0x417,0x417,0x417,0x417,0x417,0x2d,0x2d,0xcab,0xcae,0x411,0x408, +0x414,0x411,0x408,0x411,0x411,0x2d,0x408,0x414,0x414,0x2d,0x414,0x414,0x408,0x40b,0x2d,0x2d, +0x2d,0x2d,0x2d,0x2d,0x2d,0x408,0x408,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x417,0x2d, +0x417,0x417,0xeb8,0xeb8,0x2d,0x2d,0x40e,0x40e,0x40e,0x40e,0x40e,0x40e,0x40e,0x40e,0x40e,0x40e, +0x2d,0xebb,0xebb,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, +0x1854,0x14be,0x423,0x423,0x30,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x30,0x429,0x429, +0x429,0x30,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429, +0x423,0x41a,0x41a,0x41a,0xf78,0x30,0x423,0x423,0x423,0x30,0x426,0x426,0x426,0x41d,0x12e7,0x1791, +0x30,0x30,0x30,0x30,0x1794,0x1794,0x1794,0x41a,0x1791,0x1791,0x1791,0x1791,0x1791,0x1791,0x1791,0x16d4, +0x429,0x429,0xf78,0xf78,0x30,0x30,0x420,0x420,0x420,0x420,0x420,0x420,0x420,0x420,0x420,0x420, +0xf7b,0xf7b,0xf7b,0xf7b,0xf7b,0xf7b,0x1791,0x1791,0x1791,0xf7e,0xf81,0xf81,0xf81,0xf81,0xf81,0xf81, +0x33,0x33,0x9f6,0x9f6,0x33,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc, +0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x33,0x33,0x33,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc, +0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x33,0x9fc, +0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x9fc,0x33,0x9fc,0x33,0x33,0x9fc,0x9fc,0x9fc,0x9fc, +0x9fc,0x9fc,0x9fc,0x33,0x33,0x33,0x9f0,0x33,0x33,0x33,0x33,0x9ed,0x9f6,0x9f6,0x9ed,0x9ed, +0x9ed,0x33,0x9ed,0x33,0x9f6,0x9f6,0x9f9,0x9f6,0x9f9,0x9f9,0x9f9,0x9ed,0x33,0x33,0x33,0x33, +0x33,0x33,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x33,0x33,0x9f6,0x9f6, +0x9f3,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x36,0x444,0x444,0x444, +0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444, +0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x444,0x42f,0x444,0x441, +0x42f,0x42f,0x42f,0x42f,0x42f,0x42f,0x435,0x36,0x36,0x36,0x36,0x42c,0x44a,0x44a,0x44a,0x44a, +0x44a,0x444,0x447,0x432,0x432,0x432,0x432,0x432,0x432,0x42f,0x432,0x438,0x43e,0x43e,0x43e,0x43e, +0x43e,0x43e,0x43e,0x43e,0x43e,0x43e,0x43b,0x43b,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x39,0x44a,0x44a,0x39, -0x44a,0x39,0x39,0x44a,0x44a,0x39,0x44a,0x39,0x39,0x44a,0x39,0x39,0x39,0x39,0x39,0x39, -0x44a,0x44a,0x44a,0x44a,0x39,0x44a,0x44a,0x44a,0x44a,0x44a,0x44a,0x44a,0x39,0x44a,0x44a,0x44a, -0x39,0x44a,0x39,0x44a,0x39,0x39,0x44a,0x44a,0x39,0x44a,0x44a,0x44a,0x44a,0x43e,0x44a,0x447, -0x43e,0x43e,0x43e,0x43e,0x43e,0x43e,0x39,0x43e,0x43e,0x44a,0x39,0x39,0x453,0x453,0x453,0x453, -0x453,0x39,0x450,0x39,0x441,0x441,0x441,0x441,0x441,0x43e,0x39,0x39,0x444,0x444,0x444,0x444, -0x444,0x444,0x444,0x444,0x444,0x444,0x39,0x39,0x44d,0x44d,0x13b6,0x13b6,0x39,0x39,0x39,0x39, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x39,0x459,0x459,0x39,0x459,0x39,0x39,0x459, +0x459,0x39,0x459,0x39,0x39,0x459,0x39,0x39,0x39,0x39,0x39,0x39,0x459,0x459,0x459,0x459, +0x39,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x39,0x459,0x459,0x459,0x39,0x459,0x39,0x459, +0x39,0x39,0x459,0x459,0x39,0x459,0x459,0x459,0x459,0x44d,0x459,0x456,0x44d,0x44d,0x44d,0x44d, +0x44d,0x44d,0x39,0x44d,0x44d,0x459,0x39,0x39,0x462,0x462,0x462,0x462,0x462,0x39,0x45f,0x39, +0x450,0x450,0x450,0x450,0x450,0x44d,0x39,0x39,0x453,0x453,0x453,0x453,0x453,0x453,0x453,0x453, +0x453,0x453,0x39,0x39,0x45c,0x45c,0x13cb,0x13cb,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39, 0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39, -0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x95d,0x95d,0x95d,0x960, -0x95d,0x95d,0x95d,0x95d,0x3c,0x95d,0x95d,0x95d,0x95d,0x960,0x95d,0x95d,0x95d,0x95d,0x960,0x95d, -0x95d,0x95d,0x95d,0x960,0x95d,0x95d,0x95d,0x95d,0x960,0x95d,0x95d,0x95d,0x95d,0x95d,0x95d,0x95d, -0x95d,0x95d,0x95d,0x95d,0x95d,0x960,0x9f9,0xf78,0xf78,0x3c,0x3c,0x3c,0x3c,0x92a,0x92a,0x92d, -0x92a,0x92d,0x92d,0x936,0x92d,0x936,0x92a,0x92a,0x92a,0x92a,0x92a,0x957,0x92a,0x92d,0x930,0x930, -0x933,0x93c,0x930,0x930,0x95d,0x95d,0x95d,0x95d,0x12db,0x12d5,0x12d5,0x12d5,0x92a,0x92a,0x92a,0x92d, -0x92a,0x92a,0x9ed,0x92a,0x3c,0x92a,0x92a,0x92a,0x92a,0x92d,0x92a,0x92a,0x92a,0x92a,0x92d,0x92a, -0x92a,0x92a,0x92a,0x92d,0x92a,0x92a,0x92a,0x92a,0x92d,0x92a,0x9ed,0x9ed,0x9ed,0x92a,0x92a,0x92a, -0x92a,0x92a,0x92a,0x92a,0x9ed,0x92d,0x9ed,0x9ed,0x9ed,0x3c,0x9f6,0x9f6,0x9f3,0x9f3,0x9f3,0x9f3, -0x9f3,0x9f3,0x9f0,0x9f3,0x9f3,0x9f3,0x9f3,0x9f3,0x9f3,0x3c,0xf6f,0x9f3,0xd77,0xd77,0xf72,0xf75, -0xf6f,0x10f8,0x10f8,0x10f8,0x10f8,0x12d8,0x12d8,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c, +0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x96f,0x96f,0x96f,0x972,0x96f,0x96f,0x96f,0x96f, +0x3c,0x96f,0x96f,0x96f,0x96f,0x972,0x96f,0x96f,0x96f,0x96f,0x972,0x96f,0x96f,0x96f,0x96f,0x972, +0x96f,0x96f,0x96f,0x96f,0x972,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f, +0x96f,0x972,0xa0b,0xf8d,0xf8d,0x3c,0x3c,0x3c,0x3c,0x93c,0x93c,0x93f,0x93c,0x93f,0x93f,0x948, +0x93f,0x948,0x93c,0x93c,0x93c,0x93c,0x93c,0x969,0x93c,0x93f,0x942,0x942,0x945,0x94e,0x942,0x942, +0x96f,0x96f,0x96f,0x96f,0x12f0,0x12ea,0x12ea,0x12ea,0x93c,0x93c,0x93c,0x93f,0x93c,0x93c,0x9ff,0x93c, +0x3c,0x93c,0x93c,0x93c,0x93c,0x93f,0x93c,0x93c,0x93c,0x93c,0x93f,0x93c,0x93c,0x93c,0x93c,0x93f, +0x93c,0x93c,0x93c,0x93c,0x93f,0x93c,0x9ff,0x9ff,0x9ff,0x93c,0x93c,0x93c,0x93c,0x93c,0x93c,0x93c, +0x9ff,0x93f,0x9ff,0x9ff,0x9ff,0x3c,0xa08,0xa08,0xa05,0xa05,0xa05,0xa05,0xa05,0xa05,0xa02,0xa05, +0xa05,0xa05,0xa05,0xa05,0xa05,0x3c,0xf84,0xa05,0xd89,0xd89,0xf87,0xf8a,0xf84,0x110d,0x110d,0x110d, +0x110d,0x12ed,0x12ed,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c, 0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c, -0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x459,0x459,0x459,0x459,0x459,0x459,0x3f,0x13bc, -0x3f,0x3f,0x3f,0x3f,0x3f,0x13bc,0x3f,0x3f,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456, -0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xd86, -0xa23,0x42,0xa23,0xa23,0xa23,0xa23,0x42,0x42,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0x42, -0xa23,0x42,0xa23,0xa23,0xa23,0xa23,0x42,0x42,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xd86, -0xa23,0x42,0xa23,0xa23,0xa23,0xa23,0x42,0x42,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xd86,0xa23,0x42,0xa23,0xa23, -0xa23,0xa23,0x42,0x42,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0x42,0xa23,0x42,0xa23,0xa23, -0xa23,0xa23,0x42,0x42,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xd86,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0x42,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xd86,0xa23,0x42,0xa23,0xa23,0xa23,0xa23,0x42,0x42,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xd86,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0x42,0x42,0x12de,0x12de,0xd80,0xd83,0xa1d,0xa26,0xa1a, -0xa1a,0xa1a,0xa1a,0xa26,0xa26,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa17,0xa17, -0xa17,0xa17,0xa17,0xa17,0xa17,0xa17,0xa17,0xa17,0xa17,0x42,0x42,0x42,0xa29,0xa29,0xa29,0xa29, -0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29, -0xa29,0x16c5,0x45,0x45,0x16c2,0x16c2,0x16c2,0x16c2,0x16c2,0x16c2,0x45,0x45,0xa3b,0xa3e,0xa3e,0xa3e, -0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e, -0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa3e,0xa38,0xa35,0x48,0x48,0x48,0xa44,0xa44,0xa44,0xa44, -0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa41,0xa41,0xa41,0xa44,0xa44,0xa44,0x14af,0x14af,0x14af, -0x14af,0x14af,0x14af,0x14af,0x14af,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0xa65,0xa65,0xa65,0xa65, -0xa65,0xa65,0xa47,0xa65,0xa65,0xa4a,0xa4a,0xa4a,0xa4a,0xa4a,0xa4a,0xa4a,0xa4a,0xa4a,0xa4d,0xa4a, -0xa5c,0xa5c,0xa5f,0xa68,0xa56,0xa53,0xa5c,0xa59,0xa68,0xc9f,0x4e,0x4e,0xa62,0xa62,0xa62,0xa62, -0xa62,0xa62,0xa62,0xa62,0xa62,0xa62,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0xca2,0xca2,0xca2,0xca2, -0xca2,0xca2,0xca2,0xca2,0xca2,0xca2,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0xa77,0xa77,0xaf5,0xaf8, -0xa7d,0xaf2,0xa7a,0xa77,0xa80,0xa8f,0xa83,0xa92,0xa92,0xa92,0xa6e,0x51,0xa86,0xa86,0xa86,0xa86, -0xa86,0xa86,0xa86,0xa86,0xa86,0xa86,0x51,0x51,0x51,0x51,0x51,0x51,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0xa89,0xa71,0xf99,0x51,0x51,0x51,0x51,0x51,0x114c,0x114c,0x114c,0x114c, -0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x477,0x477,0x477,0x477, -0x477,0x477,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x477,0x477,0x477,0x477, -0x477,0x477,0x54,0x54,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x54,0x54,0x477,0x477,0x477,0x477, -0x477,0x477,0x477,0x477,0x54,0x47a,0x54,0x47a,0x54,0x47a,0x54,0x47a,0x477,0x477,0x477,0x477, -0x477,0x477,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x477,0x477,0x477,0x477, -0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x54,0x54,0x477,0x477,0x477,0x477, -0x477,0x477,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x47a,0x477,0x477,0x477,0x477, -0x477,0x54,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x471,0x477,0x471,0x471,0x46e,0x477,0x477, -0x477,0x54,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x46e,0x46e,0x46e,0x477,0x477,0x477,0x477, -0x54,0x54,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x54,0x46e,0x46e,0x46e,0x477,0x477,0x477,0x477, -0x477,0x477,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x46e,0x46e,0x46e,0x54,0x54,0x477,0x477, -0x477,0x54,0x477,0x477,0x47a,0x47a,0x47a,0x47a,0x47a,0x474,0x471,0x54,0xb6a,0xb6d,0xb6d,0xb6d, -0xfa2,0x57,0x148e,0x148e,0x148e,0x148e,0x483,0x483,0x483,0x483,0x483,0x483,0x4ce,0xb7f,0x5a,0x5a, -0x68a,0x4ce,0x4ce,0x4ce,0x4ce,0x4ce,0x4d4,0x4e6,0x4d4,0x4e0,0x4da,0x68d,0x4cb,0x687,0x687,0x687, -0x687,0x4cb,0x4cb,0x4cb,0x4cb,0x4cb,0x4d1,0x4e3,0x4d1,0x4dd,0x4d7,0x5a,0xd8f,0xd8f,0xd8f,0xd8f, -0xd8f,0x12e1,0x12e1,0x12e1,0x12e1,0x12e1,0x12e1,0x12e1,0x12e1,0x5a,0x5a,0x5a,0x4ec,0x4ec,0x4ec,0x4ec, -0x4ec,0x4ec,0x4ec,0x4e9,0x4ef,0x702,0x4ec,0x966,0x987,0xaa1,0xaa1,0xaa1,0xb82,0xb82,0xd92,0xd92, -0xd92,0xd92,0x1110,0x1113,0x1113,0x12e4,0x1488,0x14b2,0x14b5,0x14b5,0x16c8,0x5d,0x5d,0x5d,0x5d,0x5d, -0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x4f5,0x4f5,0x4f5,0x4f5, -0x4f5,0x4f5,0x4f5,0x4f5,0x4f5,0x4f5,0x4f5,0x4f5,0x4f5,0x4f2,0x4f2,0x4f2,0x4f2,0x4f5,0xaa4,0xaa4, -0xb85,0xb8b,0xb8b,0xb88,0xb88,0xb88,0xb88,0xd95,0xea9,0xea9,0xea9,0xea9,0x10e3,0x60,0x60,0x60, -0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x525,0x525,0x525,0xaad, -0xeb2,0xfa8,0xfa8,0xfa8,0xfa8,0x123f,0x16cb,0x16cb,0x63,0x63,0x63,0x63,0x6b4,0x6b4,0x6b4,0x6b4, -0x6b7,0x6b7,0x6b7,0x6b7,0x6b7,0x6b7,0x531,0x531,0x52e,0x52e,0x52e,0x52e,0xeb8,0xeb8,0xeb8,0xeb5, -0xeb5,0xeb5,0xeb5,0xeb5,0x1119,0x1365,0x1365,0x1365,0x1365,0x12e7,0x12e7,0x12e7,0x1368,0x12ea,0x12ea,0x1368, -0x14b8,0x14b8,0x14b8,0x14b8,0x14bb,0x14bb,0x14bb,0x1782,0x1782,0x1782,0x1782,0x66,0x558,0x558,0x558,0x558, -0x558,0xab6,0xab6,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69, -0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x55b,0x55b,0x55b,0x55b, -0x55b,0x55b,0x55b,0x55b,0x55b,0x55b,0x55b,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c, -0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0xad1,0xad1,0xad1,0xad1, -0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1, -0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0x6f,0xad1,0xad1,0xad1,0xad1,0xad4,0xad1,0xad1,0xad1,0xad1, -0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad4, -0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0xad7,0xad7,0xad7,0xad7, -0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7, -0xad7,0xad7,0x72,0x72,0x72,0x72,0x72,0x72,0x72,0x72,0x72,0x72,0x78,0x7e9,0x7e3,0x7e9, -0x7e3,0x7e9,0x7e3,0x7e9,0x7e3,0x7e9,0x7e3,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3, -0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e3,0x7e3,0x7e3,0x7e9, -0x7e3,0x7e9,0x7e3,0x7e9,0x7e3,0x7e3,0x7e3,0x7e3,0x7e3,0x7e3,0x7e9,0x7e3,0x7e3,0x7e3,0x7e3,0x7e3, -0x7e6,0xc2d,0xc2d,0x78,0x78,0x8fd,0x8fd,0x8c7,0x8c7,0x7ec,0x7ef,0xc2a,0x7b,0x7b,0x7b,0x7b, -0x7b,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801, -0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x10d1,0x7b,0x7b, -0x7e,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804, -0x804,0x804,0x804,0x7e,0x8d0,0x8d0,0x8d3,0x8d3,0x8d3,0x8d3,0x8d3,0x8d3,0x8d3,0x8d3,0x8d3,0x8d3, -0x8d3,0x8d3,0x8d3,0x8d3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3, -0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0x1374,0x1374,0x1374,0x81, -0x81,0x81,0x81,0x81,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d, -0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d,0x80d, -0x80d,0xd2f,0xd2f,0x84,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813, +0x3c,0x3c,0x3c,0x3c,0x468,0x468,0x468,0x468,0x468,0x468,0x3f,0x13d1,0x3f,0x3f,0x3f,0x3f, +0x3f,0x13d1,0x3f,0x3f,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465, +0x465,0x465,0x465,0x465,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98,0xa35,0x42,0xa35,0xa35, +0xa35,0xa35,0x42,0x42,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0x42,0xa35,0x42,0xa35,0xa35, +0xa35,0xa35,0x42,0x42,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98,0xa35,0x42,0xa35,0xa35, +0xa35,0xa35,0x42,0x42,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98,0xa35,0x42,0xa35,0xa35,0xa35,0xa35,0x42,0x42, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0x42,0xa35,0x42,0xa35,0xa35,0xa35,0xa35,0x42,0x42, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0x42, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98, +0xa35,0x42,0xa35,0xa35,0xa35,0xa35,0x42,0x42,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35, +0xa35,0xa35,0xa35,0x42,0x42,0x12f3,0x12f3,0xd92,0xd95,0xa2f,0xa38,0xa2c,0xa2c,0xa2c,0xa2c,0xa38, +0xa38,0xa32,0xa32,0xa32,0xa32,0xa32,0xa32,0xa32,0xa32,0xa32,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29, +0xa29,0xa29,0xa29,0xa29,0xa29,0x42,0x42,0x42,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b, +0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0x16da,0x45,0x45, +0x16d7,0x16d7,0x16d7,0x16d7,0x16d7,0x16d7,0x45,0x45,0xa4d,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50, +0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50,0xa50, +0xa50,0xa50,0xa50,0xa4a,0xa47,0x48,0x48,0x48,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56, +0xa56,0xa56,0xa56,0xa53,0xa53,0xa53,0xa56,0xa56,0xa56,0x14c4,0x14c4,0x14c4,0x14c4,0x14c4,0x14c4,0x14c4, +0x14c4,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0xa77,0xa77,0xa77,0xa77,0xa77,0xa77,0xa59,0xa77, +0xa77,0xa5c,0xa5c,0xa5c,0xa5c,0xa5c,0xa5c,0xa5c,0xa5c,0xa5c,0xa5f,0xa5c,0xa6e,0xa6e,0xa71,0xa7a, +0xa68,0xa65,0xa6e,0xa6b,0xa7a,0xcb1,0x4e,0x4e,0xa74,0xa74,0xa74,0xa74,0xa74,0xa74,0xa74,0xa74, +0xa74,0xa74,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0xcb4,0xcb4,0xcb4,0xcb4,0xcb4,0xcb4,0xcb4,0xcb4, +0xcb4,0xcb4,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0xa89,0xa89,0xb07,0xb0a,0xa8f,0xb04,0xa8c,0xa89, +0xa92,0xaa1,0xa95,0xaa4,0xaa4,0xaa4,0xa80,0x51,0xa98,0xa98,0xa98,0xa98,0xa98,0xa98,0xa98,0xa98, +0xa98,0xa98,0x51,0x51,0x51,0x51,0x51,0x51,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa83,0xfae,0x51,0x51,0x51,0x51,0x51,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161, +0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x486,0x486,0x486,0x486,0x486,0x486,0x54,0x54, +0x489,0x489,0x489,0x489,0x489,0x489,0x54,0x54,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486, +0x54,0x489,0x54,0x489,0x54,0x489,0x54,0x489,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486, +0x486,0x486,0x486,0x486,0x486,0x486,0x54,0x54,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x489,0x486,0x486,0x486,0x486,0x486,0x54,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x480,0x486,0x480,0x480,0x47d,0x486,0x486,0x486,0x54,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x47d,0x47d,0x47d,0x486,0x486,0x486,0x486,0x54,0x54,0x486,0x486, +0x489,0x489,0x489,0x489,0x54,0x47d,0x47d,0x47d,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x47d,0x47d,0x47d,0x54,0x54,0x486,0x486,0x486,0x54,0x486,0x486, +0x489,0x489,0x489,0x489,0x489,0x483,0x480,0x54,0xb7c,0xb7f,0xb7f,0xb7f,0xfb7,0x57,0x14a0,0x14a0, +0x14a0,0x14a0,0x492,0x492,0x492,0x492,0x492,0x492,0x4dd,0xb91,0x5a,0x5a,0x699,0x4dd,0x4dd,0x4dd, +0x4dd,0x4dd,0x4e3,0x4f5,0x4e3,0x4ef,0x4e9,0x69c,0x4da,0x696,0x696,0x696,0x696,0x4da,0x4da,0x4da, +0x4da,0x4da,0x4e0,0x4f2,0x4e0,0x4ec,0x4e6,0x5a,0xda1,0xda1,0xda1,0xda1,0xda1,0x12f6,0x12f6,0x12f6, +0x12f6,0x12f6,0x12f6,0x12f6,0x12f6,0x5a,0x5a,0x5a,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d, +0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x5d,0x504,0x504,0x504,0x504,0x504,0x504,0x504,0x504, +0x504,0x504,0x504,0x504,0x504,0x501,0x501,0x501,0x501,0x504,0xab6,0xab6,0xb97,0xb9d,0xb9d,0xb9a, +0xb9a,0xb9a,0xb9a,0xda7,0xebe,0xebe,0xebe,0xebe,0x10f8,0x60,0x60,0x60,0x60,0x60,0x60,0x60, +0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x534,0x534,0x534,0xabf,0xec7,0xfbd,0xfbd,0xfbd, +0xfbd,0x1254,0x16e0,0x16e0,0x63,0x63,0x63,0x63,0x6c3,0x6c3,0x6c3,0x6c3,0x6c6,0x6c6,0x6c6,0x6c6, +0x6c6,0x6c6,0x540,0x540,0x53d,0x53d,0x53d,0x53d,0x567,0x567,0x567,0x567,0x567,0xac8,0xac8,0x66, +0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66, +0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a, +0x56a,0x56a,0x56a,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69, +0x69,0x69,0x69,0x69,0x69,0x69,0x69,0x69,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3, +0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3, +0xae3,0xae3,0x6c,0xae3,0xae3,0xae3,0xae3,0xae6,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3, +0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae6,0x6c,0x6c,0x6c,0x6c, +0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9, +0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0x6f,0x6f, +0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x6f,0x75,0x7ef,0x7e9,0x7ef,0x7e9,0x7ef,0x7e9,0x7ef, +0x7e9,0x7ef,0x7e9,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9, +0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7e9,0x7e9,0x7e9,0x7ef,0x7e9,0x7ef,0x7e9,0x7ef, +0x7e9,0x7e9,0x7e9,0x7e9,0x7e9,0x7e9,0x7ef,0x7e9,0x7e9,0x7e9,0x7e9,0x7e9,0x7ec,0xc3f,0xc3f,0x75, +0x75,0x90f,0x90f,0x8d9,0x8d9,0x7f2,0x7f5,0xc3c,0x78,0x78,0x78,0x78,0x78,0x807,0x807,0x807, +0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807, +0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x807,0x10e6,0x18c3,0x78,0x7b,0x80a,0x80a,0x80a, +0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x7b, +0x8e2,0x8e2,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5,0x8e5, +0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5, +0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0xaf5,0x1389,0x1389,0x1389,0x7e,0x7e,0x7e,0x7e,0x7e, 0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813, -0x813,0x813,0x813,0x84,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9, -0xae9,0x87,0x87,0x87,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef, -0xaef,0xaef,0xaef,0xaef,0xaef,0xc36,0xaef,0xaef,0xaef,0xc36,0xaef,0x8a,0x8a,0x8a,0x8a,0x8a, -0x8a,0x8a,0x8a,0x8a,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173, -0x1173,0x1173,0x1173,0x1173,0x981,0x981,0x981,0x981,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d, -0x8d,0x8d,0x8d,0x8d,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8, -0x11e8,0x11e8,0x11e8,0x11e8,0x5b5,0x5b5,0x5b5,0x5b5,0x5b5,0x5b5,0x5b5,0x90,0x90,0x90,0x90,0x90, -0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x5a3,0x5a3,0x5a3,0x5a3,0x5a3,0x90,0x90,0x90,0x90, -0x90,0xac2,0x5a6,0x5ac,0x5b2,0x5b2,0x5b2,0x5b2,0x5b2,0x5b2,0x5b2,0x5b2,0x5b2,0x5a9,0x5ac,0x5ac, -0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x90,0x5ac,0x5ac,0x5ac,0x5ac, -0x5ac,0x90,0x5ac,0x90,0x5ac,0x5ac,0x90,0x5ac,0x5ac,0x90,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac,0x5ac, -0x5ac,0x5ac,0x5ac,0x5af,0x5c7,0x5c1,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1, -0x5c4,0x5ca,0x5c7,0x5c1,0x12f3,0x12f3,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7, -0x5c1,0x5c7,0x5c7,0x5c1,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0x5c4,0x5c1,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c1,0x5c4,0x5c1,0x5c1, -0x5c4,0x5c4,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c1,0x5c1,0x5c4,0x5c1,0x5c4,0x5c4,0x5c4,0x5c1, -0x5c4,0x5c4,0x5c4,0x5c4,0x93,0x93,0x5c4,0x5c4,0x5c4,0x5c4,0x5c1,0x5c1,0x5c4,0x5c1,0x5c1,0x5c1, -0x5c1,0x5c4,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c4,0x5c4,0x5c1,0x5c1,0x93,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a,0xb0a, -0xb0a,0xb0a,0xb0a,0xb0a,0x5c7,0x5c7,0x91e,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5be,0x5be, -0xbc1,0xd47,0x93,0x93,0x825,0x837,0x834,0x837,0x834,0xc4b,0xc4b,0xd3b,0xd38,0x828,0x828,0x828, -0x828,0x83a,0x83a,0x83a,0x852,0x855,0x864,0x96,0x858,0x85b,0x867,0x867,0x84f,0x846,0x840,0x846, -0x840,0x846,0x840,0x843,0x843,0x85e,0x85e,0x861,0x85e,0x85e,0x85e,0x96,0x85e,0x84c,0x849,0x843, -0x96,0x96,0x96,0x96,0x5d3,0x5df,0x5d3,0xbc4,0x5d3,0x99,0x5d3,0x5df,0x5d3,0x5df,0x5d3,0x5df, -0x5d3,0x5df,0x5d3,0x5df,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9, -0x5df,0x5dc,0x5d6,0x5dc,0x5d6,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5dc,0x5d6,0x5dc,0x5d6,0x5dc, -0x5d6,0x99,0x99,0x5d0,0x723,0x726,0x73b,0x73e,0x71d,0x726,0x726,0x9f,0x705,0x708,0x708,0x708, -0x708,0x705,0x705,0x9f,0x9c,0x9c,0x9c,0x9c,0x9c,0x9c,0x9c,0x9c,0x9c,0xac5,0xac5,0xac5, -0x984,0x6ff,0x5e2,0x5e2,0x9f,0x74d,0x72c,0x71d,0x726,0x723,0x71d,0x72f,0x720,0x71a,0x71d,0x73b, -0x732,0x729,0x74a,0x71d,0x747,0x747,0x747,0x747,0x747,0x747,0x747,0x747,0x747,0x747,0x738,0x735, -0x73b,0x73b,0x73b,0x74d,0x70e,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b, -0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b, -0x70b,0x70b,0x70b,0x9f,0x9f,0x9f,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x9f,0x9f,0x70b,0x70b, -0x70b,0x70b,0x70b,0x70b,0x9f,0x9f,0x70b,0x70b,0x70b,0x70b,0x70b,0x70b,0x9f,0x9f,0x70b,0x70b, -0x70b,0x9f,0x9f,0x9f,0xb0d,0xb0d,0xb0d,0xb0d,0xa2,0xa2,0xa2,0xa2,0xa2,0xa2,0xa2,0xa2, -0xa2,0xa2,0xa2,0xa2,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13, -0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xa5,0xa5,0xa5,0xa5,0xa5,0x161a,0x161a,0x161a,0x161a, -0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0xb1c,0xb1c,0xb1c,0xb1c, +0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0xd41,0xd41,0x81, +0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819, +0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x81, +0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0x84,0x84,0x84, +0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01, +0xb01,0xc48,0xb01,0xb01,0xb01,0xc48,0xb01,0x87,0x87,0x87,0x87,0x87,0x87,0x87,0x87,0x87, +0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188, +0x993,0x993,0x993,0x993,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a, +0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd, +0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d,0x8d, +0x8d,0x8d,0x8d,0x5b2,0x5b2,0x5b2,0x5b2,0x5b2,0x8d,0x8d,0x8d,0x8d,0x8d,0xad4,0x5b5,0x5bb, +0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5b8,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb, +0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x8d,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x8d,0x5bb,0x8d, +0x5bb,0x5bb,0x8d,0x5bb,0x5bb,0x8d,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5bb,0x5be, +0x5d6,0x5d0,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0, +0x1308,0x1308,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, +0x90,0x90,0x90,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d6,0x5d0, +0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, +0x5d3,0x5d0,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d0,0x5d3,0x5d0,0x5d0,0x5d3,0x5d3,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d3,0x5d0,0x5d0,0x5d3,0x5d0,0x5d3,0x5d3,0x5d3,0x5d0,0x5d3,0x5d3,0x5d3,0x5d3, +0x90,0x90,0x5d3,0x5d3,0x5d3,0x5d3,0x5d0,0x5d0,0x5d3,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d3,0x5d3,0x5d3,0x5d0,0x5d0,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, 0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c, -0xb1c,0xb1c,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xab,0xab,0xfb4,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0x16d1,0x16d1,0x16d1,0x16d1, -0x16d1,0x16d1,0x16d1,0x16d1,0x16d1,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab, -0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xae,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xb40,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xae,0xb40,0xb40,0xae,0xae,0xb40,0xae, -0xae,0xb40,0xb40,0xae,0xae,0xb40,0xb40,0xb40,0xb40,0xae,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb3d,0xb3d,0xb3d,0xb3d,0xae,0xb3d,0xae,0xb3d,0xb3d,0xb3d,0xb3d,0xcc0,0xb3d,0xb3d, -0xae,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb3d,0xb3d,0xb3d,0xb3d, -0xb40,0xb40,0xae,0xb40,0xb40,0xb40,0xb40,0xae,0xae,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xae,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xae,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xb40,0xae,0xb40,0xb40,0xb40,0xb40,0xae,0xb40,0xb40,0xb40,0xb40, -0xb40,0xae,0xb40,0xae,0xae,0xae,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xae,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xdaa,0xdaa,0xae,0xae, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb3d,0xb3d,0xb3d,0xb37,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xec1,0xebe,0xae,0xae,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, -0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb1,0xb46,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, -0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xbd3,0xbd3,0xbd3,0xbd3,0xbd3,0xbd3,0xbd3,0xbd3, -0xbd3,0xbd3,0xbd3,0xbd3,0xbd3,0xb4,0xbd3,0xbd3,0xbd3,0xbd3,0xbcd,0xbcd,0xbd0,0xb4,0xb4,0xb4, -0xb4,0xb4,0xb4,0xb4,0xb4,0xb4,0xb4,0xb4,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc, -0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbdc,0xbd6,0xbd6,0xbd9,0xc3f,0xc3f,0xb7, -0xb7,0xb7,0xb7,0xb7,0xb7,0xb7,0xb7,0xb7,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2, -0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbe2,0xbdf,0xbdf,0xba,0xba,0xba,0xba, -0xba,0xba,0xba,0xba,0xba,0xba,0xba,0xba,0xbe8,0xbe8,0xbe8,0xbe8,0xbe8,0xbe8,0xbe8,0xbe8, -0xbe8,0xbe8,0xbe8,0xbe8,0xbe8,0xbd,0xbe8,0xbe8,0xbe8,0xbd,0xbe5,0xbe5,0xbd,0xbd,0xbd,0xbd, -0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2, -0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0xcd2, -0xcd2,0xcd2,0xcd2,0xcd2,0xcd2,0x14cd,0x14cd,0xc0,0xcc3,0xcc3,0xcc3,0xccf,0xccf,0xccf,0xccf,0xcc3, -0xcc3,0xccf,0xccf,0xccf,0xc0,0xc0,0xc0,0xc0,0xccf,0xccf,0xcc3,0xccf,0xccf,0xccf,0xccf,0xccf, -0xccf,0xcc6,0xcc6,0xcc6,0xc0,0xc0,0xc0,0xc0,0xcc9,0xc0,0xc0,0xc0,0xcd5,0xcd5,0xccc,0xccc, -0xccc,0xccc,0xccc,0xccc,0xccc,0xccc,0xccc,0xccc,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8, -0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xcd8,0xc3,0xc3,0xcd8,0xcd8,0xcd8,0xcd8, -0xcd8,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x14d0,0x14d0,0x14d0,0x14d0, -0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0, -0xc6,0xc6,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0, -0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0xc6,0xc6,0x14d0,0x14d0,0x14d0,0x14d0, -0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0, -0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0xc6,0xc6,0xc6,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0, -0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0xc6,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0x14d0,0xc6,0xc6, -0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x16d4,0x16d4,0x16d4,0x16d4, -0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6, -0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xc9,0xcff,0xcff,0xcff, -0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff, -0xcff,0xcff,0xcff,0xc9,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff, -0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xc9,0xcff,0xcff,0xc9,0xcff,0xcff,0xcff,0xcff,0xcff, -0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xc9,0xc9,0xcff,0xcff,0xcff,0xcff, -0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xcff,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9, -0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9, -0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xc9,0xd02,0xd02,0xd02,0xd02, -0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02, -0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xcc,0xcc,0xcc,0xcc,0xcc,0xd44,0xd44,0xd44,0xcf, -0xcf,0xcf,0xcf,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e, -0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xd3e,0xcf,0xcf,0xcf,0xd41, -0xd41,0xd41,0xd41,0xd41,0xd41,0xd41,0xd41,0xd41,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08, -0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08, -0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xd2,0xd05,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11, +0x5d6,0x5d6,0x930,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5cd,0x5cd,0xbd3,0xd59,0x90,0x90, +0x82b,0x83d,0x83a,0x83d,0x83a,0xc5d,0xc5d,0xd4d,0xd4a,0x82e,0x82e,0x82e,0x82e,0x840,0x840,0x840, +0x858,0x85b,0x86a,0x93,0x85e,0x861,0x86d,0x86d,0x855,0x84c,0x846,0x84c,0x846,0x84c,0x846,0x849, +0x849,0x864,0x864,0x867,0x864,0x864,0x864,0x93,0x864,0x852,0x84f,0x849,0x93,0x93,0x93,0x93, +0x5e2,0x5ee,0x5e2,0xbd6,0x5e2,0x96,0x5e2,0x5ee,0x5e2,0x5ee,0x5e2,0x5ee,0x5e2,0x5ee,0x5e2,0x5ee, +0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5eb, +0x5e5,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5eb,0x5e5,0x5eb,0x5e5,0x5eb,0x5e5,0x96,0x96,0x5df, +0x732,0x735,0x74a,0x74d,0x72c,0x735,0x735,0x9c,0x717,0x71a,0x71a,0x71a,0x71a,0x717,0x717,0x9c, +0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0xad7,0xad7,0xad7,0x996,0x711,0x5f1,0x5f1, +0x9c,0x75c,0x73b,0x72c,0x735,0x732,0x72c,0x73e,0x72f,0x729,0x72c,0x74a,0x741,0x738,0x759,0x72c, +0x756,0x756,0x756,0x756,0x756,0x756,0x756,0x756,0x756,0x756,0x747,0x744,0x74a,0x74a,0x74a,0x75c, +0x720,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d, +0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x9c, +0x9c,0x9c,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x9c,0x9c,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d, +0x9c,0x9c,0x71d,0x71d,0x71d,0x71d,0x71d,0x71d,0x9c,0x9c,0x71d,0x71d,0x71d,0x9c,0x9c,0x9c, +0xb1f,0xb1f,0xb1f,0xb1f,0x9f,0x9f,0x9f,0x9f,0x9f,0x9f,0x9f,0x9f,0x9f,0x1860,0x1860,0x1860, +0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25,0xb25, +0xb25,0xb25,0xb25,0xa2,0xa2,0xa2,0xa2,0xa2,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c, +0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e, +0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xa5,0xa5, +0xa5,0xa5,0xa5,0xa5,0xa5,0xa5,0xa5,0xa5,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xa8, +0xa8,0xfc9,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, +0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0x16e6,0x16e6,0x16e6,0x16e6,0x16e6,0x16e6,0x16e6,0x16e6, +0x16e6,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8, +0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xab,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xb52,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xab,0xb52,0xb52,0xab,0xab,0xb52,0xab,0xab,0xb52,0xb52,0xab, +0xab,0xb52,0xb52,0xb52,0xb52,0xab,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb4f,0xb4f, +0xb4f,0xb4f,0xab,0xb4f,0xab,0xb4f,0xb4f,0xb4f,0xb4f,0xcd2,0xb4f,0xb4f,0xab,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xb52,0xab,0xb52, +0xb52,0xb52,0xb52,0xab,0xab,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xab,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xab,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb52,0xb52,0xab,0xb52,0xb52,0xb52,0xb52,0xab,0xb52,0xb52,0xb52,0xb52,0xb52,0xab,0xb52,0xab, +0xab,0xab,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xab,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xdbf,0xdbf,0xab,0xab,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb4f,0xb4f,0xb4f,0xb49,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xed6,0xed3, +0xab,0xab,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c, +0xb4c,0xb4c,0xb4c,0xb4c,0xae,0xb58,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae, +0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae,0xae, +0xae,0xae,0xae,0xae,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5,0xbe5, +0xbe5,0xb1,0xbe5,0xbe5,0xbe5,0xbe5,0xbdf,0xbdf,0xbe2,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1, +0xb1,0xb1,0xb1,0xb1,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee, +0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbe8,0xbe8,0xbeb,0xc51,0xc51,0xb4,0xb4,0xb4,0xb4,0xb4, +0xb4,0xb4,0xb4,0xb4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4, +0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf4,0xbf1,0xbf1,0xb7,0xb7,0xb7,0xb7,0xb7,0xb7,0xb7,0xb7, +0xb7,0xb7,0xb7,0xb7,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa,0xbfa, +0xbfa,0xba,0xbfa,0xbfa,0xbfa,0xba,0xbf7,0xbf7,0xba,0xba,0xba,0xba,0xba,0xba,0xba,0xba, +0xba,0xba,0xba,0xba,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4, +0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4,0xce4, +0xce4,0x14e2,0x14e2,0xbd,0xcd5,0xcd5,0xcd5,0xce1,0xce1,0xce1,0xce1,0xcd5,0xcd5,0xce1,0xce1,0xce1, +0xbd,0xbd,0xbd,0xbd,0xce1,0xce1,0xcd5,0xce1,0xce1,0xce1,0xce1,0xce1,0xce1,0xcd8,0xcd8,0xcd8, +0xbd,0xbd,0xbd,0xbd,0xcdb,0xbd,0xbd,0xbd,0xce7,0xce7,0xcde,0xcde,0xcde,0xcde,0xcde,0xcde, +0xcde,0xcde,0xcde,0xcde,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea, +0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xc0,0xc0,0xcea,0xcea,0xcea,0xcea,0xcea,0xc0,0xc0,0xc0, +0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5, +0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0xc3,0xc3,0x14e5,0x14e5, +0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5, +0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0xc3,0xc3,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5, +0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5, +0x14e5,0x14e5,0xc3,0xc3,0xc3,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5, +0x14e5,0xc3,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x14e5,0x1863,0xc3,0xc3,0xc3,0xc3,0xc3, +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x16e9,0x16e9,0x16e9,0x16e9,0xc3,0xc3,0xc3,0xc3, +0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xd11,0xd11,0xd11,0xd11, +0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xc6,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11, +0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xc6, 0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11, -0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd5,0xd5,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e, -0xd0e,0xd0e,0xd5,0xd5,0xd5,0xd5,0xd5,0xd5,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c, -0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd8,0xd8, -0xd14,0xd8,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14, -0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd8,0xd14,0xd14,0xd8,0xd8,0xd8, -0xd14,0xd8,0xd8,0xd14,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17, -0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xdb,0xdb,0xdb,0xdb,0xdb, -0xdb,0xdb,0xdb,0xdb,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0x14d3, -0x14d3,0x1785,0x1785,0xe1,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0, -0x138,0x138,0x138,0x138,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7, -0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdce,0xdce,0xdd4,0xdd4,0xdce, -0xe4,0xe4,0xdd1,0xdd1,0x10e0,0x10e0,0x10e0,0x10e0,0xe7,0xe7,0xe7,0xe7,0xe7,0xe7,0xe7,0xe7, -0xe7,0xe7,0xe7,0xe7,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c,0xc3c, -0xc3c,0xc3c,0xc3c,0xc3c,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6, -0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d9,0xea,0xea,0xea,0xea,0xea,0x1788, -0x12ff,0x1122,0xed0,0xed0,0xde9,0xde6,0xde9,0xde6,0xde6,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0x112b, -0x1128,0x112b,0x1128,0x1125,0x1125,0x1125,0x13c5,0x13c2,0xed,0xed,0xed,0xed,0xed,0xde3,0xde0,0xde0, -0xde0,0xddd,0xde3,0xde0,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec, -0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xf0,0xf0,0xf0,0xf0,0xf0, -0xf0,0xf0,0xf0,0xf0,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xf0,0xdec,0xdec,0xdec,0xdec, -0xdec,0xdec,0xdec,0xf0,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xf0,0xdec,0xdec,0xdec,0xdec, -0xdec,0xdec,0xdec,0xf0,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2, -0xdf2,0xdf2,0xdf2,0xdf2,0xdef,0xdef,0xdef,0xdef,0xdef,0xdef,0xdef,0xdef,0xdef,0xdef,0xf3,0xf3, -0xf3,0xf3,0xf3,0xf3,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xf6,0x13c8,0xf6,0xf6,0xf6,0xf6, -0xf6,0x13c8,0xf6,0xf6,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f, -0xe4f,0xe4f,0xe4f,0xe4f,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb, -0xdfb,0xdfb,0xdfb,0xf9,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8, -0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8,0xdf8, -0xdf8,0xdf8,0xdf8,0xf9,0xe0d,0xe01,0xe01,0xe01,0xfc,0xe01,0xe01,0xfc,0xfc,0xfc,0xfc,0xfc, -0xe01,0xe01,0xe01,0xe01,0xe0d,0xe0d,0xe0d,0xe0d,0xfc,0xe0d,0xe0d,0xe0d,0xfc,0xe0d,0xe0d,0xe0d, +0xd11,0xd11,0xd11,0xc6,0xd11,0xd11,0xc6,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11, +0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xc6,0xc6,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xd11, +0xd11,0xd11,0xd11,0xd11,0xd11,0xd11,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6, +0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6, +0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14, +0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14, +0xd14,0xd14,0xd14,0xc9,0xc9,0xc9,0xc9,0xc9,0xd56,0xd56,0xd56,0xcc,0xcc,0xcc,0xcc,0xd50, +0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50, +0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xd50,0xcc,0xcc,0xcc,0xd53,0xd53,0xd53,0xd53,0xd53, +0xd53,0xd53,0xd53,0xd53,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a, +0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a,0xd1a, +0xd1a,0xd1a,0xcf,0xd17,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23, +0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23, +0xd23,0xd23,0xd2,0xd2,0xd20,0xd20,0xd20,0xd20,0xd20,0xd20,0xd20,0xd20,0xd20,0xd20,0xd2,0xd2, +0xd2,0xd2,0xd2,0xd2,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821, +0x1821,0x1821,0x1821,0x1821,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd5,0xd5,0xd26,0xd5,0xd26,0xd26, +0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd26, +0xd26,0xd26,0xd26,0xd26,0xd26,0xd26,0xd5,0xd26,0xd26,0xd5,0xd5,0xd5,0xd26,0xd5,0xd5,0xd26, +0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29, +0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd8,0xd8,0xd8,0xd8,0xd8,0xd8,0xd8,0xd8,0xd8, +0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0x14e8,0x14e8,0x179a,0x179a,0xde, +0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x135,0x135,0x135,0x135, +0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec, +0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xdec,0xde3,0xde3,0xde9,0xde9,0xde3,0xe1,0xe1,0xde6,0xde6, +0x10f5,0x10f5,0x10f5,0x10f5,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4, +0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e,0xc4e, +0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0x14eb,0x14eb,0x14eb,0x14eb,0x14eb,0x14eb,0x14eb,0x14eb,0x14eb, +0x14eb,0x14eb,0x14eb,0x14eb,0x14eb,0x14ee,0x1866,0x1866,0x1866,0x1866,0xe7,0x179d,0x1314,0x1137,0xee5,0xee5, +0xdfe,0xdfb,0xdfe,0xdfb,0xdfb,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0xdf2,0x1140,0x113d,0x1140,0x113d,0x113a, +0x113a,0x113a,0x13da,0x13d7,0xea,0xea,0xea,0xea,0xea,0xdf8,0xdf5,0xdf5,0xdf5,0xdf2,0xdf8,0xdf5, +0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01, +0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xed,0xed,0xed,0xed,0xed,0xed,0xed,0xed,0xed, +0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xed,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xed, +0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xed,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xe01,0xed, +0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07, +0xe04,0xe04,0xe04,0xe04,0xe04,0xe04,0xe04,0xe04,0xe04,0xe04,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xf3,0x13dd,0xf3,0xf3,0xf3,0xf3,0xf3,0x13dd,0xf3,0xf3, +0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64, +0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xf6, 0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d, -0xe0d,0xe0d,0xe0d,0xe0d,0xfc,0xfc,0xfc,0xfc,0xdfe,0xdfe,0xdfe,0xfc,0xfc,0xfc,0xfc,0xe04, -0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xe07,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc, -0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe10,0xe10,0xe07,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc, -0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0x1131,0x1131,0xff,0xff,0xff,0xff, -0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1f,0xe1f,0xe1f,0xe1c,0xe1c,0xe1f,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c, -0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xff,0xff,0xff,0xff,0xff,0xff,0xe19,0xe19,0xe19,0xe19, -0xe19,0xe19,0xe19,0xe19,0xe19,0xe19,0x112e,0xff,0xff,0xff,0xe16,0xe16,0xe25,0xe25,0xe25,0xe25, -0x102,0x102,0x102,0x102,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe22,0xe25,0xe25,0xe25, -0xe25,0xe25,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x14e2,0x14e8,0x14e5,0x1830, -0x178b,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105, -0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105,0x105, -0x105,0x105,0x105,0x105,0xe4c,0xe4c,0xe4c,0xe49,0xe49,0xe40,0xe40,0xe49,0xe46,0xe46,0xe46,0xe46, -0x108,0x108,0x108,0x108,0x129c,0x129c,0x129c,0x129c,0x129c,0x129c,0x129f,0x129f,0x12a2,0x129f,0x15c,0x15c, -0x15c,0x15c,0x15c,0x15c,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0x13d4,0x13d4,0x10b,0x10b,0x10b,0x10b, -0x10b,0x10b,0x10b,0xe52,0x1305,0x10b,0x10b,0x10b,0x10b,0x10b,0x10b,0x10b,0x10b,0x10b,0x10b,0x10b, -0x10b,0x10b,0x10b,0x1302,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f,0xc0f, -0xc0f,0xc0f,0xc0f,0xc0f,0xe7f,0xe70,0xe6a,0xe7c,0xe79,0xe73,0xe73,0xe82,0xe6d,0xe76,0x10e,0x10e, -0x10e,0x10e,0x10e,0x10e,0xf03,0xf03,0xeee,0xf03,0xf06,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09, -0x114,0x114,0x114,0x114,0xefd,0xefd,0xefd,0xefd,0xefd,0xefd,0xefd,0xefd,0xefd,0xefd,0xf0f,0xf0f, -0xef4,0xefa,0xf0f,0xf0f,0xef7,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef1, -0xef1,0xef1,0xef1,0xef1,0xef1,0xef1,0xef1,0xef1,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4,0xef4, -0xef4,0x114,0x114,0x114,0x130b,0x1308,0x130b,0x1308,0x130b,0x1308,0x130b,0x1308,0x130b,0x1308,0x13da,0x14f4, -0x14f4,0x14f4,0x178e,0x117,0x14f4,0x14f4,0x16dd,0x16dd,0x16dd,0x16d7,0x16dd,0x16d7,0x117,0x117,0x117,0x117, -0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117, -0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x14f1, -0x13dd,0x13dd,0x1308,0x100b,0x100b,0x100b,0x100b,0x100b,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e, -0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1b,0xf1b,0xf21,0xf21, -0x11a,0x11a,0x11a,0x11a,0x11a,0x11a,0x11a,0x11a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a, -0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf2a,0xf24,0xf24, -0xf24,0xf24,0x113a,0x113a,0x11d,0x11d,0x11d,0xf27,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7, -0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7, -0x14f7,0x16e0,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120, -0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120,0x120, -0x120,0x120,0x120,0x120,0xf33,0xf33,0xf33,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd,0x14fd, -0x14fd,0x14fd,0x14fd,0x123,0xf30,0xf30,0xf30,0xf30,0x14fa,0x123,0x123,0x123,0x123,0x123,0x123,0x123, -0x123,0x123,0x123,0x123,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0xf36, -0xf36,0xf36,0xf36,0xf36,0xf36,0xf36,0x126,0x126,0x126,0x126,0x126,0x126,0x126,0x126,0x126,0x126, -0x126,0x126,0x126,0x126,0x1032,0x1032,0x1032,0x1032,0x102f,0x102f,0x102f,0x102f,0x102f,0x102f,0x102f,0x102f, -0x1020,0x1020,0x1020,0x1020,0x1020,0x1020,0x1020,0x1020,0x102f,0x102f,0x1026,0x1023,0x129,0x129,0x129,0x1035, -0x1035,0x1029,0x1029,0x1029,0x102c,0x102c,0x102c,0x102c,0x102c,0x102c,0x102c,0x102c,0x102c,0x102c,0x129,0x129, -0x129,0x1032,0x1032,0x1032,0x1038,0x1038,0x1038,0x1038,0x1038,0x1038,0x1038,0x1038,0x1038,0x1038,0x103b,0x103b, -0x103b,0x103b,0x103b,0x103b,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x1050,0x1050, -0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c, -0x12c,0x12c,0x12c,0x12c,0x1077,0x1077,0x1077,0x1077,0x1071,0x1791,0x12f,0x12f,0x12f,0x12f,0x12f,0x12f, -0x12f,0x12f,0x107d,0x107d,0x1074,0x1074,0x1074,0x1074,0x1074,0x1074,0x1074,0x1074,0x1074,0x1074,0x12f,0x12f, -0x12f,0x12f,0x12f,0x12f,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x108f,0x108f,0x108f,0x108f,0x108f, -0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x1095,0x1098,0x132,0x132,0x132,0x132,0x132,0x132,0x132,0x132, -0x132,0x132,0x132,0x1092,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x109e,0x109e,0x109e, -0x109e,0x109e,0x109e,0x10a7,0x10a7,0x109e,0x109e,0x10a7,0x10a7,0x109e,0x109e,0x135,0x135,0x135,0x135,0x135, -0x135,0x135,0x135,0x135,0x10aa,0x10aa,0x10aa,0x109e,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa, -0x109e,0x10a7,0x135,0x135,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x135,0x135, -0x10a1,0x10ad,0x10ad,0x10ad,0x1509,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138, -0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138,0x138, -0x138,0x138,0x138,0x138,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3, -0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3,0x10b3, -0x10b3,0x10b6,0x13b,0x13b,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9, -0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9, -0x10b9,0x13e,0x13e,0x13e,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc, -0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x141,0x141,0x141,0x141,0x141,0x141,0x141,0x141,0x141,0x141,0x141, -0x141,0x141,0x141,0x141,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2, -0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x10c2,0x144,0x144, -0x144,0x144,0x144,0x10bf,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5, -0x147,0x147,0x147,0x147,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8, -0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x14a,0x14a,0x14a,0x14a,0x14a,0x14a,0x14a,0x14a, -0x14a,0x14a,0x14a,0x14a,0x1140,0x1140,0x1140,0x1140,0x1149,0x1140,0x1140,0x1140,0x1149,0x1140,0x1140,0x1140, -0x1140,0x113d,0x14d,0x14d,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146,0x1146, -0x1146,0x1146,0x1146,0x14d,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c, -0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x150,0x150,0x150,0x150,0x150,0x150, -0x150,0x150,0x150,0x150,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167, -0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1164,0x114f,0x1164,0x114f,0x114f,0x114f,0x114f, -0x114f,0x114f,0x114f,0x153,0x1158,0x1161,0x114f,0x1161,0x1161,0x114f,0x114f,0x114f,0x114f,0x114f,0x114f,0x114f, -0x114f,0x1164,0x1164,0x1164,0x1164,0x1164,0x1164,0x114f,0x114f,0x1155,0x1155,0x1155,0x1155,0x1155,0x1155,0x1155, -0x1155,0x153,0x153,0x1152,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x153,0x153, -0x153,0x153,0x153,0x153,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x153,0x153, -0x153,0x153,0x153,0x153,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x116a,0x116d,0x116d,0x116d,0x116d, -0x115b,0x115b,0x153,0x153,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557,0x1557, -0x1557,0x1557,0x1554,0x1d1,0x12b1,0x1290,0x12ab,0x12ab,0x12ab,0x12ab,0x12ab,0x12ab,0x12ab,0x1293,0x1293,0x1293, -0x1293,0x12ab,0x1293,0x1293,0x1293,0x1293,0x1299,0x147f,0x1485,0x1482,0x147c,0x156,0x16ad,0x16ad,0x156,0x156, -0x156,0x156,0x156,0x156,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182, -0x1182,0x1182,0x1182,0x1182,0x1179,0x1179,0x117c,0x1185,0x117f,0x117f,0x117f,0x1185,0x159,0x159,0x159,0x159, -0x159,0x159,0x159,0x159,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188, -0x1188,0x1188,0x1188,0x1188,0x1188,0x12b7,0x118e,0x12ba,0x118e,0x118e,0x118e,0x118e,0x118b,0x118b,0x118b,0x118e, -0x16e6,0x16e9,0x15f,0x15f,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e, -0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e,0x127e, -0x127e,0x162,0x162,0x162,0x11a3,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x119a,0x11a9,0x11a9,0x1197,0x1197, -0x1197,0x1197,0x165,0x12a5,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x165,0x165, -0x165,0x165,0x1197,0x1197,0x11c7,0x11bb,0x11c7,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168, -0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x168,0x11c4, -0x11c4,0x11ca,0x11be,0x11c1,0x11df,0x11df,0x11df,0x11d9,0x11d9,0x11d0,0x11d9,0x11d9,0x11d0,0x11d9,0x11d9,0x11e2, -0x11dc,0x11d3,0x16b,0x16b,0x11d6,0x11d6,0x11d6,0x11d6,0x11d6,0x11d6,0x11d6,0x11d6,0x11d6,0x11d6,0x16b,0x16b, -0x16b,0x16b,0x16b,0x16b,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x11e8,0x16e,0x16e,0x16e,0x16e,0x11e5, -0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5, -0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x11e5,0x16e,0x16e,0x16e,0x16e, -0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1, -0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x11f1,0x171,0x11ee,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb, -0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200, -0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x174,0x174,0x174,0x11fa,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd, +0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xe0d,0xf6, +0xe22,0xe16,0xe16,0xe16,0xf9,0xe16,0xe16,0xf9,0xf9,0xf9,0xf9,0xf9,0xe16,0xe16,0xe16,0xe16, +0xe22,0xe22,0xe22,0xe22,0xf9,0xe22,0xe22,0xe22,0xf9,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22, +0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22,0xe22, +0xf9,0xf9,0xf9,0xf9,0xe13,0xe13,0xe13,0xf9,0xf9,0xf9,0xf9,0xe19,0xe1c,0xe1c,0xe1c,0xe1c, +0xe1c,0xe1c,0xe1c,0xe1c,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xe1f,0xe1f,0xe1f,0xe1f, +0xe1f,0xe1f,0xe25,0xe25,0xe1c,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xe31,0xe31,0xe31,0xe31, +0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0x1146,0x1146,0xfc,0xfc,0xfc,0xfc,0xe31,0xe31,0xe31,0xe31, +0xe31,0xe34,0xe34,0xe34,0xe31,0xe31,0xe34,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31, +0xe31,0xe31,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e, +0xe2e,0xe2e,0x1143,0xfc,0xfc,0xfc,0xe2b,0xe2b,0xe3a,0xe3a,0xe3a,0xe3a,0xff,0xff,0xff,0xff, +0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe37,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xff,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x14f7,0x14fd,0x14fa,0x1845,0x17a0,0x1869,0x1869,0x1869, +0x1869,0x1869,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102, +0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102,0x102, +0x102,0x102,0x102,0x102,0xe61,0xe61,0xe61,0xe5e,0xe5e,0xe55,0xe55,0xe5e,0xe5b,0xe5b,0xe5b,0xe5b, +0x105,0x105,0x105,0x105,0x12b1,0x12b1,0x12b1,0x12b1,0x12b1,0x12b1,0x12b4,0x12b4,0x12b7,0x12b4,0x159,0x159, +0x159,0x159,0x159,0x159,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0x13e9,0x13e9,0x108,0x108,0x108,0x108, +0x108,0x108,0x108,0xe67,0x131a,0x108,0x108,0x108,0x108,0x108,0x108,0x108,0x108,0x108,0x108,0x108, +0x108,0x108,0x108,0x1317,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21,0xc21, +0xc21,0xc21,0xc21,0xc21,0xe94,0xe85,0xe7f,0xe91,0xe8e,0xe88,0xe88,0xe97,0xe82,0xe8b,0x10b,0x10b, +0x10b,0x10b,0x10b,0x10b,0xf18,0xf18,0xf03,0xf18,0xf1b,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e, +0x111,0x111,0x111,0x111,0xf12,0xf12,0xf12,0xf12,0xf12,0xf12,0xf12,0xf12,0xf12,0xf12,0xf24,0xf24, +0xf09,0xf0f,0xf24,0xf24,0xf0c,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf06, +0xf06,0xf06,0xf06,0xf06,0xf06,0xf06,0xf06,0xf06,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09, +0xf09,0x111,0x111,0x111,0x1320,0x131d,0x1320,0x131d,0x1320,0x131d,0x1320,0x131d,0x1320,0x131d,0x13ef,0x1509, +0x1509,0x1509,0x17a3,0x114,0x1509,0x1509,0x16f2,0x16f2,0x16f2,0x16ec,0x16f2,0x16ec,0x114,0x114,0x114,0x114, +0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114, +0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x114,0x1506, +0x13f2,0x13f2,0x131d,0x1020,0x1020,0x1020,0x1020,0x1020,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33, +0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf30,0xf30,0xf36,0xf36, +0x117,0x117,0x117,0x117,0x117,0x117,0x117,0x117,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f, +0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf3f,0xf39,0xf39, +0xf39,0xf39,0x114f,0x114f,0x11a,0x11a,0x11a,0xf3c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c, +0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c, +0x150c,0x16f5,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d, +0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d,0x11d, +0x11d,0x11d,0x11d,0x11d,0xf48,0xf48,0xf48,0x1512,0x1512,0x1512,0x1512,0x1512,0x1512,0x1512,0x1512,0x1512, +0x1512,0x1512,0x1512,0x120,0xf45,0xf45,0xf45,0xf45,0x150f,0x120,0x120,0x120,0x120,0x120,0x120,0x120, +0x120,0x120,0x120,0x120,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b, +0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0xf4b,0x123,0x123,0x123,0x123,0x123,0x123,0x123,0x123,0x123,0x123, +0x123,0x123,0x123,0x123,0x1047,0x1047,0x1047,0x1047,0x1044,0x1044,0x1044,0x1044,0x1044,0x1044,0x1044,0x1044, +0x1035,0x1035,0x1035,0x1035,0x1035,0x1035,0x1035,0x1035,0x1044,0x1044,0x103b,0x1038,0x126,0x126,0x126,0x104a, +0x104a,0x103e,0x103e,0x103e,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x126,0x126, +0x126,0x1047,0x1047,0x1047,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x104d,0x1050,0x1050, +0x1050,0x1050,0x1050,0x1050,0x1062,0x1062,0x1062,0x1062,0x1062,0x1062,0x1062,0x1062,0x1062,0x1062,0x1065,0x1065, +0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129,0x129, +0x129,0x129,0x129,0x129,0x108c,0x108c,0x108c,0x108c,0x1086,0x17a6,0x12c,0x12c,0x12c,0x12c,0x12c,0x12c, +0x12c,0x12c,0x1092,0x1092,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x12c,0x12c, +0x12c,0x12c,0x12c,0x12c,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4, +0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10a4,0x10aa,0x10ad,0x12f,0x12f,0x12f,0x12f,0x12f,0x12f,0x12f,0x12f, +0x12f,0x12f,0x12f,0x10a7,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10b3,0x10b3,0x10b3, +0x10b3,0x10b3,0x10b3,0x10bc,0x10bc,0x10b3,0x10b3,0x10bc,0x10bc,0x10b3,0x10b3,0x132,0x132,0x132,0x132,0x132, +0x132,0x132,0x132,0x132,0x10bf,0x10bf,0x10bf,0x10b3,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf, +0x10b3,0x10bc,0x132,0x132,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x10b9,0x132,0x132, +0x10b6,0x10c2,0x10c2,0x10c2,0x151e,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135, +0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135,0x135, +0x135,0x135,0x135,0x135,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8, +0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8, +0x10c8,0x10cb,0x138,0x138,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce, +0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce,0x10ce, +0x10ce,0x13b,0x13b,0x13b,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1, +0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x13e,0x13e,0x13e,0x13e,0x13e,0x13e,0x13e,0x13e,0x13e,0x13e,0x13e, +0x13e,0x13e,0x13e,0x13e,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7, +0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x10d7,0x141,0x141, +0x141,0x141,0x141,0x10d4,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da, +0x144,0x144,0x144,0x144,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd, +0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x147,0x147,0x147,0x147,0x147,0x147,0x147,0x147, +0x147,0x147,0x147,0x147,0x1155,0x1155,0x1155,0x1155,0x115e,0x1155,0x1155,0x1155,0x115e,0x1155,0x1155,0x1155, +0x1155,0x1152,0x14a,0x14a,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b,0x115b, +0x115b,0x115b,0x115b,0x14a,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161, +0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x14d,0x14d,0x14d,0x14d,0x14d,0x14d, +0x14d,0x14d,0x14d,0x14d,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c, +0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x1179,0x1164,0x1179,0x1164,0x1164,0x1164,0x1164, +0x1164,0x1164,0x1164,0x150,0x116d,0x1176,0x1164,0x1176,0x1176,0x1164,0x1164,0x1164,0x1164,0x1164,0x1164,0x1164, +0x1164,0x1179,0x1179,0x1179,0x1179,0x1179,0x1179,0x1164,0x1164,0x116a,0x116a,0x116a,0x116a,0x116a,0x116a,0x116a, +0x116a,0x150,0x150,0x1167,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x150,0x150, +0x150,0x150,0x150,0x150,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x150,0x150, +0x150,0x150,0x150,0x150,0x1170,0x1170,0x1170,0x1170,0x1170,0x1170,0x1170,0x117f,0x1182,0x1182,0x1182,0x1182, +0x1170,0x1170,0x150,0x150,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569, +0x1569,0x1569,0x1566,0x1cb,0x12c6,0x12a5,0x12c0,0x12c0,0x12c0,0x12c0,0x12c0,0x12c0,0x12c0,0x12a8,0x12a8,0x12a8, +0x12a8,0x12c0,0x12a8,0x12a8,0x12a8,0x12a8,0x12ae,0x1494,0x149a,0x1497,0x1491,0x18e4,0x16bf,0x16bf,0x153,0x153, +0x153,0x153,0x153,0x153,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197, +0x1197,0x1197,0x1197,0x1197,0x118e,0x118e,0x1191,0x119a,0x1194,0x1194,0x1194,0x119a,0x156,0x156,0x156,0x156, +0x156,0x156,0x156,0x156,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d,0x119d, +0x119d,0x119d,0x119d,0x119d,0x119d,0x12cc,0x11a3,0x12cf,0x11a3,0x11a3,0x11a3,0x11a3,0x11a0,0x11a0,0x11a0,0x11a3, +0x16fb,0x16fe,0x15c,0x15c,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293, +0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293,0x1293, +0x1293,0x15f,0x15f,0x15f,0x11b8,0x11ac,0x11ac,0x11ac,0x11ac,0x11ac,0x11ac,0x11af,0x11be,0x11be,0x11ac,0x11ac, +0x11ac,0x11ac,0x162,0x12ba,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x162,0x162, +0x162,0x162,0x11ac,0x11ac,0x11dc,0x11d0,0x11dc,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165, +0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x165,0x11d9, +0x11d9,0x11df,0x11d3,0x11d6,0x11f4,0x11f4,0x11f4,0x11ee,0x11ee,0x11e5,0x11ee,0x11ee,0x11e5,0x11ee,0x11ee,0x11f7, +0x11f1,0x11e8,0x168,0x168,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x11eb,0x168,0x168, +0x168,0x168,0x168,0x168,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x11fd,0x16b,0x16b,0x16b,0x16b,0x11fa, +0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa, +0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x11fa,0x16b,0x16b,0x16b,0x16b, 0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x1206, -0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x177,0x177,0x1203,0x1203,0x1203,0x1203,0x1203,0x1203,0x1203,0x1203, -0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c, -0x120c,0x120c,0x120c,0x17a,0x17a,0x17a,0x17a,0x17a,0x1209,0x1209,0x1209,0x1209,0x1209,0x1209,0x1209,0x1209, -0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212, -0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212,0x180, -0x1230,0x1230,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183,0x183, -0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b, -0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x1515,0x1515,0x189,0x189,0x189, -0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a,0x125a, -0x125a,0x125a,0x125a,0x125d,0x125d,0x125d,0x123c,0x189,0x135f,0x1266,0x135f,0x135f,0x135f,0x135f,0x135f,0x135f, -0x135f,0x135f,0x135f,0x135f,0x135f,0x1266,0x135f,0x1266,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c, -0x135c,0x135c,0x13ec,0x13ec,0x189,0x189,0x189,0x189,0x1362,0x1362,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c, -0x135c,0x1263,0x135c,0x1263,0x1263,0x135c,0x1362,0x1269,0x180f,0x180f,0x180f,0x180f,0x180f,0x180f,0x180f,0x180f, -0x180f,0x180f,0x180f,0x180f,0x180f,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189, +0x1206,0x1206,0x1206,0x1206,0x1206,0x1206,0x16e,0x1203,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200, +0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215, +0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x171,0x171,0x171,0x120f,0x1212,0x1212,0x1212,0x1212,0x1212,0x1212, +0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x121b, +0x121b,0x121b,0x121b,0x121b,0x121b,0x121b,0x174,0x174,0x1218,0x1218,0x1218,0x1218,0x1218,0x1218,0x1218,0x1218, +0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221,0x1221, +0x1221,0x1221,0x1221,0x177,0x177,0x177,0x177,0x177,0x121e,0x121e,0x121e,0x121e,0x121e,0x121e,0x121e,0x121e, +0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227, +0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x1227,0x17d, +0x1242,0x1242,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180,0x180, +0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470, +0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x152a,0x152a,0x186,0x186,0x186, +0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f,0x126f, +0x126f,0x126f,0x126f,0x1272,0x1272,0x1272,0x1251,0x186,0x1374,0x127b,0x1374,0x1374,0x1374,0x1374,0x1374,0x1374, +0x1374,0x1374,0x1374,0x1374,0x1374,0x127b,0x1374,0x127b,0x1371,0x1371,0x1371,0x1371,0x1371,0x1371,0x1371,0x1371, +0x1371,0x1371,0x1401,0x1401,0x186,0x186,0x186,0x186,0x1377,0x1377,0x1371,0x1371,0x1371,0x1371,0x1371,0x1371, +0x1371,0x1278,0x1371,0x1278,0x1278,0x1371,0x1377,0x127e,0x1824,0x1824,0x1824,0x1824,0x1824,0x1824,0x1824,0x1824, +0x1824,0x1824,0x1824,0x1824,0x1824,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186, +0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186, +0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x186,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329, +0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329,0x1329, +0x1329,0x1329,0x1329,0x1329,0x129f,0x1392,0x138f,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189, +0x189,0x189,0x189,0x189,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x129c,0x1299, +0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x1299,0x129c, +0x1299,0x1299,0x1392,0x1392,0x1392,0x1392,0x1392,0x138f,0x1392,0x1392,0x1392,0x1827,0x189,0x189,0x189,0x189, +0x1296,0x1296,0x1296,0x1296,0x1296,0x1296,0x1296,0x1296,0x1296,0x189,0x189,0x189,0x189,0x189,0x189,0x189, +0x13bf,0x13bf,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189, +0x18c9,0x18c9,0x18c9,0x18c9,0x18c9,0x18c9,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189, 0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189, -0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314, -0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314,0x1314, -0x1314,0x1314,0x1314,0x1314,0x128a,0x137d,0x137a,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c, -0x18c,0x18c,0x18c,0x18c,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1287,0x1284, -0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1284,0x1287, -0x1284,0x1284,0x137d,0x137d,0x137d,0x137d,0x137d,0x137a,0x137d,0x137d,0x137d,0x1812,0x18c,0x18c,0x18c,0x18c, -0x1281,0x1281,0x1281,0x1281,0x1281,0x1281,0x1281,0x1281,0x1281,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c, -0x13aa,0x13aa,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c, -0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c,0x18c, -0x18c,0x18c,0x18c,0x18c,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d, -0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x131d,0x1317,0x1317,0x1317, -0x18f,0x18f,0x131a,0x18f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x1320,0x1329,0x1323,0x1323,0x1329,0x1329, -0x1329,0x1323,0x1329,0x1323,0x1323,0x1323,0x132c,0x132c,0x192,0x192,0x192,0x192,0x192,0x192,0x192,0x192, -0x1326,0x1326,0x1326,0x1326,0x195,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x195,0x195,0x1332,0x1332,0x1332, -0x1332,0x1332,0x1332,0x195,0x195,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x195,0x195,0x195,0x195,0x195, -0x195,0x195,0x195,0x195,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x195,0x1332,0x1332,0x1332,0x1332, -0x1332,0x1332,0x1332,0x195,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4, -0x15b4,0x15b4,0x15b4,0x15b4,0x1335,0x1335,0x1335,0x1335,0x1335,0x1335,0x1338,0x134a,0x134a,0x133e,0x133e,0x133e, -0x133e,0x133e,0x198,0x198,0x198,0x198,0x133b,0x133b,0x133b,0x133b,0x133b,0x133b,0x133b,0x133b,0x133b,0x133b, -0x133b,0x133b,0x133b,0x133b,0x133b,0x133b,0x1341,0x1341,0x1341,0x1341,0x1341,0x1341,0x1341,0x1341,0x1341,0x1341, -0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x198,0x1518, -0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d, -0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x19b,0x19b,0x19b,0x19b,0x19b,0x19b,0x19b, -0x1383,0x1380,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e, -0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e, -0x19e,0x19e,0x19e,0x19e,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350, -0x1350,0x1350,0x1350,0x1a1,0x1a1,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350, -0x1350,0x1350,0x1350,0x151b,0x1a1,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350, -0x1350,0x1350,0x1350,0x1386,0x1a1,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350, -0x1350,0x1350,0x1350,0x1350,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b, -0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x151b,0x1a1,0x1a1,0x1a1,0x1a1,0x1a1,0x1a1, -0x1a1,0x1a1,0x1a1,0x1a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x1533,0x1533,0x1533,0x1533,0x1533,0x1536, -0x16a4,0x1536,0x1536,0x1536,0x176d,0x181b,0x181b,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4, -0x1a4,0x1a4,0x1a4,0x1a4,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1533,0x1533,0x1533,0x1536,0x1533,0x16a1, -0x16a1,0x1a4,0x1a4,0x1a4,0x1536,0x1533,0x1533,0x1536,0x181b,0x181b,0x181b,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4, -0x1a4,0x1a4,0x1a4,0x1a4,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353, -0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7, -0x1a7,0x1a7,0x1a7,0x1a7,0x13f8,0x153c,0x13f8,0x13f8,0x13f8,0x13f8,0x13f8,0x13f8,0x13f8,0x13f8,0x13f8,0x13f8, -0x13f8,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x16f2,0x16f2,0x1aa,0x179d,0x179d,0x179d,0x179d,0x179d,0x179d, -0x179d,0x179d,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa, -0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x179a,0x179a,0x179a,0x179a,0x179a,0x179a,0x179a,0x179a, -0x179a,0x179a,0x179a,0x179a,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe, -0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe, -0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x1ad,0x13fe,0x1ad,0x1ad,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe, -0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x1ad,0x13fe, -0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x13fe,0x1ad,0x1ad,0x1ad,0x1ad,0x13fe,0x1ad,0x13fe,0x1ad,0x13fe, -0x1ad,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x1ad,0x13fe,0x1ad,0x1ad,0x13fe,0x1ad,0x13fe,0x1ad,0x13fe, -0x1ad,0x13fe,0x1ad,0x13fe,0x1ad,0x13fe,0x13fe,0x1ad,0x13fe,0x1ad,0x1ad,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad, -0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe, -0x13fe,0x1ad,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe, -0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe, -0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x1ad,0x13fe, -0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe, -0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad, -0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad, -0x13fb,0x13fb,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad, -0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1401,0x1401,0x1401,0x1401,0x1401,0x1410,0x1401,0x1404,0x1404, -0x1401,0x1401,0x1401,0x1407,0x1407,0x1b0,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d, -0x140a,0x1416,0x1416,0x1416,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0,0x1b0, -0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6, -0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x141f,0x1419,0x1419,0x141f,0x141f, -0x1428,0x1428,0x1422,0x1425,0x1425,0x141f,0x141c,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3, -0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b, -0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x142b,0x1b6,0x1b6,0x1b6,0x1b6,0x16f5,0x16f5,0x142b,0x142b, -0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5, -0x1b6,0x1b6,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5, -0x1437,0x1437,0x1437,0x1437,0x1437,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9, -0x1437,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434, -0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434,0x1434, -0x1434,0x1434,0x1434,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9,0x1b9, -0x1b9,0x1b9,0x1b9,0x1431,0x1431,0x1431,0x1431,0x143a,0x143a,0x143a,0x143a,0x143a,0x143a,0x143a,0x143a,0x143a, -0x143a,0x143a,0x143a,0x143a,0x144c,0x144f,0x1452,0x1452,0x144f,0x1455,0x1455,0x1440,0x1443,0x16fb,0x16f8,0x16f8, -0x16f8,0x1542,0x1bc,0x1bc,0x1446,0x1446,0x1446,0x1446,0x1446,0x1446,0x1446,0x1446,0x1446,0x1446,0x153f,0x1701, -0x1704,0x16fe,0x1707,0x1707,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x1bf,0x1bf,0x1bf, -0x1bf,0x1bf,0x1bf,0x1bf,0x1458,0x1458,0x1458,0x1458,0x1458,0x1458,0x1458,0x1458,0x1458,0x1458,0x1bf,0x1bf, -0x1bf,0x1bf,0x1bf,0x1bf,0x145e,0x145e,0x145e,0x145e,0x145e,0x145e,0x145e,0x145e,0x1c2,0x1c2,0x1c2,0x1c2, -0x1c2,0x1c2,0x1c2,0x1c2,0x12ae,0x12ab,0x12ae,0x1296,0x12ab,0x12ab,0x12ab,0x12b1,0x12ab,0x12b1,0x12b4,0x12ab, -0x12b1,0x12b1,0x12ab,0x12ab,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1461, -0x146a,0x1461,0x146a,0x146a,0x1461,0x1461,0x1461,0x1461,0x1461,0x1461,0x146d,0x1464,0x1c5,0x1c5,0x1c5,0x1c5, -0x1c5,0x1c5,0x1c5,0x1c5,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548, -0x1548,0x1548,0x1c8,0x1c8,0x1545,0x1545,0x1545,0x1545,0x1545,0x154b,0x1c8,0x1c8,0x1c8,0x1c8,0x1c8,0x1c8, -0x1c8,0x1c8,0x1c8,0x1c8,0x16b0,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7, -0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7, -0x1ce,0x1ce,0x1ce,0x1ce,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1, -0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1, -0x1d1,0x1d1,0x1d1,0x1d1,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1d4, -0x1d4,0x1d4,0x1d4,0x1d4,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563, -0x1563,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563, -0x1563,0x1563,0x1d4,0x1d4,0x1560,0x155a,0x155d,0x1566,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569, -0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551, -0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c, -0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x1da,0x1da,0x1da, -0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da, -0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da,0x1da, -0x170a,0x156f,0x1575,0x16b6,0x1dd,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x1dd,0x1dd,0x157e, -0x157e,0x1dd,0x1dd,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e, -0x157e,0x1dd,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x1dd,0x157e,0x157e,0x1dd,0x157e,0x157e,0x157e, -0x157e,0x157e,0x1dd,0x1dd,0x16b3,0x157e,0x156f,0x1575,0x156f,0x1575,0x1575,0x1575,0x1575,0x1dd,0x1dd,0x1575, -0x1575,0x1dd,0x1dd,0x1578,0x1578,0x157b,0x1dd,0x1dd,0x170d,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x156f, -0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1581,0x157e,0x157e,0x157e,0x157e,0x1575,0x1575,0x1dd,0x1dd,0x1572,0x1572, -0x1572,0x1572,0x1572,0x1572,0x1572,0x1dd,0x1dd,0x1dd,0x1572,0x1572,0x1572,0x1572,0x1572,0x1dd,0x1dd,0x1dd, -0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596, -0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1e0,0x1596,0x1596,0x1596,0x1596,0x1596, -0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1596,0x1590,0x1590,0x1590,0x1584,0x1584,0x1584,0x1590,0x1590, -0x1584,0x1593,0x1587,0x1584,0x1599,0x1599,0x158d,0x1599,0x1599,0x158a,0x17a0,0x1e0,0x15a8,0x15a8,0x15a8,0x159c, -0x159c,0x159c,0x159c,0x159c,0x159c,0x159f,0x15a2,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x15a5,0x15a5,0x15a5,0x15a5, -0x15a5,0x15a5,0x15a5,0x15a5,0x15a5,0x15a5,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1710,0x1710,0x1710,0x1710, -0x15b4,0x15b1,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x173a,0x173a,0x173a,0x173a, -0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x15ba,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x15ba,0x15ba,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9, -0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x15c6,0x15c6,0x15c6,0x15c6, -0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15bd, -0x15c0,0x15c3,0x15c6,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x15d5,0x15d5,0x15d5,0x15d5, -0x15d5,0x15c9,0x15c9,0x1ef,0x1ef,0x1ef,0x1ef,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15d2,0x15d2,0x15d2,0x15d2, -0x15d2,0x15d2,0x15cf,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x15de,0x15de,0x15de,0x15de, -0x15de,0x1f2,0x1f2,0x15db,0x15db,0x15db,0x15db,0x15db,0x15db,0x15db,0x15db,0x15db,0x15d8,0x15d8,0x15d8,0x15d8, -0x15d8,0x15d8,0x15d8,0x1f2,0x1f2,0x1f2,0x1f2,0x1f2,0x1f2,0x1f2,0x1f2,0x1f2,0x15e1,0x15f3,0x15f3,0x15e7, -0x15f0,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x15ea,0x15ea,0x15ea,0x15ea, -0x15ea,0x15ea,0x15ea,0x15ea,0x15ea,0x15ea,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x1f5,0x15f9,0x15f9,0x15f9,0x15f9, -0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9, -0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x15f9,0x1f8,0x1605,0x1605,0x1605,0x1605, -0x1605,0x15ff,0x1608,0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1605,0x1602,0x1602,0x1602,0x1602, -0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1605,0x1605,0x1605,0x1605,0x1605,0x1fb,0x160e,0x160e,0x160e,0x160e, -0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e, -0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x160e,0x1fe,0x161a,0x161a,0x161a,0x161a, -0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a,0x161a, -0x161a,0x161a,0x1617,0x1617,0x1617,0x1617,0x1617,0x201,0x201,0x201,0x201,0x201,0x1632,0x1632,0x1635,0x1635, -0x1638,0x1629,0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x204,0x162f,0x162f,0x162f,0x162f, -0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x204,0x1629,0x1629,0x1629,0x1629,0x1629,0x1629,0x1629,0x204,0x1632, -0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632, -0x1632,0x1632,0x1632,0x1632,0x204,0x204,0x204,0x204,0x204,0x1632,0x1632,0x1632,0x1641,0x1641,0x1641,0x1641, -0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641, -0x1641,0x1641,0x1641,0x1641,0x1641,0x207,0x207,0x207,0x207,0x207,0x207,0x207,0x164a,0x164a,0x164a,0x164a, -0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x164a,0x20a,0x20a, -0x20a,0x20a,0x20a,0x20a,0x20a,0x1647,0x1647,0x1647,0x1647,0x20a,0x20a,0x20a,0x1665,0x1665,0x1665,0x1665, -0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x164d,0x165f,0x165f,0x164d,0x164d, -0x164d,0x164d,0x210,0x210,0x165f,0x165f,0x1662,0x1662,0x164d,0x164d,0x165f,0x1653,0x1650,0x1656,0x1668,0x1668, -0x1659,0x1659,0x165c,0x165c,0x165c,0x1668,0x1719,0x1719,0x1719,0x1719,0x1719,0x1719,0x1719,0x1719,0x1719,0x1719, -0x1719,0x1719,0x1719,0x1719,0x1716,0x1716,0x1716,0x1716,0x1713,0x1713,0x210,0x210,0x210,0x210,0x210,0x210, +0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x189,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332, +0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332,0x1332, +0x1332,0x132c,0x132c,0x132c,0x18c,0x18c,0x132f,0x18c,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1335,0x133e, +0x1338,0x1338,0x133e,0x133e,0x133e,0x1338,0x133e,0x1338,0x1338,0x1338,0x1341,0x1341,0x18f,0x18f,0x18f,0x18f, +0x18f,0x18f,0x18f,0x18f,0x133b,0x133b,0x133b,0x133b,0x192,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x192, +0x192,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x192,0x192,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x192, +0x192,0x192,0x192,0x192,0x192,0x192,0x192,0x192,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x192, +0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x192,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6, +0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x134a,0x134a,0x134a,0x134a,0x134a,0x134a,0x134d,0x135f, +0x135f,0x1353,0x1353,0x1353,0x1353,0x1353,0x195,0x195,0x195,0x195,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350, +0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1350,0x1356,0x1356,0x1356,0x1356,0x1356,0x1356, +0x1356,0x1356,0x1356,0x1356,0x195,0x195,0x195,0x195,0x195,0x195,0x195,0x195,0x195,0x195,0x195,0x195, +0x195,0x195,0x195,0x152d,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362, +0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x198,0x198,0x198, +0x198,0x198,0x198,0x198,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365, +0x1365,0x1365,0x1365,0x19b,0x19b,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365, +0x1365,0x1365,0x1365,0x1530,0x19b,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365, +0x1365,0x1365,0x1365,0x139b,0x19b,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365,0x1365, +0x1365,0x1365,0x1365,0x1365,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530, +0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x1530,0x19b,0x19b,0x19b,0x19b,0x19b,0x19b, +0x19b,0x19b,0x19b,0x19b,0x13b9,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x1545,0x1545,0x1545,0x1545,0x1545,0x1548, +0x16b6,0x1548,0x1548,0x1548,0x1782,0x1830,0x1830,0x186c,0x186c,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e,0x19e, +0x19e,0x19e,0x19e,0x19e,0x1548,0x1548,0x1548,0x1548,0x1548,0x1548,0x1545,0x1545,0x1545,0x1548,0x1545,0x16b3, +0x16b3,0x19e,0x19e,0x19e,0x1548,0x1545,0x1545,0x1548,0x1830,0x1830,0x1830,0x18cf,0x18cf,0x19e,0x19e,0x19e, +0x19e,0x19e,0x19e,0x19e,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368, +0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1a1,0x1a1,0x1a1,0x1a1,0x1a1,0x1a1,0x1a1,0x1a1, +0x1a1,0x1a1,0x1a1,0x1a1,0x140d,0x154e,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d,0x140d, +0x140d,0x154e,0x154e,0x154e,0x154e,0x154e,0x154e,0x1707,0x1707,0x1a4,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2, +0x17b2,0x17b2,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4, +0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x1a4,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af, +0x17af,0x17af,0x17af,0x17af,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413, +0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413, +0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1a7,0x1413,0x1a7,0x1a7,0x1413,0x1a7,0x1413,0x1413,0x1413, +0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1a7,0x1413, +0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1413,0x1a7,0x1a7,0x1a7,0x1a7,0x1413,0x1a7,0x1413,0x1a7,0x1413, +0x1a7,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1a7,0x1413,0x1a7,0x1a7,0x1413,0x1a7,0x1413,0x1a7,0x1413, +0x1a7,0x1413,0x1a7,0x1413,0x1a7,0x1413,0x1413,0x1a7,0x1413,0x1a7,0x1a7,0x1413,0x1413,0x1413,0x1413,0x1a7, +0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1413, +0x1413,0x1a7,0x1413,0x1a7,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413, +0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413, +0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1413,0x1413,0x1413,0x1a7,0x1413,0x1413,0x1413,0x1413,0x1413,0x1a7,0x1413, +0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413, +0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7, +0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7, +0x1410,0x1410,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7,0x1a7, +0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1416,0x1416,0x1416,0x1416,0x1416,0x1425,0x1416,0x1419,0x1419, +0x1416,0x1416,0x1416,0x141c,0x141c,0x1aa,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422,0x1422, +0x141f,0x142b,0x142b,0x142b,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa,0x1aa, +0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8, +0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1434,0x142e,0x142e,0x1434,0x1434, +0x143d,0x143d,0x1437,0x143a,0x143a,0x1434,0x1431,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad,0x1ad, +0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440, +0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1440,0x1b0,0x1b0,0x1b0,0x1b0,0x170a,0x170a,0x1440,0x1440, +0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a, +0x1b0,0x1b0,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a, +0x144c,0x144c,0x144c,0x144c,0x144c,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3, +0x144c,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449, +0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449,0x1449, +0x1449,0x1449,0x1449,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3,0x1b3, +0x1b3,0x1b3,0x1b3,0x1446,0x1446,0x1446,0x1446,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f, +0x144f,0x144f,0x144f,0x144f,0x1461,0x1464,0x1467,0x1467,0x1464,0x146a,0x146a,0x1455,0x1458,0x1710,0x170d,0x170d, +0x170d,0x1554,0x1b6,0x1b6,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x145b,0x1551,0x1716, +0x1719,0x1713,0x171c,0x171c,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1b9,0x1b9,0x1b9, +0x1b9,0x1b9,0x1b9,0x1b9,0x146d,0x146d,0x146d,0x146d,0x146d,0x146d,0x146d,0x146d,0x146d,0x146d,0x1b9,0x1b9, +0x1b9,0x1b9,0x1b9,0x1b9,0x1473,0x1473,0x1473,0x1473,0x1473,0x1473,0x1473,0x1473,0x1bc,0x1bc,0x1bc,0x1bc, +0x1bc,0x1bc,0x1bc,0x1bc,0x12c3,0x12c0,0x12c3,0x12ab,0x12c0,0x12c0,0x12c0,0x12c6,0x12c0,0x12c6,0x12c9,0x12c0, +0x12c6,0x12c6,0x12c0,0x12c0,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1476, +0x147f,0x1476,0x147f,0x147f,0x1476,0x1476,0x1476,0x1476,0x1476,0x1476,0x1482,0x1479,0x1bf,0x1bf,0x1bf,0x1bf, +0x1bf,0x1bf,0x1bf,0x1bf,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a,0x155a, +0x155a,0x155a,0x1c2,0x1c2,0x1557,0x1557,0x1557,0x1557,0x1557,0x155d,0x1c2,0x1c2,0x1c2,0x1c2,0x1c2,0x1c2, +0x1c2,0x1c2,0x1c2,0x1c2,0x16c2,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9, +0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9,0x16b9, +0x1c8,0x1c8,0x1c8,0x1c8,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb, +0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb,0x1cb, +0x1cb,0x1cb,0x1cb,0x1cb,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1ce, +0x1ce,0x1ce,0x1ce,0x1ce,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1ce,0x1ce,0x1ce,0x1ce,0x1ce,0x1ce,0x1ce,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1ce,0x1ce,0x1572,0x156c,0x156f,0x1578,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b, +0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1d1,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563, +0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e, +0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x1d4,0x1d4,0x1d4, +0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4, +0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4,0x1d4, +0x171f,0x16c5,0x1587,0x16cb,0x1d7,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1d7,0x1d7,0x1590, +0x1590,0x1d7,0x1d7,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590, +0x1590,0x1d7,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1590,0x1d7,0x1590,0x1590,0x1d7,0x1590,0x1590,0x1590, +0x1590,0x1590,0x1d7,0x1d7,0x16c8,0x1590,0x1581,0x1587,0x1581,0x1587,0x1587,0x1587,0x1587,0x1d7,0x1d7,0x1587, +0x1587,0x1d7,0x1d7,0x158a,0x158a,0x158d,0x1d7,0x1d7,0x1722,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1581, +0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1593,0x1590,0x1590,0x1590,0x1590,0x1587,0x1587,0x1d7,0x1d7,0x1584,0x1584, +0x1584,0x1584,0x1584,0x1584,0x1584,0x1d7,0x1d7,0x1d7,0x1584,0x1584,0x1584,0x1584,0x1584,0x1d7,0x1d7,0x1d7, +0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x1d7,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8, +0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x1da,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8, +0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a8,0x15a2,0x15a2,0x15a2,0x1596,0x1596,0x1596,0x15a2,0x15a2, +0x1596,0x15a5,0x1599,0x1596,0x15ab,0x15ab,0x159f,0x15ab,0x15ab,0x159c,0x17b5,0x1da,0x15ba,0x15ba,0x15ba,0x15ae, +0x15ae,0x15ae,0x15ae,0x15ae,0x15ae,0x15b1,0x15b4,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x15b7,0x15b7,0x15b7,0x15b7, +0x15b7,0x15b7,0x15b7,0x15b7,0x15b7,0x15b7,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1dd,0x1725,0x1725,0x1725,0x1725, +0x15c6,0x15c3,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x1e0,0x174f,0x174f,0x174f,0x174f, +0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x15cc,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x15cc,0x15cc,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3, +0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x1e3,0x15d8,0x15d8,0x15d8,0x15d8, +0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15d8,0x15cf, +0x15d2,0x15d5,0x15d8,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x1e6,0x15e7,0x15e7,0x15e7,0x15e7, +0x15e7,0x15db,0x15db,0x1e9,0x1e9,0x1e9,0x1e9,0x15de,0x15de,0x15de,0x15de,0x15de,0x15e4,0x15e4,0x15e4,0x15e4, +0x15e4,0x15e4,0x15e1,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x1e9,0x15f0,0x15f0,0x15f0,0x15f0, +0x15f0,0x1ec,0x1ec,0x15ed,0x15ed,0x15ed,0x15ed,0x15ed,0x15ed,0x15ed,0x15ed,0x15ed,0x15ea,0x15ea,0x15ea,0x15ea, +0x15ea,0x15ea,0x15ea,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x1ec,0x15f3,0x1605,0x1605,0x15f9, +0x1602,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x15fc,0x15fc,0x15fc,0x15fc, +0x15fc,0x15fc,0x15fc,0x15fc,0x15fc,0x15fc,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x1ef,0x160b,0x160b,0x160b,0x160b, +0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b, +0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x160b,0x1f2,0x1617,0x1617,0x1617,0x1617, +0x1617,0x1611,0x161a,0x1617,0x1617,0x1617,0x1617,0x1617,0x1617,0x1617,0x1617,0x1617,0x1614,0x1614,0x1614,0x1614, +0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1617,0x1617,0x1617,0x1617,0x1617,0x1f5,0x1620,0x1620,0x1620,0x1620, +0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620, +0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1620,0x1f8,0x162c,0x162c,0x162c,0x162c, +0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c,0x162c, +0x162c,0x162c,0x1629,0x1629,0x1629,0x1629,0x1629,0x1fb,0x1fb,0x1fb,0x1fb,0x1fb,0x1644,0x1644,0x1647,0x1647, +0x164a,0x163b,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1641,0x1641,0x1641,0x1641, +0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1fe,0x163b,0x163b,0x163b,0x163b,0x163b,0x163b,0x163b,0x1fe,0x1644, +0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644, +0x1644,0x1644,0x1644,0x1644,0x1fe,0x1fe,0x1fe,0x1fe,0x1fe,0x1644,0x1644,0x1644,0x1653,0x1653,0x1653,0x1653, +0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653, +0x1653,0x1653,0x1653,0x1653,0x1653,0x201,0x201,0x201,0x201,0x201,0x201,0x201,0x165c,0x165c,0x165c,0x165c, +0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x165c,0x204,0x204, +0x204,0x204,0x204,0x204,0x204,0x1659,0x1659,0x1659,0x1659,0x204,0x204,0x204,0x1677,0x1677,0x1677,0x1677, +0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x165f,0x1671,0x1671,0x165f,0x165f, +0x165f,0x165f,0x20a,0x20a,0x1671,0x1671,0x1674,0x1674,0x165f,0x165f,0x1671,0x1665,0x1662,0x1668,0x167a,0x167a, +0x166b,0x166b,0x166e,0x166e,0x166e,0x167a,0x172e,0x172e,0x172e,0x172e,0x172e,0x172e,0x172e,0x172e,0x172e,0x172e, +0x172e,0x172e,0x172e,0x172e,0x172b,0x172b,0x172b,0x172b,0x1728,0x1728,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a, +0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a, +0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20a,0x20d,0x167d,0x167d,0x167d, +0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d, +0x167d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x20d,0x1680,0x1680,0x1680,0x1680, +0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x210,0x210,0x210,0x210,0x1680,0x1680,0x1680,0x1680, +0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x210,0x210,0x210,0x210, +0x210,0x210,0x210,0x210,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x210,0x210, +0x210,0x210,0x210,0x210,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x210,0x210,0x210,0x210, +0x210,0x210,0x210,0x210,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680, +0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210, 0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210, -0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x213,0x166b,0x166b,0x166b, -0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b,0x166b, -0x166b,0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x166e,0x166e,0x166e,0x166e, -0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x216,0x216,0x216,0x216,0x166e,0x166e,0x166e,0x166e, -0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x216,0x216,0x216,0x216, -0x216,0x216,0x216,0x216,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x216,0x216, -0x216,0x216,0x216,0x216,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x216,0x216,0x216,0x216, -0x216,0x216,0x216,0x216,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e, -0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216, -0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216, -0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x1671,0x1680,0x1677,0x1674,0x1686,0x1686,0x167a,0x1686, -0x219,0x219,0x219,0x219,0x219,0x219,0x219,0x219,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d,0x167d, -0x167d,0x167d,0x219,0x219,0x219,0x219,0x219,0x219,0x168c,0x168c,0x168c,0x168c,0x168c,0x168c,0x168c,0x168c, -0x168c,0x168c,0x1689,0x1689,0x1689,0x1689,0x1689,0x1689,0x1689,0x1689,0x1689,0x21c,0x21c,0x21c,0x21c,0x21c, -0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x1692,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b, -0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b,0x172b, -0x172b,0x172b,0x21f,0x21f,0x21f,0x171c,0x171c,0x171c,0x1728,0x1728,0x171c,0x171c,0x171c,0x171c,0x1728,0x171c, -0x171c,0x171c,0x171c,0x171f,0x21f,0x21f,0x21f,0x21f,0x1725,0x1725,0x1725,0x1725,0x1725,0x1725,0x1725,0x1725, -0x1725,0x1725,0x1722,0x1722,0x172e,0x172e,0x172e,0x1722,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x222, -0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222, -0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222,0x222, -0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743,0x1743, -0x1743,0x1743,0x1743,0x228,0x1743,0x1743,0x228,0x228,0x228,0x228,0x228,0x1740,0x1740,0x1740,0x1740,0x1740, -0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x22b,0x1746,0x22b,0x1746,0x1746,0x1746,0x1746,0x22b,0x1746, -0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x22b,0x1746, -0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1749,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b, -0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab, -0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752, -0x1752,0x1752,0x1752,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e, -0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f, -0x174f,0x174f,0x174f,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x174c,0x174c,0x174c,0x174c,0x174c,0x174c, -0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x1773,0x1773,0x1773,0x1773,0x1773,0x1773,0x1773,0x1773,0x1776,0x1824,0x1824,0x1824,0x1824,0x1824,0x1824,0x231, -0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1824,0x1821,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x1824,0x231,0x231,0x1824,0x1824,0x1824,0x1824,0x1824,0x1824,0x1824,0x1821,0x181e,0x1824,0x1824,0x1824,0x231, -0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x181e,0x1821,0x1821,0x1821,0x1821,0x1821,0x231,0x231,0x231,0x231, -0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x231, -0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x1773,0x1773,0x1773,0x1773,0x1773,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821, -0x1821,0x1821,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x1773,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231,0x231, -0x1758,0x1758,0x1758,0x1758,0x1755,0x1758,0x1758,0x175b,0x175e,0x175b,0x175b,0x1758,0x234,0x234,0x234,0x234, -0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x1755,0x1755,0x1755,0x1755,0x1755, -0x17b2,0x17b2,0x17b2,0x17b2,0x17a9,0x17a9,0x17a9,0x17a3,0x17a6,0x17a6,0x17a6,0x237,0x237,0x237,0x237,0x237, -0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x17af,0x237,0x237,0x237,0x237,0x17ac,0x17ac, -0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x23a,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd, -0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd, -0x17cd,0x17cd,0x17cd,0x17ca,0x17b8,0x17b8,0x17b8,0x17b8,0x17b8,0x17b8,0x17b8,0x23a,0x17b8,0x17b8,0x17b8,0x17b8, -0x17b8,0x17b8,0x17ca,0x17bb,0x17cd,0x17d0,0x17d0,0x17c4,0x17c1,0x17c1,0x23a,0x23a,0x23a,0x23a,0x23a,0x23a, -0x23a,0x23a,0x23a,0x23a,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17be,0x17be, -0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x17be,0x23a,0x23a,0x23a, -0x17dc,0x17df,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5, -0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x240,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6, -0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6,0x240,0x240,0x17d6,0x17d6,0x17d6,0x17d6,0x17d6, -0x1827,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243, +0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x210,0x1683,0x1692,0x1689,0x1686,0x1698,0x1698,0x168c,0x1698, +0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x213,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f, +0x168f,0x168f,0x213,0x213,0x213,0x213,0x213,0x213,0x169e,0x169e,0x169e,0x169e,0x169e,0x169e,0x169e,0x169e, +0x169e,0x169e,0x169b,0x169b,0x169b,0x169b,0x169b,0x169b,0x169b,0x169b,0x169b,0x216,0x216,0x216,0x216,0x216, +0x216,0x216,0x216,0x216,0x216,0x216,0x216,0x16a4,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740, +0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740,0x1740, +0x1740,0x1740,0x219,0x219,0x219,0x1731,0x1731,0x1731,0x173d,0x173d,0x1731,0x1731,0x1731,0x1731,0x173d,0x1731, +0x1731,0x1731,0x1731,0x1734,0x219,0x219,0x219,0x219,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a, +0x173a,0x173a,0x1737,0x1737,0x1743,0x1743,0x1743,0x1737,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x21c, +0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c, +0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c,0x21c, +0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758, +0x1758,0x1758,0x1758,0x222,0x1758,0x1758,0x222,0x222,0x222,0x222,0x222,0x1755,0x1755,0x1755,0x1755,0x1755, +0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x225,0x175b,0x225,0x175b,0x175b,0x175b,0x175b,0x225,0x175b, +0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x225,0x175b, +0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175b,0x175e,0x225,0x225,0x225,0x225,0x225,0x225, +0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, +0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767, +0x1767,0x1767,0x1767,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x228, +0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764, +0x1764,0x1764,0x1764,0x228,0x228,0x228,0x228,0x228,0x228,0x228,0x1761,0x1761,0x1761,0x1761,0x1761,0x1761, +0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x186f,0x22b,0x22b,0x22b,0x22b, +0x1788,0x1788,0x1788,0x1788,0x1788,0x1788,0x1788,0x1788,0x178b,0x1839,0x1839,0x1839,0x1839,0x1836,0x1839,0x18d5, +0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1839,0x1836,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2, +0x1839,0x18d5,0x18d5,0x1839,0x1839,0x1839,0x1839,0x1839,0x1839,0x1839,0x1836,0x1833,0x1836,0x1839,0x1839,0x22b, +0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1833,0x1836,0x1836,0x1836,0x1836,0x1836,0x18d2,0x22b,0x22b,0x22b, +0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x18d2, +0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x22b,0x22b,0x22b,0x22b, +0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b, +0x1788,0x1788,0x1788,0x1788,0x1788,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836,0x1836, +0x1836,0x1836,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b, +0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b, +0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x1788,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b, +0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x18d2,0x18d5,0x18d5,0x18d5,0x18d5,0x18d5,0x18d5,0x18d5, +0x18d5,0x18d5,0x18d5,0x18d5,0x18d5,0x18d5,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x18d2,0x22b, +0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b, +0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x22b,0x176d,0x176d,0x176d,0x176d,0x176a,0x176d,0x176d,0x1770, +0x1773,0x1770,0x1770,0x176d,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e,0x22e, +0x22e,0x22e,0x22e,0x176a,0x176a,0x176a,0x176a,0x176a,0x17c7,0x17c7,0x17c7,0x17c7,0x17be,0x17be,0x17be,0x17b8, +0x17bb,0x17bb,0x17bb,0x231,0x231,0x231,0x231,0x231,0x17c4,0x17c4,0x17c4,0x17c4,0x17c4,0x17c4,0x17c4,0x17c4, +0x17c4,0x17c4,0x231,0x231,0x231,0x231,0x17c1,0x17c1,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2, +0x17e2,0x234,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2, +0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17e2,0x17df,0x17cd,0x17cd,0x17cd,0x17cd, +0x17cd,0x17cd,0x17cd,0x234,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17cd,0x17df,0x17d0,0x17e2,0x17e5,0x17e5,0x17d9, +0x17d6,0x17d6,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x234,0x17dc,0x17dc,0x17dc,0x17dc, +0x17dc,0x17dc,0x17dc,0x17dc,0x17dc,0x17dc,0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x17d3, +0x17d3,0x17d3,0x17d3,0x17d3,0x17d3,0x234,0x234,0x234,0x17f1,0x17f4,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa, +0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x23a, +0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb, +0x17eb,0x23a,0x23a,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x183c,0x18d8,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d, +0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d, +0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x23d,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa, +0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x17fa,0x240,0x240,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee, +0x17ee,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee,0x240,0x17f7,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee,0x17ee, +0x17ee,0x17f7,0x17ee,0x17ee,0x17f7,0x17ee,0x17ee,0x240,0x240,0x240,0x240,0x240,0x240,0x240,0x240,0x240, +0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x243,0x243,0x243, 0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243,0x243, -0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5,0x17e5, -0x246,0x246,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9, -0x246,0x17e2,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17d9,0x17e2,0x17d9,0x17d9,0x17e2,0x17d9,0x17d9,0x246, -0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x17e8, -0x17e8,0x17e8,0x17e8,0x17e8,0x17e8,0x249,0x249,0x249,0x249,0x249,0x249,0x249,0x249,0x249,0x249,0x249, -0x249,0x249,0x249,0x249,0x249,0x249,0x249,0x249,0x1800,0x1800,0x17f1,0x17eb,0x17eb,0x1800,0x17ee,0x1803, -0x1803,0x1803,0x1803,0x1806,0x1806,0x17fa,0x17f7,0x17f4,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd,0x17fd, -0x17fd,0x17fd,0x24c,0x17fa,0x24c,0x17f4,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c, -0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c, -0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c, -0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x180c,0x24f,0x24f,0x24f,0x24f, -0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809, -0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x1809,0x24f,0x24f,0x24f,0x24f, -0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x252,0x252,0x252, -0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252,0x252, -0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d, -0x182d,0x182d,0x182d,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255, -0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258, -0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258, -0x1770,0x1770,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270,0x270, -0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258, -0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x258,0x921,0x921, -0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6, -0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b,0x25b, -0x10d4,0x10d4,0x10d4,0x10d4,0x1275,0x1275,0x1275,0x1275,0x1275,0x1275,0x1275,0x1275,0x1473,0x1761,0x1761,0x1761, -0x1761,0x1761,0x1761,0x1761,0x1761,0x1761,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e, -0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e, -0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0x25e,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39, -0xc39,0xc39,0xc39,0x1278,0x1278,0x1278,0x261,0x261,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67, -0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67, -0xe67,0xe67,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261, -0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261, -0x261,0x261,0x261,0x261,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49, -0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0x264,0x264,0x264,0x264,0x264, -0x264,0x264,0x264,0x264,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c, -0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c, -0xb4c,0xb4c,0x267,0x267,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d, -0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a, -0x26a,0x26a,0x26a,0x26a,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7, -0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7, -0x13a7,0x13a7,0x26d,0x26d,0x10ec,0x369,0x369,0x375,0xc7b,0x378,0x378,0x378,0x378,0x378,0x378,0x378, -0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378, -0x378,0x378,0x378,0x378,0x375,0x369,0x369,0x369,0x369,0x369,0x369,0x369,0x369,0x375,0x375,0x375, -0x375,0x36f,0x10ef,0x12c6,0x378,0x8ee,0x8f1,0x36c,0x36c,0x10ec,0x12c3,0x12c3,0x37b,0x37b,0x37b,0x37b, -0x37b,0x37b,0x37b,0x37b,0x378,0x378,0x369,0x369,0x879,0x87c,0x909,0x909,0x909,0x909,0x909,0x909, -0x909,0x909,0x909,0x909,0x372,0xf4e,0xf4b,0x12c9,0x12c9,0x12c9,0x12c9,0x12c9,0x149a,0x10f2,0x10f2,0xea0, -0xea0,0xd6e,0xea0,0xea0,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x37b,0x378,0x378, -0x378,0x378,0x378,0x378,0x378,0x37b,0x378,0x378,0x37b,0x378,0x378,0x378,0x378,0x378,0x12c3,0x12c6, -0x36c,0x378,0x375,0x375,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456, -0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0x456,0xb67,0xb67,0xd7a,0xd7a,0x87f, -0xd7d,0x13b9,0x13b9,0x13b9,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459, -0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459,0x459, -0x459,0x459,0x459,0x459,0x45f,0x45f,0x45f,0x1107,0x1107,0x1107,0x1107,0x1107,0x45c,0x45c,0x45c,0x45c, -0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c, -0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x45c,0x1104,0x1104, -0x1104,0x1104,0x1104,0x1104,0x462,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f, -0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f, -0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x45f,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465, -0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465, -0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x465,0x465,0x465,0x465,0x468,0x963, -0xf9c,0xf9c,0xf9f,0xf9c,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465, -0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0x46b,0x465,0xf9f,0xf9c, -0xf9f,0xf9c,0xf9f,0xf9c,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x47a,0x47a,0x47a,0x47a, -0x47a,0x47a,0x47a,0x47a,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x477,0x47a,0x47a,0x47a,0x47a, -0x47a,0x47a,0x47a,0x47a,0x657,0x657,0x65a,0x495,0x666,0x663,0x663,0x660,0x4bf,0x4bf,0x47d,0x47d, -0x47d,0x47d,0x47d,0xa95,0x669,0x4a1,0x681,0x684,0x4b6,0x669,0x4a4,0x4a4,0x495,0x4b0,0x4b0,0x657, -0x4bc,0x4b9,0x65d,0x48f,0x486,0x486,0x489,0x489,0x489,0x489,0x489,0x48c,0x489,0x489,0x489,0x480, -0x4c8,0x4c5,0x4c2,0x4c2,0x675,0x4aa,0x4a7,0x672,0x66f,0x66c,0x67e,0x498,0x67b,0x67b,0x4ad,0x4b0, -0x678,0x678,0x4ad,0x4b0,0x492,0x495,0x495,0x495,0x4b3,0x49e,0x49b,0xb7c,0xa9b,0xa9e,0xa98,0xa98, -0xa98,0xa98,0xb73,0xb73,0xb73,0xb73,0xb79,0xca8,0xca5,0xd89,0xd8c,0xb76,0xd8c,0xd8c,0xd8c,0xd8c, -0xd89,0xd8c,0xd8c,0xb70,0x4fb,0x4fb,0x513,0x693,0x4f8,0x690,0x4fb,0x510,0x4f8,0x693,0x50a,0x513, -0x513,0x513,0x50a,0x50a,0x513,0x513,0x513,0x69c,0x4f8,0x513,0x696,0x4f8,0x507,0x513,0x513,0x513, -0x513,0x513,0x4f8,0x4f8,0x4fe,0x690,0x699,0x4f8,0x513,0x4f8,0x69f,0x4f8,0x513,0x501,0x519,0x6a2, -0x513,0x513,0x504,0x50a,0x513,0x513,0x516,0x513,0x50a,0x50d,0x50d,0x50d,0x50d,0xaaa,0xaa7,0xcab, -0xd9b,0xb97,0xb9a,0xb9a,0xb94,0xb91,0xb91,0xb91,0xb91,0xb9a,0xb97,0xb97,0xb97,0xb97,0xb8e,0xb91, -0xd98,0xeac,0xeaf,0xfa5,0x1116,0x1116,0x1116,0x6a8,0x6a5,0x51c,0x51f,0x51f,0x51f,0x51f,0x51f,0x6a5, -0x6a8,0x6a8,0x6a5,0x51f,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae,0x6ae, -0x528,0x528,0x528,0x528,0x6ab,0x6ab,0x6ab,0x6ab,0x6ab,0x6ab,0x6ab,0x6ab,0x6ab,0x6ab,0x522,0x522, -0x522,0x522,0x522,0x522,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52b,0x534,0x534,0x52e, -0x52e,0x52e,0x531,0x52b,0x52e,0x52e,0x52b,0x52b,0x52b,0x52b,0x52e,0x52e,0x6b1,0x6b1,0x52b,0x52b, -0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x531,0x531,0x531, -0x52e,0x52e,0x6b4,0x52e,0x6b4,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52e,0x52b,0x52e,0x52b,0x52b, -0x52b,0x52b,0x52b,0x52b,0x52e,0x52e,0x52b,0x6b1,0x52b,0x52b,0x52b,0xab0,0xab0,0xab0,0xab0,0xab0, -0xab0,0xab0,0xab0,0xab0,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d,0xb9d, -0x6ba,0x537,0x6ba,0x6ba,0x53a,0x537,0x537,0x6ba,0x6ba,0x53a,0x537,0x6ba,0x53a,0x537,0x537,0x6ba, -0x537,0x6ba,0x546,0x543,0x537,0x6ba,0x537,0x537,0x537,0x537,0x6ba,0x537,0x537,0x6ba,0x6ba,0x6ba, -0x6ba,0x537,0x537,0x6ba,0x53a,0x6ba,0x53a,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x6c0,0x53d,0x6ba,0x53d, -0x53d,0x537,0x537,0x537,0x6ba,0x6ba,0x6ba,0x6ba,0x537,0x537,0x537,0x537,0x6ba,0x6ba,0x537,0x537, -0x537,0x53a,0x537,0x537,0x53a,0x537,0x537,0x53a,0x6ba,0x53a,0x537,0x537,0x6ba,0x537,0x537,0x537, -0x537,0x537,0x6ba,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537, -0x6bd,0x6ba,0x53a,0x537,0x6ba,0x6ba,0x6ba,0x6ba,0x537,0x537,0x6ba,0x6ba,0x537,0x53a,0x6bd,0x6bd, -0x53a,0x53a,0x537,0x537,0x53a,0x53a,0x537,0x537,0x53a,0x53a,0x537,0x537,0x537,0x537,0x537,0x537, -0x53a,0x53a,0x6ba,0x6ba,0x53a,0x53a,0x6ba,0x6ba,0x53a,0x53a,0x537,0x537,0x537,0x537,0x537,0x537, -0x537,0x537,0x537,0x537,0x537,0x6ba,0x537,0x537,0x537,0x6ba,0x537,0x537,0x537,0x537,0x537,0x537, -0x537,0x6ba,0x537,0x537,0x537,0x537,0x537,0x537,0x53a,0x53a,0x53a,0x53a,0x537,0x537,0x537,0x537, -0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x6ba,0x537,0x537,0x537,0x537, -0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537, -0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x537,0x53a,0x53a,0x53a,0x53a, -0x537,0x537,0x537,0x537,0x537,0x537,0x53a,0x53a,0x53a,0x53a,0x537,0x540,0x537,0x537,0xba0,0xba0, -0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0xba0,0x549,0xab3,0x549,0x549, -0x549,0x549,0x549,0x549,0x555,0x552,0x555,0x552,0x549,0x549,0x549,0x549,0x549,0x549,0x6c3,0x549, -0x549,0x549,0x549,0x549,0x549,0x549,0x7c5,0x7c5,0x549,0x549,0x549,0x549,0x54f,0x54f,0x549,0x549, -0x549,0x549,0x549,0x549,0x54c,0x7cb,0x7c8,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549, -0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549, -0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0x549,0xab3,0xba6,0xab3,0xab3,0xab3, -0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558, +0x1815,0x1815,0x1806,0x1800,0x1800,0x1815,0x1803,0x1818,0x1818,0x1818,0x1818,0x181b,0x181b,0x180f,0x180c,0x1809, +0x1812,0x1812,0x1812,0x1812,0x1812,0x1812,0x1812,0x1812,0x1812,0x1812,0x246,0x180f,0x246,0x1809,0x246,0x246, +0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246, +0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246,0x246, +0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821,0x1821, +0x1821,0x1821,0x1821,0x1821,0x249,0x249,0x249,0x249,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e, +0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e,0x181e, +0x181e,0x181e,0x181e,0x181e,0x249,0x249,0x249,0x249,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f, +0x183f,0x183f,0x183f,0x183f,0x183f,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c, +0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x24c,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842, +0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x24f,0x24f,0x24f,0x24f,0x24f, +0x24f,0x24f,0x24f,0x24f,0x24f,0x24f,0x24f,0x24f,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de, +0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de, +0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x18de,0x252,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x255, +0x187e,0x187e,0x255,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e, +0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x187e,0x1872,0x1872,0x1872,0x1872,0x1872,0x1872,0x255, +0x255,0x255,0x1872,0x255,0x1872,0x1872,0x255,0x1872,0x1872,0x1872,0x1875,0x1872,0x1878,0x1878,0x1881,0x1872, +0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x255,0x187b,0x187b,0x187b,0x187b,0x187b,0x187b,0x187b,0x187b, +0x187b,0x187b,0x255,0x255,0x255,0x255,0x255,0x255,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1, +0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1, +0x18e1,0x18e1,0x18e1,0x18e1,0x258,0x258,0x258,0x258,0x1899,0x1899,0x1899,0x1899,0x25b,0x25b,0x189c,0x189c, +0x189c,0x189c,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1896, +0x1887,0x188a,0x188d,0x189f,0x189f,0x25b,0x1890,0x1890,0x18ae,0x18b1,0x18c0,0x18c0,0x18b1,0x18b4,0x18ae,0x18ab, +0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x261,0x1899,0x1884,0x1884,0x1884,0x1884,0x1884,0x1884,0x1896, +0x1896,0x1884,0x1884,0x1884,0x1899,0x1899,0x1899,0x1899,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264, +0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264, +0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x18db,0x27f,0x27f,0x27f,0x27f,0x27f,0x27f,0x27f, +0x27f,0x27f,0x27f,0x27f,0x27f,0x27f,0x27f,0x27f,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264, +0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264,0x264, +0x264,0x264,0x264,0x264,0x264,0x264,0x933,0x933,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8, +0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0x267,0x267, +0x267,0x267,0x267,0x267,0x267,0x267,0x267,0x267,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6, +0x18c6,0x18c6,0x18c6,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a, +0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0x26a,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b, +0xc4b,0xc4b,0xc4b,0x128d,0x128d,0x128d,0x26d,0x26d,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c, +0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c, +0xe7c,0xe7c,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d, +0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d,0x26d, +0x26d,0x26d,0x26d,0x26d,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b, +0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0x270,0x270,0x270,0x270,0x270, +0x270,0x270,0x270,0x270,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e, +0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e, +0xb5e,0xb5e,0x273,0x273,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2, +0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x276,0x276,0x276,0x276,0x276,0x276,0x276, +0x276,0x276,0x276,0x276,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc, +0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc, +0x13bc,0x13bc,0x279,0x279,0x1785,0x1785,0x27c,0x27c,0x27c,0x27c,0x27c,0x27c,0x27c,0x27c,0x27c,0x27c, +0x27c,0x27c,0x27c,0x27c,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db, +0x18db,0x18db,0x18db,0x18db,0x1101,0x378,0x378,0x384,0xc8d,0x387,0x387,0x387,0x387,0x387,0x387,0x387, +0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387, +0x387,0x387,0x387,0x387,0x384,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x378,0x384,0x384,0x384, +0x384,0x37e,0x1104,0x12db,0x387,0x900,0x903,0x37b,0x37b,0x1101,0x12d8,0x12d8,0x38a,0x38a,0x38a,0x38a, +0x38a,0x38a,0x38a,0x38a,0x387,0x387,0x378,0x378,0x87f,0x882,0x91b,0x91b,0x91b,0x91b,0x91b,0x91b, +0x91b,0x91b,0x91b,0x91b,0x381,0xf63,0xf60,0x12de,0x12de,0x12de,0x12de,0x12de,0x14af,0x1107,0x1107,0xeb5, +0xeb5,0xd80,0xeb5,0xeb5,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x387,0x38a,0x387,0x387, +0x387,0x387,0x387,0x387,0x387,0x38a,0x387,0x387,0x38a,0x387,0x387,0x387,0x387,0x387,0x12d8,0x12db, +0x37b,0x387,0x384,0x384,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x12e4,0x429,0x429, +0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x429,0x12e4,0x1857, +0x1857,0xf81,0x41a,0x423,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465, +0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0x465,0xb79,0xb79,0xd8c,0xd8c,0x885, +0xd8f,0x13ce,0x13ce,0x13ce,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468, +0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468,0x468, +0x468,0x468,0x468,0x468,0x46e,0x46e,0x46e,0x111c,0x111c,0x111c,0x111c,0x111c,0x46b,0x46b,0x46b,0x46b, +0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b, +0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x46b,0x1119,0x1119, +0x1119,0x1119,0x1119,0x1119,0x471,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, +0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e, +0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x46e,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474, +0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474, +0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x474,0x474,0x474,0x474,0x477,0x975, +0xfb1,0xfb1,0xfb4,0xfb1,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474, +0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0x47a,0x474,0xfb4,0xfb1, +0xfb4,0xfb1,0xfb4,0xfb1,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x489,0x489,0x489,0x489, +0x489,0x489,0x489,0x489,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x486,0x489,0x489,0x489,0x489, +0x489,0x489,0x489,0x489,0x666,0x666,0x669,0x4a4,0x675,0x672,0x672,0x66f,0x4ce,0x4ce,0x48c,0x48c, +0x48c,0x48c,0x48c,0xaa7,0x678,0x4b0,0x690,0x693,0x4c5,0x678,0x4b3,0x4b3,0x4a4,0x4bf,0x4bf,0x666, +0x4cb,0x4c8,0x66c,0x49e,0x495,0x495,0x498,0x498,0x498,0x498,0x498,0x49b,0x498,0x498,0x498,0x48f, +0x4d7,0x4d4,0x4d1,0x4d1,0x684,0x4b9,0x4b6,0x681,0x67e,0x67b,0x68d,0x4a7,0x68a,0x68a,0x4bc,0x4bf, +0x687,0x687,0x4bc,0x4bf,0x4a1,0x4a4,0x4a4,0x4a4,0x4c2,0x4ad,0x4aa,0xb8e,0xaad,0xab0,0xaaa,0xaaa, +0xaaa,0xaaa,0xb85,0xb85,0xb85,0xb85,0xb8b,0xcba,0xcb7,0xd9b,0xd9e,0xb88,0xd9e,0xd9e,0xd9e,0xd9e, +0xd9b,0xd9e,0xd9e,0xb82,0x4fb,0x4fb,0x4fb,0x4fb,0x4fb,0x4fb,0x4fb,0x4f8,0x4fe,0x714,0x4fb,0x978, +0x999,0xab3,0xab3,0xab3,0xb94,0xb94,0xda4,0xda4,0xda4,0xda4,0x1125,0x1128,0x1128,0x12f9,0x149d,0x14c7, +0x14ca,0x14ca,0x16dd,0x185a,0x50a,0x50a,0x522,0x6a2,0x507,0x69f,0x50a,0x51f,0x507,0x6a2,0x519,0x522, +0x522,0x522,0x519,0x519,0x522,0x522,0x522,0x6ab,0x507,0x522,0x6a5,0x507,0x516,0x522,0x522,0x522, +0x522,0x522,0x507,0x507,0x50d,0x69f,0x6a8,0x507,0x522,0x507,0x6ae,0x507,0x522,0x510,0x528,0x6b1, +0x522,0x522,0x513,0x519,0x522,0x522,0x525,0x522,0x519,0x51c,0x51c,0x51c,0x51c,0xabc,0xab9,0xcbd, +0xdad,0xba9,0xbac,0xbac,0xba6,0xba3,0xba3,0xba3,0xba3,0xbac,0xba9,0xba9,0xba9,0xba9,0xba0,0xba3, +0xdaa,0xec1,0xec4,0xfba,0x112b,0x112b,0x112b,0x6b7,0x6b4,0x52b,0x52e,0x52e,0x52e,0x52e,0x52e,0x6b4, +0x6b7,0x6b7,0x6b4,0x52e,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd,0x6bd, +0x537,0x537,0x537,0x537,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x6ba,0x531,0x531, +0x531,0x531,0x531,0x531,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53a,0x543,0x543,0x53d, +0x53d,0x53d,0x540,0x53a,0x53d,0x53d,0x53a,0x53a,0x53a,0x53a,0x53d,0x53d,0x6c0,0x6c0,0x53a,0x53a, +0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x540,0x540,0x540, +0x53d,0x53d,0x6c3,0x53d,0x6c3,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53d,0x53a,0x53d,0x53a,0x53a, +0x53a,0x53a,0x53a,0x53a,0x53d,0x53d,0x53a,0x6c0,0x53a,0x53a,0x53a,0xac2,0xac2,0xac2,0xac2,0xac2, +0xac2,0xac2,0xac2,0xac2,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf,0xbaf, +0x6c9,0x546,0x6c9,0x6c9,0x549,0x546,0x546,0x6c9,0x6c9,0x549,0x546,0x6c9,0x549,0x546,0x546,0x6c9, +0x546,0x6c9,0x555,0x552,0x546,0x6c9,0x546,0x546,0x546,0x546,0x6c9,0x546,0x546,0x6c9,0x6c9,0x6c9, +0x6c9,0x546,0x546,0x6c9,0x549,0x6c9,0x549,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6cf,0x54c,0x6c9,0x54c, +0x54c,0x546,0x546,0x546,0x6c9,0x6c9,0x6c9,0x6c9,0x546,0x546,0x546,0x546,0x6c9,0x6c9,0x546,0x546, +0x546,0x549,0x546,0x546,0x549,0x546,0x546,0x549,0x6c9,0x549,0x546,0x546,0x6c9,0x546,0x546,0x546, +0x546,0x546,0x6c9,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546, +0x6cc,0x6c9,0x549,0x546,0x6c9,0x6c9,0x6c9,0x6c9,0x546,0x546,0x6c9,0x6c9,0x546,0x549,0x6cc,0x6cc, +0x549,0x549,0x546,0x546,0x549,0x549,0x546,0x546,0x549,0x549,0x546,0x546,0x546,0x546,0x546,0x546, +0x549,0x549,0x6c9,0x6c9,0x549,0x549,0x6c9,0x6c9,0x549,0x549,0x546,0x546,0x546,0x546,0x546,0x546, +0x546,0x546,0x546,0x546,0x546,0x6c9,0x546,0x546,0x546,0x6c9,0x546,0x546,0x546,0x546,0x546,0x546, +0x546,0x6c9,0x546,0x546,0x546,0x546,0x546,0x546,0x549,0x549,0x549,0x549,0x546,0x546,0x546,0x546, +0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x6c9,0x546,0x546,0x546,0x546, +0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546, +0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x546,0x549,0x549,0x549,0x549, +0x546,0x546,0x546,0x546,0x546,0x546,0x549,0x549,0x549,0x549,0x546,0x54f,0x546,0x546,0xbb2,0xbb2, +0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0xbb2,0x558,0xac5,0x558,0x558, +0x558,0x558,0x558,0x558,0x564,0x561,0x564,0x561,0x558,0x558,0x558,0x558,0x558,0x558,0x6d2,0x558, +0x558,0x558,0x558,0x558,0x558,0x558,0x7d4,0x7d4,0x558,0x558,0x558,0x558,0x55e,0x55e,0x558,0x558, +0x558,0x558,0x558,0x558,0x55b,0x7da,0x7d7,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558, 0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558, -0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x55e,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c, -0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xc0c,0xd20, -0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5, -0x6d5,0x6d5,0x6d5,0x6d5,0x561,0x564,0x564,0x564,0x564,0x564,0x564,0x564,0x564,0x564,0x564,0x564, -0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x564,0x564,0x564,0x564, +0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0x558,0xac5,0xbb8,0xac5,0xac5,0xac5, +0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567, +0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567,0x567, +0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x56d,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e, +0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xc1e,0xd32, +0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4, +0x6e4,0x6e4,0x6e4,0x6e4,0x570,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573, +0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x573,0x573,0x573,0x573, +0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4, +0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7,0x6e7, +0x576,0x576,0x6e7,0x6e7,0x6e7,0x6e7,0xbbb,0xbbb,0xbbb,0xbbb,0xbbb,0xbbb,0xbbb,0xbbb,0xbbb,0xbbb, +0x6ed,0x6ed,0x579,0x6ea,0x6ea,0x6ea,0x6ea,0x6ea,0x6ea,0x6ea,0x57c,0x57c,0x579,0x579,0x57f,0x57f, +0x57f,0x57f,0x6ed,0x6ed,0x57f,0x57f,0x6f0,0x6ed,0x579,0x579,0x579,0x579,0x6ed,0x6ed,0x57f,0x57f, +0x6f0,0x6ed,0x579,0x579,0x579,0x579,0x6ed,0x6ed,0x6ea,0x579,0x57f,0x6ed,0x579,0x579,0x6ea,0x6ed, +0x6ed,0x6ed,0x57f,0x57f,0x579,0x579,0x579,0x579,0x579,0x579,0x579,0x579,0x579,0x579,0x579,0x579, +0x579,0x579,0x6ed,0x6ea,0x6ed,0x6ea,0x579,0x57f,0x57f,0x57f,0x57f,0x57f,0x57f,0x579,0x579,0x6ea, +0xacb,0xacb,0xacb,0xacb,0xacb,0xacb,0xacb,0xacb,0xbbe,0xbbe,0xbbe,0xbc1,0xbc1,0xc36,0xc36,0xbbe, +0x58b,0x58b,0x58b,0x58b,0x588,0x6ff,0x6ff,0x582,0x582,0x6f3,0x582,0x582,0x582,0x582,0x6f9,0x6f3, +0x582,0x588,0x582,0x582,0xd3b,0xd3b,0xbc4,0xbc4,0xdbc,0xace,0x585,0x585,0x6f6,0x58e,0x6f6,0x585, +0x588,0x582,0x588,0x588,0x582,0x582,0x588,0x582,0x582,0x582,0x588,0x582,0x582,0x582,0x588,0x588, +0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x588,0x58b,0x58b,0x585,0x582,0x582,0x582,0x582, +0x705,0x582,0x705,0x582,0x582,0x582,0x582,0x582,0x7dd,0x7dd,0x7dd,0x7dd,0x7dd,0x7dd,0x7dd,0x7dd, +0x7dd,0x7dd,0x7dd,0x7dd,0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x582,0x582, +0x702,0x6ff,0x591,0x702,0x6f3,0x6f9,0x588,0x6f3,0x6fc,0x6f3,0x6f3,0x582,0x6f3,0x6ff,0x591,0x6ff, +0xace,0xace,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbca,0xbc7,0xbc7,0xdb3,0xe73, +0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594,0x594, +0x594,0x594,0x594,0x594,0x597,0x1383,0x1383,0x1383,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597, +0x14d3,0x59d,0x5a9,0x59d,0x59d,0x1383,0x597,0x597,0x5ac,0x5a9,0x1386,0x1386,0x5af,0x5af,0x597,0x5a3, +0x597,0x597,0x5a3,0x597,0x5a3,0x597,0x5a3,0x597,0x597,0x597,0x597,0x597,0x597,0x5a3,0x597,0x597, +0x597,0x597,0x597,0x597,0x1383,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x5a3, +0x5a3,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x70b,0x597,0x597,0x597,0x597,0x597,0x597, +0x5a3,0x597,0x597,0x5a3,0x597,0x597,0x597,0x597,0x1383,0x597,0x1383,0x597,0x597,0x597,0x597,0x1383, +0x1383,0x1383,0x597,0x1287,0x597,0x597,0x597,0x5a0,0x5a0,0x5a0,0x5a0,0x1305,0x1305,0x597,0x59a,0x5a6, +0x5ac,0x597,0x597,0x597,0xbd0,0xbcd,0xbd0,0xbcd,0xbd0,0xbcd,0xbd0,0xbcd,0xbd0,0xbcd,0xbd0,0xbcd, +0xbd0,0xbcd,0x708,0x708,0x708,0x708,0x708,0x708,0x708,0x708,0x708,0x708,0x597,0x5a3,0x597,0x597, +0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x1383,0x597,0x597,0x597, +0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x597,0x1383,0x5d0,0x5d0,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3, +0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d0,0x5d6,0x5c7,0x5ca,0x5d6,0x5d6,0x5d6,0x5d6, +0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6, +0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5cd,0x5cd,0x5cd,0x5cd,0x5cd,0x5cd, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0, +0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0, +0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0, +0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0, +0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d6,0x5d0, +0x5d3,0x5d9,0x5d6,0x5d0,0x5d3,0x5d9,0x5d6,0x5d0,0x5d6,0x5d0,0x1308,0x1308,0x1308,0x1308,0x1308,0x1308, +0x1308,0x1308,0x1308,0x1308,0x1308,0x1308,0x1308,0x1308,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d3,0x5d9, +0x5d3,0x5d9,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0,0x5d6,0x5d0, +0x5d3,0x5d6,0x5d0,0x5d3,0x5d6,0x5d0,0x5d3,0x5d9,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3, +0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6, +0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d3,0x5d0,0x5d3,0x5d0,0x5d3,0x5d0,0x5d0, +0x5d3,0x5d0,0x5d0,0x5d3,0x5d0,0x5d3,0x5d0,0x5d0,0x5d3,0x5d0,0x5d3,0x5d3,0x5d0,0x5d0,0x5d0,0x5d3, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0, +0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d3,0x5d0,0x5d0, +0x5d3,0x5d0,0x5d3,0x5d0,0x5d0,0x5d0,0x5d0,0x5d0,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3, +0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3, +0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d3,0x5d9,0x5d6,0x5d6,0x5d6,0x5d6, +0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6, +0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d9,0x5d9,0x5d9,0x5d9, +0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9,0x5d9, +0x5d9,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5d6,0x5dc,0x5dc,0x5dc,0x5dc, +0xfc6,0xfc6,0xfc6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x14d6,0x16e3,0x16e3,0x831,0x837,0x837,0x843, +0x843,0x834,0x82b,0x834,0x82b,0x834,0x82b,0x834,0x82b,0x834,0x82b,0x834,0x5eb,0x5eb,0x5e5,0x5eb, +0x5e5,0x5eb,0x5e5,0x5eb,0x5e5,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb, +0x5e5,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5eb, +0x5e5,0x5eb,0x5e5,0x5eb,0x5e5,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8, +0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8, +0x5ee,0x5eb,0x5e5,0x5e8,0x5ee,0x5eb,0x5e5,0x5e8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8, +0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d5,0x6d5,0x6d5,0x6d5, 0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5, -0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8,0x6d8, -0x567,0x567,0x6d8,0x6d8,0x6d8,0x6d8,0xba9,0xba9,0xba9,0xba9,0xba9,0xba9,0xba9,0xba9,0xba9,0xba9, -0x6de,0x6de,0x56a,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x56d,0x56d,0x56a,0x56a,0x570,0x570, -0x570,0x570,0x6de,0x6de,0x570,0x570,0x6e1,0x6de,0x56a,0x56a,0x56a,0x56a,0x6de,0x6de,0x570,0x570, -0x6e1,0x6de,0x56a,0x56a,0x56a,0x56a,0x6de,0x6de,0x6db,0x56a,0x570,0x6de,0x56a,0x56a,0x6db,0x6de, -0x6de,0x6de,0x570,0x570,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a,0x56a, -0x56a,0x56a,0x6de,0x6db,0x6de,0x6db,0x56a,0x570,0x570,0x570,0x570,0x570,0x570,0x56a,0x56a,0x6db, -0xab9,0xab9,0xab9,0xab9,0xab9,0xab9,0xab9,0xab9,0xbac,0xbac,0xbac,0xbaf,0xbaf,0xc24,0xc24,0xbac, -0x57c,0x57c,0x57c,0x57c,0x579,0x6f0,0x6f0,0x573,0x573,0x6e4,0x573,0x573,0x573,0x573,0x6ea,0x6e4, -0x573,0x579,0x573,0x573,0xd29,0xd29,0xbb2,0xbb2,0xda7,0xabc,0x576,0x576,0x6e7,0x57f,0x6e7,0x576, -0x579,0x573,0x579,0x579,0x573,0x573,0x579,0x573,0x573,0x573,0x579,0x573,0x573,0x573,0x579,0x579, -0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x579,0x57c,0x57c,0x576,0x573,0x573,0x573,0x573, -0x6f3,0x573,0x6f3,0x573,0x573,0x573,0x573,0x573,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce, -0x7ce,0x7ce,0x7ce,0x7ce,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573,0x573, -0x6f3,0x6f0,0x582,0x6f3,0x6e4,0x6ea,0x579,0x6e4,0x6ed,0x6e4,0x6e4,0x573,0x6e4,0x6f0,0x582,0x6f0, -0xabc,0xabc,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb8,0xbb5,0xbb5,0xda1,0xe5e, -0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585,0x585, -0x585,0x585,0x585,0x585,0x588,0x136e,0x136e,0x136e,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588, -0x14be,0x58e,0x59a,0x58e,0x58e,0x136e,0x588,0x588,0x59a,0x59a,0x1371,0x1371,0x5a0,0x5a0,0x588,0x594, -0x588,0x588,0x594,0x588,0x594,0x588,0x594,0x588,0x588,0x588,0x588,0x588,0x588,0x594,0x588,0x588, -0x588,0x588,0x588,0x588,0x136e,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x594, -0x594,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x6f9,0x588,0x588,0x588,0x588,0x588,0x588, -0x594,0x588,0x588,0x594,0x588,0x588,0x588,0x588,0x136e,0x588,0x136e,0x588,0x588,0x588,0x588,0x136e, -0x136e,0x136e,0x588,0x1272,0x588,0x588,0x588,0x591,0x591,0x591,0x591,0x12f0,0x12f0,0x588,0x58b,0x597, -0x59d,0x588,0x588,0x588,0xbbe,0xbbb,0xbbe,0xbbb,0xbbe,0xbbb,0xbbe,0xbbb,0xbbe,0xbbb,0xbbe,0xbbb, -0xbbe,0xbbb,0x6f6,0x6f6,0x6f6,0x6f6,0x6f6,0x6f6,0x6f6,0x6f6,0x6f6,0x6f6,0x588,0x594,0x588,0x588, -0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x136e,0x588,0x588,0x588, -0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x588,0x136e,0x5c1,0x5c1,0x5c1,0x5c1, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4, -0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5c1,0x5c7,0x5b8,0x5bb,0x5c7,0x5c7,0x5c7,0x5c7, -0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, -0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5be,0x5be,0x5be,0x5be,0x5be,0x5be, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1, -0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1, -0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1, -0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1, -0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c7,0x5c1, -0x5c4,0x5ca,0x5c7,0x5c1,0x5c4,0x5ca,0x5c7,0x5c1,0x5c7,0x5c1,0x12f3,0x12f3,0x12f3,0x12f3,0x12f3,0x12f3, -0x12f3,0x12f3,0x12f3,0x12f3,0x12f3,0x12f3,0x12f3,0x12f3,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c4,0x5ca, -0x5c4,0x5ca,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1,0x5c7,0x5c1, -0x5c4,0x5c7,0x5c1,0x5c4,0x5c7,0x5c1,0x5c4,0x5ca,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4, -0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, -0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c4,0x5c1,0x5c4,0x5c1,0x5c4,0x5c1,0x5c1, -0x5c4,0x5c1,0x5c1,0x5c4,0x5c1,0x5c4,0x5c1,0x5c1,0x5c4,0x5c1,0x5c4,0x5c4,0x5c1,0x5c1,0x5c1,0x5c4, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1, -0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c4,0x5c1,0x5c1, -0x5c4,0x5c1,0x5c4,0x5c1,0x5c1,0x5c1,0x5c1,0x5c1,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4, -0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4, -0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5c4,0x5ca,0x5c7,0x5c7,0x5c7,0x5c7, -0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7, -0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5ca,0x5ca,0x5ca,0x5ca, -0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca,0x5ca, -0x5ca,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5c7,0x5cd,0x5cd,0x5cd,0x5cd, -0xfb1,0xfb1,0xfb1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x14c1,0x16ce,0x16ce,0x82b,0x831,0x831,0x83d, -0x83d,0x82e,0x825,0x82e,0x825,0x82e,0x825,0x82e,0x825,0x82e,0x825,0x82e,0x5dc,0x5dc,0x5d6,0x5dc, -0x5d6,0x5dc,0x5d6,0x5dc,0x5d6,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5dc,0x5d6,0x5d9,0x5df,0x5dc, -0x5d6,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5dc, -0x5d6,0x5dc,0x5d6,0x5dc,0x5d6,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9, -0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9, -0x5df,0x5dc,0x5d6,0x5d9,0x5df,0x5dc,0x5d6,0x5d9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9, -0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c9,0x6c6,0x6c6,0x6c6,0x6c6, -0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6, -0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6c6,0x6cf,0x6cf, -0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6d2,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf, -0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cf,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc, -0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6cc,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5, -0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5, -0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc, -0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc, -0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0x6fc,0xc12,0x891,0x88b,0x888,0x88e,0x885,0x711,0x714, -0x714,0x714,0x714,0x714,0x714,0x714,0x714,0x714,0x897,0x711,0x711,0x711,0x711,0x711,0x711,0x711, -0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711, -0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x711,0x894,0x894,0x717,0x8a6,0x8a9,0x8af, -0x7d1,0x7dd,0x8c4,0x7da,0x89d,0x89a,0x89d,0x89a,0x8a3,0x8a0,0x8a3,0x8a0,0x89d,0x89a,0x7d7,0x8af, -0x89d,0x89a,0x89d,0x89a,0x89d,0x89a,0x89d,0x89a,0x8b2,0x8bb,0x8b8,0x8b8,0x71d,0x759,0x759,0x759, -0x759,0x759,0x759,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753, -0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x720,0x73b,0x71a,0x741,0x744,0x73e,0x756,0x756,0x756, -0x756,0x756,0x756,0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x750, -0x750,0x750,0x750,0x750,0x750,0x750,0x750,0x720,0x73b,0x71a,0x73b,0xc15,0x7bf,0x7bf,0x7bf,0x7bf, -0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf, -0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x7bf,0x126c,0x126c, -0x126c,0x126c,0x126c,0x7c2,0x7d7,0x7da,0x7da,0x7da,0x7da,0x7da,0x7da,0x7da,0x7da,0x7da,0x8fa,0x8fa, -0x8fa,0x8fa,0x7e0,0x7e0,0x8b5,0x8c1,0x8c1,0x8c1,0x8c1,0x8be,0x7d4,0x8ac,0xae0,0xae0,0xae0,0xc27, -0xc45,0xc42,0xafb,0x882,0x7e6,0x7e3,0x7e6,0x7e9,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e6,0x7e3,0x7e3, -0x7e3,0x7e3,0x7e3,0x7e3,0x7e6,0x7e6,0x7e3,0x7e6,0x7e6,0x7e3,0x7e6,0x7e6,0x7e3,0x7e6,0x7e6,0x7e3, -0x7e6,0x7e6,0x7e3,0x7e3,0xc48,0x7f8,0x7f2,0x7f8,0x7f2,0x7f8,0x7f2,0x7f8,0x7f2,0x7f8,0x7f2,0x7f2, -0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2, -0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f8,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f5,0x7f2,0x7f2, -0x7f2,0x7f2,0x7f2,0x7f2,0x7f5,0x7f5,0x7f2,0x7f5,0x7f5,0x7f2,0x7f5,0x7f5,0x7f2,0x7f5,0x7f5,0x7f2, -0x7f5,0x7f5,0x7f2,0x7f2,0x7f2,0x7f2,0x7f2,0x7f8,0x7f2,0x7f8,0x7f2,0x7f8,0x7f2,0x7f2,0x7f2,0x7f2, -0x7f2,0x7f2,0x7f8,0x7f2,0x7f2,0x7f2,0x7f2,0x7f2,0x7f5,0x7f8,0x7f8,0x7f5,0x7f5,0x7f5,0x7f5,0x8ca, -0x8cd,0x7fb,0x7fe,0xc30,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804, -0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804, -0x804,0x804,0x804,0x804,0x807,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804, -0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804,0x804, -0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810, -0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0x810,0xd32,0xd32,0xe61,0x80a, -0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0xd2c,0xd2c,0xd2c,0xd2c, -0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813,0x813, -0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df, -0x8df,0x816,0x816,0x816,0x816,0x816,0x816,0xd35,0xd35,0xd35,0xd35,0x8e2,0x8e2,0x8e2,0x8e2,0x8e2, +0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6d5,0x6de,0x6de, +0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6e1,0x6de,0x6de,0x6de,0x6de,0x6de, +0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6de,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db, +0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6db,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4, +0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4, +0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x6e4,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e, +0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e, +0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0x70e,0xc24,0x897,0x891,0x88e,0x894,0x88b,0x723,0x726, +0x726,0x726,0x726,0x726,0x726,0x726,0x726,0x726,0x89d,0x723,0x723,0x723,0x723,0x723,0x723,0x723, +0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723, +0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x723,0x89a,0x89a,0x72c,0x768,0x768,0x768, +0x768,0x768,0x768,0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x762, +0x762,0x762,0x762,0x762,0x762,0x762,0x762,0x72f,0x74a,0x729,0x750,0x753,0x74d,0x765,0x765,0x765, +0x765,0x765,0x765,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f, +0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x75f,0x72f,0x74a,0x729,0x74a,0xc27,0x7ce,0x7ce,0x7ce,0x7ce, +0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce, +0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x7ce,0x1281,0x1281, +0x1281,0x1281,0x1281,0x7d1,0x8a0,0x8b8,0x8bb,0x8c1,0x8a3,0x7e3,0x8d6,0x7e0,0x8af,0x8a9,0x8af,0x8a9, +0x8b5,0x8b2,0x8b5,0x8b2,0x8af,0x8a9,0x8ac,0x8c1,0x8af,0x8a9,0x8af,0x8a9,0x8af,0x8a9,0x8af,0x8a9, +0x8c4,0x8cd,0x8ca,0x8ca,0x8ac,0x7e0,0x7e0,0x7e0,0x7e0,0x7e0,0x7e0,0x7e0,0x7e0,0x7e0,0x90c,0x90c, +0x90c,0x90c,0x7e6,0x7e6,0x8c7,0x8d3,0x8d3,0x8d3,0x8d3,0x8d0,0x8a6,0x8be,0xaf2,0xaf2,0xaf2,0xc39, +0xc57,0xc54,0xb0d,0x888,0x7ec,0x7e9,0x7ec,0x7ef,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7ec,0x7e9,0x7e9, +0x7e9,0x7e9,0x7e9,0x7e9,0x7ec,0x7ec,0x7e9,0x7ec,0x7ec,0x7e9,0x7ec,0x7ec,0x7e9,0x7ec,0x7ec,0x7e9, +0x7ec,0x7ec,0x7e9,0x7e9,0xc5a,0x7fe,0x7f8,0x7fe,0x7f8,0x7fe,0x7f8,0x7fe,0x7f8,0x7fe,0x7f8,0x7f8, +0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8, +0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7fe,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7fb,0x7f8,0x7f8, +0x7f8,0x7f8,0x7f8,0x7f8,0x7fb,0x7fb,0x7f8,0x7fb,0x7fb,0x7f8,0x7fb,0x7fb,0x7f8,0x7fb,0x7fb,0x7f8, +0x7fb,0x7fb,0x7f8,0x7f8,0x7f8,0x7f8,0x7f8,0x7fe,0x7f8,0x7fe,0x7f8,0x7fe,0x7f8,0x7f8,0x7f8,0x7f8, +0x7f8,0x7f8,0x7fe,0x7f8,0x7f8,0x7f8,0x7f8,0x7f8,0x7fb,0x7fe,0x7fe,0x7fb,0x7fb,0x7fb,0x7fb,0x8dc, +0x8df,0x801,0x804,0xc42,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a, +0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a, +0x80a,0x80a,0x80a,0x80a,0x80d,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a, +0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a,0x80a, 0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816, -0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816, -0x816,0x816,0xd35,0xd35,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819, +0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0x816,0xd44,0xd44,0xe76,0x810, +0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0xd3e,0xd3e,0xd3e,0xd3e, 0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819,0x819, -0x819,0x819,0x819,0x819,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x81c,0x81c,0x81c,0x81c, +0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1, +0x8f1,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0xd47,0xd47,0xd47,0xd47,0x8f4,0x8f4,0x8f4,0x8f4,0x8f4, 0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c, -0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0xe64,0xe64, -0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64, -0xe64,0xe64,0xe64,0xe64,0x10d4,0x10d4,0x10d4,0x10d4,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f, +0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c,0x81c, +0x81c,0x81c,0xd47,0xd47,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f, 0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f, -0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x822,0x822,0x81f,0x822,0x81f,0x822, -0x822,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x81f,0x822,0x81f,0x822,0x81f,0x822, -0x822,0x81f,0x81f,0x822,0x822,0x822,0x81f,0x81f,0x81f,0x81f,0x1476,0x1476,0xc39,0xc39,0xc39,0xc39, -0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0x8d6,0x8d6,0x8d6,0x8d6, -0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6, -0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x8d6,0x12a8,0x12a8,0x12a8,0x12a8, -0x1251,0x1251,0x1251,0x1251,0x1251,0x1251,0x1251,0x1251,0xd2c,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33, -0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9, -0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8dc, -0x8d9,0x8dc,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0x8d9, -0x8d9,0x8d9,0x8d9,0x8d9,0x8d9,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33,0xc33, -0xc33,0xc33,0xc33,0xc33,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df, -0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df,0x8df, -0x8df,0x8df,0x8df,0xd35,0x95d,0x93f,0x93f,0x93f,0x93f,0x939,0x93f,0x93f,0x951,0x93f,0x93f,0x93c, -0x948,0x94e,0x94e,0x94e,0x94e,0x94e,0x951,0x939,0x945,0x939,0x939,0x939,0x930,0x930,0x939,0x939, -0x939,0x939,0x939,0x939,0x954,0x954,0x954,0x954,0x954,0x954,0x954,0x954,0x954,0x954,0x939,0x939, -0x939,0x939,0x939,0x939,0x939,0x939,0x939,0x939,0x93c,0x930,0x939,0x930,0x939,0x930,0x94b,0x942, -0x94b,0x942,0x95a,0x95a,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969, -0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969,0x969, -0x969,0x969,0x969,0x969,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c, -0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c,0x96c, -0x96c,0x96c,0x96c,0x96c,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f, -0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f,0x96f, -0x96f,0x96f,0x96f,0x96f,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978, -0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978, -0x978,0x978,0x972,0x972,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b, -0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b, -0x97b,0x97b,0x975,0x975,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978, -0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978,0x978, -0x978,0x978,0x978,0x978,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b, +0x81f,0x81f,0x81f,0x81f,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x822,0x822,0x822,0x822, +0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822, +0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0x822,0xe79,0xe79, +0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79,0xe79, +0xe79,0xe79,0xe79,0xe79,0x10e9,0x10e9,0x10e9,0x10e9,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825, +0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825, +0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x828,0x828,0x825,0x828,0x825,0x828, +0x828,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x825,0x828,0x825,0x828,0x825,0x828, +0x828,0x825,0x825,0x828,0x828,0x828,0x825,0x825,0x825,0x825,0x148b,0x148b,0xc4b,0xc4b,0xc4b,0xc4b, +0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0x8e8,0x8e8,0x8e8,0x8e8, +0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8, +0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x8e8,0x12bd,0x12bd,0x12bd,0x12bd, +0x1266,0x1266,0x1266,0x1266,0x1266,0x1266,0x1266,0x1266,0xd3e,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45, +0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb, +0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8ee, +0x8eb,0x8ee,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0x8eb, +0x8eb,0x8eb,0x8eb,0x8eb,0x8eb,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45,0xc45, +0xc45,0xc45,0xc45,0xc45,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1, +0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1,0x8f1, +0x8f1,0x8f1,0x8f1,0xd47,0x96f,0x951,0x951,0x951,0x951,0x94b,0x951,0x951,0x963,0x951,0x951,0x94e, +0x95a,0x960,0x960,0x960,0x960,0x960,0x963,0x94b,0x957,0x94b,0x94b,0x94b,0x942,0x942,0x94b,0x94b, +0x94b,0x94b,0x94b,0x94b,0x966,0x966,0x966,0x966,0x966,0x966,0x966,0x966,0x966,0x966,0x94b,0x94b, +0x94b,0x94b,0x94b,0x94b,0x94b,0x94b,0x94b,0x94b,0x94e,0x942,0x94b,0x942,0x94b,0x942,0x95d,0x954, +0x95d,0x954,0x96c,0x96c,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b, 0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b,0x97b, -0x97b,0x97b,0x97b,0x97b,0x97e,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981, +0x97b,0x97b,0x97b,0x97b,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e, +0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e,0x97e, +0x97e,0x97e,0x97e,0x97e,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981, 0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981, -0x97e,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981, -0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0x981,0xa0e,0xa0e,0xf96,0xa0e, -0xa0e,0xa0e,0xa11,0xa0e,0xf96,0xa0e,0xa0e,0xf8d,0xa08,0x9fc,0x9fc,0x9fc,0x9fc,0xa0b,0x9fc,0xf7b, -0xf7b,0xf7b,0x9fc,0x9ff,0xa08,0xa02,0xf81,0xf90,0xf90,0xf7b,0xf7b,0xf96,0xb01,0xb01,0xb01,0xb01, -0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xa14,0xa14,0xa05,0xa05,0xa05,0xa05,0xa0e,0xa0e,0xa0e,0xa0e, -0xa0e,0xa0e,0xa0b,0xa0b,0x9fc,0x9fc,0xf96,0xf96,0xf96,0xf96,0xf7b,0xf7b,0xa0e,0xa0e,0xa0e,0xa0e, -0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e, -0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa0e,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xd86,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xd86,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23, -0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa23,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29, -0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29, -0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa29,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f, -0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2c,0xa32,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0x110d, -0x110d,0x110d,0x110d,0x110d,0x110d,0x110d,0x110d,0x110d,0x110a,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f, -0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f, -0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa2f,0xa44,0xa44,0xa44,0xa44, -0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44, -0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa44,0xa68,0xa68,0xa68,0xa6b, -0xa6b,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68, -0xa50,0xa50,0xa65,0xa47,0xa47,0xa47,0xa47,0xa47,0xa47,0xa47,0xa65,0xa65,0xa68,0xa68,0xa68,0xa68, -0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68, -0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa68,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa74,0xa74,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa8c,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89,0xa89, -0xa89,0xa89,0xa89,0xa89,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3, -0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xab3,0xba6, -0xba6,0xba6,0xba6,0xba6,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf, -0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf,0xabf, -0xabf,0xabf,0xabf,0xabf,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1, +0x981,0x981,0x981,0x981,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a, +0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a, +0x98a,0x98a,0x984,0x984,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d, +0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d, +0x98d,0x98d,0x987,0x987,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a, +0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a,0x98a, +0x98a,0x98a,0x98a,0x98a,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d, +0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d,0x98d, +0x98d,0x98d,0x98d,0x98d,0x990,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993, +0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993, +0x990,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993, +0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0x993,0xa20,0xa20,0xfab,0xa20, +0xa20,0xa20,0xa23,0xa20,0xfab,0xa20,0xa20,0xfa2,0xa1a,0xa0e,0xa0e,0xa0e,0xa0e,0xa1d,0xa0e,0xf90, +0xf90,0xf90,0xa0e,0xa11,0xa1a,0xa14,0xf96,0xfa5,0xfa5,0xf90,0xf90,0xfab,0xb13,0xb13,0xb13,0xb13, +0xb13,0xb13,0xb13,0xb13,0xb13,0xb13,0xa26,0xa26,0xa17,0xa17,0xa17,0xa17,0xa20,0xa20,0xa20,0xa20, +0xa20,0xa20,0xa1d,0xa1d,0xa0e,0xa0e,0xfab,0xfab,0xfab,0xfab,0xf90,0xf90,0xa20,0xa20,0xa20,0xa20, +0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20, +0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa20,0xa35,0xa35,0xa35,0xa35, +0xa35,0xa35,0xa35,0xd98,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xd98,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35, +0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa35,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b, +0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b, +0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa3b,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41, +0xa41,0xa41,0xa41,0xa41,0xa41,0xa3e,0xa44,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0x1122, +0x1122,0x1122,0x1122,0x1122,0x1122,0x1122,0x1122,0x1122,0x111f,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41, +0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41, +0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa41,0xa56,0xa56,0xa56,0xa56, +0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56, +0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa56,0xa7a,0xa7a,0xa7a,0xa7d, +0xa7d,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a, +0xa62,0xa62,0xa77,0xa59,0xa59,0xa59,0xa59,0xa59,0xa59,0xa59,0xa77,0xa77,0xa7a,0xa7a,0xa7a,0xa7a, +0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a, +0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa7a,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa86,0xa86,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9e,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b,0xa9b, +0xa9b,0xa9b,0xa9b,0xa9b,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5, +0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xac5,0xbb8, +0xbb8,0xbb8,0xbb8,0xbb8,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1, 0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1,0xad1, -0xad1,0xad1,0xad1,0xad1,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7, -0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7,0xad7, -0xad7,0xad7,0xad7,0xad7,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6, -0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6,0xae6, -0xae6,0xae6,0xae6,0xae6,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9, -0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xaec,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9, +0xad1,0xad1,0xad1,0xad1,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3, +0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3,0xae3, +0xae3,0xae3,0xae3,0xae3,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9, 0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9, -0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xae9,0xaef,0xaef,0xc36,0xc36, -0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef, -0xc36,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xaef,0xb10,0xb10,0xb10,0xb10, -0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10, -0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0xb10,0x14c4,0xb19,0xb19,0xb19,0xb19, -0xb19,0xb19,0xcbd,0xcbd,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16, -0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xb16,0xcba,0xcba, -0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b, -0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19, -0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19,0xb19, -0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c, -0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c,0xb1c, -0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb22,0xb2e,0xb34,0xb34,0xb34,0xb28,0xb28,0xb28,0xb31,0xb25,0xb25, -0xb25,0xb25,0xb25,0xb1f,0xb1f,0xb1f,0xb1f,0xb1f,0xb1f,0xb1f,0xb1f,0xb34,0xb34,0xb34,0xb34,0xb34, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb2b,0xb2b,0xb34,0xb34,0xb34,0xb28,0xb28,0xb34,0xb34,0xb34,0xb34,0xb34,0xb34,0xb34, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb34,0xb34,0xb34,0xb34,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, -0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0x16d1,0x16d1,0xb40,0xb37,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb37,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb37,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb37,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb37,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, +0xae9,0xae9,0xae9,0xae9,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8, +0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8,0xaf8, +0xaf8,0xaf8,0xaf8,0xaf8,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb, +0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafe,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb, +0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb, +0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xafb,0xb01,0xb01,0xc48,0xc48, +0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01, +0xc48,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb01,0xb22,0xb22,0xb22,0xb22, +0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22, +0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0xb22,0x14d9,0xb2b,0xb2b,0xb2b,0xb2b, +0xb2b,0xb2b,0xccf,0xccf,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28, +0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xb28,0xccc,0xccc, +0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d, +0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b, +0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b,0xb2b, +0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e, +0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e,0xb2e, +0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb34,0xb40,0xb46,0xb46,0xb46,0xb3a,0xb3a,0xb3a,0xb43,0xb37,0xb37, +0xb37,0xb37,0xb37,0xb31,0xb31,0xb31,0xb31,0xb31,0xb31,0xb31,0xb31,0xb46,0xb46,0xb46,0xb46,0xb46, +0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, +0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, +0xb3a,0xb3a,0xb3d,0xb3d,0xb46,0xb46,0xb46,0xb3a,0xb3a,0xb46,0xb46,0xb46,0xb46,0xb46,0xb46,0xb46, 0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, +0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb46,0xb46,0xb46,0xb46,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, +0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3a,0xb3a,0xb3a, 0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40, -0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb40,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d,0xb3d, -0xb3d,0xb3d,0xb3d,0xb3d,0xb40,0xb40,0xb40,0xb40,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43, -0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43, -0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb43,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49, -0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49, -0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb49,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c, +0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0xb3a,0x16e6,0x16e6,0xb52,0xb49,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb49,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb49,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb49,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb49,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, 0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c, -0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6, -0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba6,0xba3,0xba6, -0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xba3,0xcae, -0xcb1,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xd9e,0xeb8,0xeb8,0xeb8,0xeb8, -0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xcb4,0xcb4,0xcb4,0xcb4,0xcb4,0xcb4, -0xcb4,0xcb4,0xda4,0xe5b,0xda4,0xda4,0xda4,0xda4,0xda1,0xda4,0xda1,0xda4,0xda4,0xfab,0x1242,0x1242, -0xdad,0xdad,0xdad,0xdad,0xdad,0xdb3,0xdb0,0xeca,0xeca,0xeca,0xeca,0x13bf,0xfbd,0x13bf,0x12fc,0x12fc, -0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb,0xbeb, -0xbeb,0xbeb,0xc1b,0xc18,0xc1b,0xc18,0xc1b,0xc18,0x10ce,0x10cb,0xfc3,0xfc0,0xbee,0xbee,0xbee,0xbee, -0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbee,0xbf1,0xbf1,0xbf1,0xbf1, -0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1, -0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf4,0xbf4,0xbf1,0xbf1, -0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf1,0xbf7,0xbf7,0xbf7,0xbfd,0xbfa,0xc21,0xc1e,0xbfd, -0xbfa,0xbfd,0xbfa,0xbfd,0xbfa,0xbfd,0xbfa,0xbfd,0xbfa,0xbfd,0xbfa,0xbfd,0xbfa,0xbfd,0xbfa,0xbfd, -0xbfa,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7, -0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7, -0xbf7,0xbf7,0xbf7,0xbf7,0xbfd,0xbfa,0xbfd,0xbfa,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7, -0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7,0xbf7, -0xbf7,0xbf7,0xbf7,0xbf7,0xbfd,0xbfa,0xbf7,0xbf7,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00, -0xc00,0xc00,0xc00,0xc00,0xc06,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00, -0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00, -0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc06,0xc06,0xc06,0xc00,0xc00,0xc00,0xc00,0xc00, -0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00, -0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc03,0xc00,0xc00,0xc00,0xc39,0xc39,0xc39,0xc39, -0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39, -0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xc39,0xcb7,0xd26,0xda1,0xda1, -0xda1,0xda1,0xda1,0xda1,0xda1,0xda1,0xe5b,0xe5b,0xda1,0xda1,0xda1,0xda1,0xda4,0xda4,0xebb,0xfab, -0xfab,0xfab,0xfab,0xfab,0xfab,0xfab,0xfab,0xfab,0xfab,0x126f,0x126f,0x1245,0xcdb,0xcdb,0xcdb,0xcdb, -0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb, -0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcdb,0xcea,0xcea,0xcea,0xcea, -0xcea,0xcea,0xce1,0xce1,0xce1,0xce1,0xce1,0xcde,0xcf3,0xcf3,0xcf3,0xced,0xcf3,0xcf3,0xcf3,0xcf3, -0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xced,0xcf3,0xcf3,0xcf3,0xcf3,0xce7,0xce7,0xcf0,0xcf0, -0xcf0,0xcf0,0xce4,0xce4,0xce4,0xce4,0xce4,0xcea,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9, -0xdb9,0xdb9,0xdb9,0xdb9,0xdb6,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9,0xdb9,0xcf3,0xcf3,0xcf3,0xcf3, -0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xced,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3, -0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xce7,0xce7,0xce7,0xcea,0xcea,0xcea,0xcea, -0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea, -0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcea,0xcf6,0xcf6,0xcf6,0xcf6, -0xcf6,0xcf9,0xcf9,0xcf9,0xcf6,0xcf6,0xcf6,0xcf6,0xcf6,0xcf6,0xdbc,0xdbc,0xdbc,0xdbc,0xdbc,0xdbc, -0xecd,0xecd,0xecd,0xecd,0xecd,0xecd,0xecd,0x10d7,0x10d7,0xfc6,0xfc6,0xfc6,0xcfc,0xcfc,0xcfc,0xcfc, +0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c,0xb4c, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52, +0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb52,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f,0xb4f, +0xb4f,0xb4f,0xb4f,0xb4f,0xb52,0xb52,0xb52,0xb52,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55, +0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55, +0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb55,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b, +0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b, +0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5b,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e, +0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e, +0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xb5e,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8, +0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb8,0xbb5,0xbb8, +0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xbb5,0xcc0, +0xcc3,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xdb0,0xecd,0xecd,0xecd,0xecd, +0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xbc7,0xcc6,0xcc6,0xcc6,0xcc6,0xcc6,0xcc6, +0xcc6,0xcc6,0xdb6,0xe70,0xdb6,0xdb9,0xdb9,0xdb6,0xdb3,0xdb6,0xdb3,0xdb6,0xdb6,0xfc0,0x1257,0x1257, +0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc8,0xdc5,0xedf,0xedf,0xedf,0xedf,0x13d4,0xfd2,0x13d4,0x1311,0x1311, +0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd,0xbfd, +0xbfd,0xbfd,0xc2d,0xc2a,0xc2d,0xc2a,0xc2d,0xc2a,0x10e3,0x10e0,0xfd8,0xfd5,0xc00,0xc00,0xc00,0xc00, +0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc00,0xc03,0xc03,0xc03,0xc03, +0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03, +0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc06,0xc06,0xc03,0xc03, +0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc03,0xc09,0xc09,0xc09,0xc0f,0xc0c,0xc33,0xc30,0xc0f, +0xc0c,0xc0f,0xc0c,0xc0f,0xc0c,0xc0f,0xc0c,0xc0f,0xc0c,0xc0f,0xc0c,0xc0f,0xc0c,0xc0f,0xc0c,0xc0f, +0xc0c,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09, +0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09, +0xc09,0xc09,0xc09,0xc09,0xc0f,0xc0c,0xc0f,0xc0c,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09, +0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09,0xc09, +0xc09,0xc09,0xc09,0xc09,0xc0f,0xc0c,0xc09,0xc09,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12, +0xc12,0xc12,0xc12,0xc12,0xc18,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12, +0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12, +0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc18,0xc18,0xc18,0xc12,0xc12,0xc12,0xc12,0xc12, +0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12, +0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc12,0xc15,0xc12,0xc12,0xc12,0xc4b,0xc4b,0xc4b,0xc4b, +0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b, +0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xc4b,0xcc9,0xd38,0xdb3,0xdb3, +0xdb3,0xdb3,0xdb3,0xdb3,0xdb3,0xdb3,0xe70,0xe70,0xdb3,0xdb3,0xdb3,0xdb3,0xdb6,0xdb6,0xed0,0xfc0, +0xfc0,0xfc0,0xfc0,0xfc0,0xfc0,0xfc0,0xfc0,0xfc0,0xfc0,0x1284,0x1284,0x125a,0xced,0xced,0xced,0xced, +0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced, +0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xced,0xcfc,0xcfc,0xcfc,0xcfc, +0xcfc,0xcfc,0xcf3,0xcf3,0xcf3,0xcf3,0xcf3,0xcf0,0xd05,0xd05,0xd05,0xcff,0xd05,0xd05,0xd05,0xd05, +0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xcff,0xd05,0xd05,0xd05,0xd05,0xcf9,0xcf9,0xd02,0xd02, +0xd02,0xd02,0xcf6,0xcf6,0xcf6,0xcf6,0xcf6,0xcfc,0xdce,0xdce,0xdce,0xdce,0xdce,0xdce,0xdce,0xdce, +0xdce,0xdce,0xdce,0xdce,0xdcb,0xdce,0xdce,0xdce,0xdce,0xdce,0xdce,0xdce,0xd05,0xd05,0xd05,0xd05, +0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xcff,0xd05,0xd05,0xd05,0xd05,0xd05, +0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xd05,0xcf9,0xcf9,0xcf9,0xcfc,0xcfc,0xcfc,0xcfc, 0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc, -0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xd02,0xd02,0xd02,0xd02, -0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02, -0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd02,0xd0b,0xd0b,0xd0b,0xd0b, -0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b, -0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd0b,0xd17,0xd17,0xd17,0xd17, -0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17, -0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd17,0xd23,0xd23,0xd23,0xd23, -0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23, -0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xd23,0xdc2,0xdc2,0xdc2,0xdc2, -0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2, -0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc2,0xdc8,0xdc8,0xdc8,0xdc8, -0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8, -0xdc8,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc5,0xdc8,0xdc8,0xdc8,0xdc8, -0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8, -0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xdc8,0xe88,0xe88,0xdda,0xdda, -0xed0,0xed0,0xed0,0xed0,0xed0,0xed0,0xed0,0xfd2,0xfd2,0xfd2,0xfd2,0xfd2,0xfcf,0xfcf,0xfcf,0xfcf, -0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xfcf,0xde9,0xde6,0xde9,0xde6, -0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6, -0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xde9,0xde6,0xdf5,0xdf5,0xdf5,0xdf5, -0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5, -0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdf5,0xdfb,0xdfb,0xdfb,0xdfb, -0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb, -0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xdfb,0xe13,0xe13,0xe13,0xe13, -0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13,0xe13, -0xe13,0xe13,0xe13,0xed3,0xed3,0xed3,0xed3,0xfd5,0xfd5,0xfd5,0xfd5,0xfd5,0xe1c,0xe1c,0xe1c,0xe1c, -0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c, -0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe1c,0xe25,0xe25,0xe25,0xe25, -0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25, -0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe25,0xe2e,0xe2e,0xe2e,0xe2e, -0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e, -0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe28,0xe2b,0xe2b,0xe2b,0xe2b, -0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b, -0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2b,0xe2e,0xe2e,0xe2e,0xe2e,0xe2e,0xe37,0xe37,0xe37,0xe37, -0xe37,0xe37,0xe37,0xe37,0xe37,0xe37,0xe37,0xe37,0xe37,0xe37,0xe34,0xe34,0xe34,0xe34,0xe34,0xe34, -0xe34,0xe34,0xe31,0xe3a,0xfe1,0xfdb,0xfea,0xfd8,0xe37,0xe37,0xfd8,0xfd8,0xe4c,0xe4c,0xe3d,0xe4c, -0xe4c,0xe4c,0xe43,0xe4c,0xe4c,0xe4c,0xe4c,0xe3d,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c, -0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4f,0xe4f,0xe4f,0xe4f, -0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f, -0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe4f,0xe67,0xe67,0xe67,0xe67, -0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67, -0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe67,0xe85,0xe85,0xe85,0xe85, -0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0xe85,0x10e0,0x10e0,0x10e0,0x10e0, -0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0x10e0,0xecd,0xecd,0xecd,0xecd, -0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc6,0xfc9,0xfc9,0xfc9,0xfc9, -0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xeee,0xeee,0xeee,0xeee, -0xf00,0xf09,0xf0c,0xf09,0xf0c,0xf09,0xf0c,0xf09,0xf0c,0xf09,0xf0c,0xf09,0xf09,0xf09,0xf0c,0xf09, -0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09,0xf09, -0xf09,0xf09,0xf09,0xf09,0xef1,0xf00,0xeee,0xeee,0xeee,0xeee,0xeee,0xf03,0xeee,0xf03,0xf00,0xf00, -0xf15,0xf12,0xf15,0xf15,0xf15,0xf12,0xf12,0xf15,0xf12,0xf15,0xf12,0xf15,0xf12,0xffc,0xffc,0xffc, -0x1137,0xff3,0xffc,0xff3,0xf12,0xf15,0xf12,0xf12,0xff3,0xff3,0xff3,0xff3,0xff6,0xff9,0x1137,0x1137, -0xf18,0xf18,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005, -0x1005,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005, -0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e, +0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xcfc,0xd08,0xd08,0xd08,0xd08, +0xd08,0xd0b,0xd0b,0xd0b,0xd08,0xd08,0xd08,0xd08,0xd08,0xd08,0xdd1,0xdd1,0xdd1,0xdd1,0xdd1,0xdd1, +0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0xee2,0x10ec,0x10ec,0xfdb,0xfdb,0xfdb,0xd0e,0xd0e,0xd0e,0xd0e, +0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e, +0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd0e,0xd14,0xd14,0xd14,0xd14, +0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14, +0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd14,0xd1d,0xd1d,0xd1d,0xd1d, +0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d, +0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd1d,0xd29,0xd29,0xd29,0xd29, +0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29, +0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd29,0xd35,0xd35,0xd35,0xd35, +0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35, +0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xd35,0xdd7,0xdd7,0xdd7,0xdd7, +0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7, +0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xdd7,0xddd,0xddd,0xddd,0xddd, +0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd, +0xddd,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xdda,0xddd,0xddd,0xddd,0xddd, +0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd, +0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xddd,0xe9d,0xe9d,0xdef,0xdef, +0xee5,0xee5,0xee5,0xee5,0xee5,0xee5,0xee5,0xfe7,0xfe7,0xfe7,0xfe7,0xfe7,0xfe4,0xfe4,0xfe4,0xfe4, +0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xfe4,0xdfe,0xdfb,0xdfe,0xdfb, +0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb, +0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xdfe,0xdfb,0xe0a,0xe0a,0xe0a,0xe0a, +0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a, +0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe0a,0xe10,0xe10,0xe10,0xe10, +0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10, +0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe10,0xe28,0xe28,0xe28,0xe28, +0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28,0xe28, +0xe28,0xe28,0xe28,0xee8,0xee8,0xee8,0xee8,0xfea,0xfea,0xfea,0xfea,0xfea,0xe31,0xe31,0xe31,0xe31, +0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31, +0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe31,0xe3a,0xe3a,0xe3a,0xe3a, +0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a, +0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe3a,0xe43,0xe43,0xe43,0xe43, +0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43, +0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe43,0xe3d,0xe40,0xe40,0xe40,0xe40, +0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40, +0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe40,0xe43,0xe43,0xe43,0xe43,0xe43,0xe4c,0xe4c,0xe4c,0xe4c, +0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe4c,0xe49,0xe49,0xe49,0xe49,0xe49,0xe49, +0xe49,0xe49,0xe46,0xe4f,0xff6,0xff0,0xfff,0xfed,0xe4c,0xe4c,0xfed,0xfed,0xe61,0xe61,0xe52,0xe61, +0xe61,0xe61,0xe58,0xe61,0xe61,0xe61,0xe61,0xe52,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61, +0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe61,0xe64,0xe64,0xe64,0xe64, +0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64, +0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe64,0xe7c,0xe7c,0xe7c,0xe7c, +0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c, +0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe7c,0xe9a,0xe9a,0xe9a,0xe9a, +0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0xe9a,0x10f5,0x10f5,0x10f5,0x10f5, +0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0x10f5,0xecd,0xecd,0xecd,0xeca, +0xeca,0xeca,0xeca,0xeca,0x112e,0x137a,0x137a,0x137a,0x137a,0x12fc,0x12fc,0x12fc,0x137d,0x12ff,0x12ff,0x137d, +0x14cd,0x14cd,0x14cd,0x14cd,0x14d0,0x14d0,0x14d0,0x1797,0x1797,0x1797,0x1797,0x185d,0xee2,0xee2,0xee2,0xee2, +0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfdb,0xfde,0xfde,0xfde,0xfde, +0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xfde,0xf03,0xf03,0xf03,0xf03, +0xf15,0xf1e,0xf21,0xf1e,0xf21,0xf1e,0xf21,0xf1e,0xf21,0xf1e,0xf21,0xf1e,0xf1e,0xf1e,0xf21,0xf1e, 0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e,0xf1e, -0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d, -0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d,0xf2d, -0xf2d,0xf2d,0xf2d,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7,0x14f7, -0x14f7,0x14f7,0x14f7,0x14f7,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33, +0xf1e,0xf1e,0xf1e,0xf1e,0xf06,0xf15,0xf03,0xf03,0xf03,0xf03,0xf03,0xf18,0xf03,0xf18,0xf15,0xf15, +0xf2a,0xf27,0xf2a,0xf2a,0xf2a,0xf27,0xf27,0xf2a,0xf27,0xf2a,0xf27,0xf2a,0xf27,0x1011,0x1011,0x1011, +0x114c,0x1008,0x1011,0x1008,0xf27,0xf2a,0xf27,0xf27,0x1008,0x1008,0x1008,0x1008,0x100b,0x100e,0x114c,0x114c, +0xf2d,0xf2d,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a, +0x101a,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a, 0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33, -0xf33,0xf33,0xf33,0xf33,0xf7b,0xf96,0xf8d,0xf8a,0xf8a,0xf96,0xf96,0xf8d,0xf8d,0xf8a,0xf8a,0xf8a, -0xf8a,0xf8a,0xf96,0xf96,0xf96,0xf7b,0xf7b,0xf7b,0xf7b,0xf96,0xf96,0xf96,0xf96,0xf96,0xf96,0xf96, -0xf96,0xf96,0xf96,0xf96,0xf96,0xf96,0xf7b,0xf8d,0xf90,0xf7b,0xf7b,0xf93,0xf93,0xf93,0xf93,0xf93, -0xf93,0xf7e,0xf96,0xf93,0xf87,0xf87,0xf87,0xf87,0xf87,0xf87,0xf87,0xf87,0xf87,0xf87,0x1101,0x1101, -0x10fe,0x10fb,0xf84,0xf84,0xfae,0xfae,0xfae,0xfae,0x126f,0x126f,0x1245,0x1245,0x124b,0x1242,0x1242,0x1242, -0x1242,0x1245,0x136b,0x124b,0x1245,0x124b,0x1242,0x124b,0x126f,0x1242,0x1242,0x1242,0x1245,0x1245,0x1242,0x1242, -0x1245,0x1242,0x1242,0x1245,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9,0xfc6,0xfc6,0xfc9,0xfc9,0xfc9,0xfc9,0xfc9, -0xfc9,0x14d0,0x14d0,0x14d0,0x10d7,0xfc6,0xfc6,0xfc6,0xfc6,0x127b,0x1254,0x1254,0x1254,0x1254,0x14d0,0x14d0, -0x14d0,0x14d0,0x14d0,0x14d0,0xfe7,0xfe7,0xfe4,0xfde,0xfe4,0xfde,0xfe4,0xfde,0xfe4,0xfde,0xfdb,0xfdb, -0xfdb,0xfdb,0xff0,0xfed,0xfdb,0x1134,0x13cb,0x13ce,0x13ce,0x13cb,0x13cb,0x13cb,0x13cb,0x13cb,0x13d1,0x13d1, -0x14eb,0x14df,0x14df,0x14dc,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x1002,0xfff,0xfff,0x100e, -0x1005,0x130b,0x1308,0x16da,0x130b,0x1308,0x13da,0x13d7,0x14ee,0x14ee,0x14f4,0x14ee,0x14f4,0x14ee,0x14f4,0x14ee, -0x14f4,0x14ee,0x14f4,0x14ee,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005, -0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005,0x100e,0x1005, -0x100e,0x1005,0x100e,0x1005,0x1008,0x1005,0x1005,0x1005,0x1005,0x1005,0x1005,0x1005,0x1005,0x100e,0x1005,0x100e, -0x1005,0x100e,0x100e,0x1005,0x1011,0x1011,0x1017,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d, -0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d,0x101d, -0x101d,0x101d,0x101d,0x101d,0x101d,0x1017,0x1011,0x1011,0x1011,0x1011,0x1017,0x1017,0x1011,0x1011,0x101a,0x13e3, -0x13e0,0x13e0,0x101d,0x101d,0x1014,0x1014,0x1014,0x1014,0x1014,0x1014,0x1014,0x1014,0x1014,0x1014,0x13e6,0x13e6, -0x13e6,0x13e6,0x13e6,0x13e6,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032, +0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33,0xf33, +0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42, +0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42,0xf42, +0xf42,0xf42,0xf42,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c,0x150c, +0x150c,0x150c,0x150c,0x150c,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48, +0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48,0xf48, +0xf48,0xf48,0xf48,0xf48,0xf90,0xfab,0xfa2,0xf9f,0xf9f,0xfab,0xfab,0xfa2,0xfa2,0xf9f,0xf9f,0xf9f, +0xf9f,0xf9f,0xfab,0xfab,0xfab,0xf90,0xf90,0xf90,0xf90,0xfab,0xfab,0xfab,0xfab,0xfab,0xfab,0xfab, +0xfab,0xfab,0xfab,0xfab,0xfab,0xfab,0xf90,0xfa2,0xfa5,0xf90,0xf90,0xfa8,0xfa8,0xfa8,0xfa8,0xfa8, +0xfa8,0xf93,0xfab,0xfa8,0xf9c,0xf9c,0xf9c,0xf9c,0xf9c,0xf9c,0xf9c,0xf9c,0xf9c,0xf9c,0x1116,0x1116, +0x1113,0x1110,0xf99,0xf99,0xfc3,0xfc3,0xfc3,0xfc3,0x1284,0x1284,0x125a,0x125a,0x1260,0x1257,0x1257,0x1257, +0x1257,0x125a,0x1380,0x1260,0x125a,0x1260,0x1257,0x1260,0x1284,0x1257,0x1257,0x1257,0x125a,0x125a,0x1257,0x1257, +0x125a,0x1257,0x1257,0x125a,0xfde,0xfde,0xfde,0xfde,0xfde,0xfdb,0xfdb,0xfde,0xfde,0xfde,0xfde,0xfde, +0xfde,0x14e5,0x14e5,0x14e5,0x10ec,0xfdb,0xfdb,0xfdb,0xfdb,0x1290,0x1269,0x1269,0x1269,0x1269,0x14e5,0x14e5, +0x14e5,0x14e5,0x14e5,0x14e5,0xffc,0xffc,0xff9,0xff3,0xff9,0xff3,0xff9,0xff3,0xff9,0xff3,0xff0,0xff0, +0xff0,0xff0,0x1005,0x1002,0xff0,0x1149,0x13e0,0x13e3,0x13e3,0x13e0,0x13e0,0x13e0,0x13e0,0x13e0,0x13e6,0x13e6, +0x1500,0x14f4,0x14f4,0x14f1,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1017,0x1014,0x1014,0x1023, +0x101a,0x1320,0x131d,0x16ef,0x1320,0x131d,0x13ef,0x13ec,0x1503,0x1503,0x1509,0x1503,0x1509,0x1503,0x1509,0x1503, +0x1509,0x1503,0x1509,0x1503,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a, +0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a,0x1023,0x101a, +0x1023,0x101a,0x1023,0x101a,0x101d,0x101a,0x101a,0x101a,0x101a,0x101a,0x101a,0x101a,0x101a,0x1023,0x101a,0x1023, +0x101a,0x1023,0x1023,0x101a,0x1026,0x1026,0x102c,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032, 0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032,0x1032, -0x1032,0x1032,0x1032,0x1032,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b, -0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103b,0x103e,0x103e,0x103e,0x1041, -0x103e,0x103e,0x1044,0x1044,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047, +0x1032,0x1032,0x1032,0x1032,0x1032,0x102c,0x1026,0x1026,0x1026,0x1026,0x102c,0x102c,0x1026,0x1026,0x102f,0x13f8, +0x13f5,0x13f5,0x1032,0x1032,0x1029,0x1029,0x1029,0x1029,0x1029,0x1029,0x1029,0x1029,0x1029,0x1029,0x13fb,0x13fb, +0x13fb,0x13fb,0x13fb,0x13fb,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047, 0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047,0x1047, 0x1047,0x1047,0x1047,0x1047,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050, -0x1053,0x104a,0x1059,0x1056,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050, -0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050, -0x1050,0x1050,0x1050,0x1050,0x1311,0x130e,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065, -0x106b,0x1065,0x1068,0x10e9,0x105c,0x105c,0x105c,0x1062,0x13e9,0x13e9,0x13e9,0x13e9,0x13e9,0x13e9,0x13e9,0x13e9, -0x105f,0x105f,0x1062,0x106e,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065, -0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065,0x106b,0x1065, -0x106b,0x1065,0x106b,0x1065,0x1503,0x1500,0x1503,0x1500,0x1506,0x1506,0x16e3,0x13e9,0x1077,0x1077,0x107a,0x107a, -0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a, -0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x107a,0x1077,0x1077,0x1077,0x1077, -0x1077,0x1077,0x1077,0x1077,0x1077,0x1077,0x1077,0x1077,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1080,0x1080, -0x1080,0x1080,0x1080,0x1083,0x1083,0x1083,0x10dd,0x108c,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b, -0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x1086,0x1086,0x1086,0x1086,0x1086,0x1086,0x1086,0x1086, -0x1086,0x1086,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089, -0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x1089,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa, -0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa, -0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10aa,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc, -0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc, -0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10bc,0x10c5,0x10c5,0x10c5,0x10c5,0x10da,0x10c5,0x10c5,0x10c5, -0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5, -0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c5,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8, -0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8, -0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x10c8,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149, -0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1149,0x1140,0x1140, -0x1143,0x1143,0x1149,0x1140,0x1140,0x1140,0x1140,0x1140,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c, -0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c, -0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x114c,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167, -0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167, -0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1167,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173, -0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1173, -0x1173,0x1173,0x1173,0x1173,0x1173,0x1173,0x1170,0x1176,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182, -0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182, -0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1182,0x1191,0x1191,0x1191,0x11a0,0x11a6,0x11a6,0x11a6,0x11a6, -0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6, -0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x11a6,0x1194,0x11a0,0x11a0,0x1191,0x1191, -0x1191,0x1191,0x11a0,0x11a0,0x1191,0x11a0,0x11a0,0x11a0,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2, -0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b5,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11b2,0x11ac, -0x11ac,0x11ac,0x11b2,0x11af,0x150c,0x150f,0x1512,0x1512,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4, -0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11b8,0x11c4,0x11b8,0x11b8,0x11b8,0x11cd,0x11cd,0x11b8, -0x11b8,0x11cd,0x11c4,0x11cd,0x11cd,0x11c4,0x11b8,0x11bb,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4, -0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4, -0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11c4,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df, -0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df, -0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11df,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7, -0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f7, -0x11f7,0x11f7,0x11f7,0x11f7,0x11f7,0x11f4,0x11f4,0x11f4,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200, -0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200, -0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x1200,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f, -0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f, -0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x120f,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a, -0x122a,0x122a,0x122a,0x122d,0x122a,0x122a,0x122a,0x122a,0x1227,0x1227,0x1227,0x121b,0x121b,0x121b,0x121b,0x1227, -0x1227,0x1221,0x121e,0x1224,0x1224,0x1215,0x1230,0x1230,0x1218,0x1218,0x1227,0x122a,0x122a,0x122a,0x122a,0x122a, -0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a,0x122a, -0x122a,0x122a,0x122d,0x122a,0x122d,0x122a,0x122a,0x122a,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233, -0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233, -0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1239,0x1239,0x1239,0x1236,0x1236,0x1236,0x1233,0x1233, -0x1233,0x1233,0x1236,0x1233,0x1233,0x1233,0x1239,0x1236,0x1239,0x1236,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233, -0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233,0x1233, -0x1233,0x1233,0x1233,0x1233,0x1233,0x1239,0x1236,0x1236,0x1233,0x1233,0x1233,0x1233,0x1245,0x1245,0x12ed,0x1242, -0x12ed,0x12ed,0x12ed,0x12ed,0x1242,0x1248,0x126f,0x1242,0x1242,0x1242,0x1242,0x1242,0x1248,0x124b,0x126f,0x126f, -0x124b,0x126f,0x1242,0x124b,0x124b,0x124e,0x126f,0x1242,0x1242,0x126f,0x1245,0x1245,0x135c,0x135c,0x135c,0x135c, -0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x1257,0x1257,0x1257,0x1257,0x1377,0x1356,0x1260,0x1377,0x1377,0x1377, -0x1377,0x1377,0x1377,0x1377,0x1377,0x1377,0x1377,0x180f,0x180f,0x180f,0x180f,0x180f,0x135f,0x135f,0x1266,0x135f, -0x135f,0x135f,0x1266,0x135f,0x135f,0x135f,0x1260,0x1260,0x1260,0x1260,0x1260,0x1359,0x135c,0x135c,0x135c,0x135c, -0x135c,0x135c,0x135c,0x1263,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x1263,0x128d,0x128d,0x128d,0x128d, -0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d, -0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x128d,0x132f,0x132f,0x132f,0x132f, -0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f, -0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x132f,0x1344,0x1335,0x1344,0x1347, -0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347, -0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1347,0x1335,0x1335,0x1335,0x1335, -0x1335,0x1335,0x1335,0x1335,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d, -0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d,0x134d, -0x134d,0x134d,0x134d,0x134d,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353, -0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353,0x1353, -0x1353,0x1353,0x1353,0x1353,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1389,0x1389,0x138c,0x138c,0x138c,0x138c,0x138c, -0x1389,0x138c,0x138c,0x138c,0x1389,0x138c,0x1389,0x138c,0x1389,0x138c,0x138c,0x138c,0x138c,0x138c,0x1395,0x138c, -0x138c,0x138c,0x138c,0x1389,0x138c,0x1389,0x1389,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1389,0x1389,0x1389,0x1389,0x1389, -0x1389,0x1389,0x1389,0x1389,0x1389,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x1389,0x151e,0x151e, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x1527,0x1521,0x1521,0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x1764,0x1764,0x1764, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1527,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x1527,0x1764,0x1764,0x138c,0x138c,0x138c,0x138c,0x138c,0x1395,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1521,0x1521,0x1527,0x1527, -0x1521,0x1527,0x1527,0x1527,0x151e,0x151e,0x1527,0x1527,0x138c,0x138c,0x1392,0x1395,0x1395,0x1698,0x138c,0x1392, -0x138c,0x138c,0x1395,0x1530,0x152d,0x1527,0x1527,0x1764,0x1764,0x1764,0x1764,0x1764,0x1527,0x1527,0x1527,0x1527, -0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x1527,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1521,0x1521,0x1527,0x1698,0x1527,0x1521,0x1527, -0x1764,0x1764,0x1764,0x1767,0x1767,0x1767,0x1767,0x1767,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1527,0x138c,0x1527,0x1395,0x1395,0x138c,0x138c,0x1395,0x1395, -0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1398,0x1398,0x1398,0x1398,0x1392,0x1392, -0x1392,0x1392,0x1395,0x1392,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x1395,0x138c,0x138c,0x138c, -0x1395,0x138c,0x138c,0x138c,0x138c,0x1395,0x1395,0x1395,0x138c,0x1395,0x1395,0x1395,0x138c,0x138c,0x138c,0x138f, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1698,0x138c,0x138c,0x138c,0x138c,0x1527,0x1521,0x1764, -0x13ef,0x13ef,0x13ef,0x13ef,0x151e,0x151e,0x151e,0x151e,0x151e,0x1524,0x1527,0x1764,0x1764,0x1764,0x1764,0x16ec, -0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c, -0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1527,0x1527,0x1521,0x1521,0x1527,0x152d,0x1530,0x1527,0x1527, -0x1527,0x1527,0x1818,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1527,0x1521,0x1527,0x1521,0x1521,0x1521,0x1521, -0x152a,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1527,0x1521,0x1521,0x1521,0x1527,0x151e,0x151e,0x151e,0x151e, -0x151e,0x151e,0x1527,0x138c,0x138c,0x138c,0x138c,0x138c,0x1479,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b, -0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x1479,0x139b,0x139b,0x139b,0x1479,0x139b,0x1479, -0x139b,0x1479,0x139b,0x1479,0x139b,0x139b,0x139b,0x1479,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x1479,0x1479, -0x139b,0x139b,0x139b,0x139b,0x1479,0x139b,0x1479,0x1479,0x139b,0x139b,0x139b,0x139b,0x1479,0x139b,0x139b,0x139b, -0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x139b,0x169e,0x169e,0x176a,0x176a,0x139e,0x139e,0x139e, -0x139b,0x139b,0x139b,0x139e,0x139e,0x139e,0x139e,0x139e,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, -0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1050,0x1053,0x1053,0x1053,0x1056, +0x1053,0x1053,0x1059,0x1059,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c, +0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c,0x105c, +0x105c,0x105c,0x105c,0x105c,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065, +0x1068,0x105f,0x106e,0x106b,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065, +0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065,0x1065, +0x1065,0x1065,0x1065,0x1065,0x1326,0x1323,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a, +0x1080,0x107a,0x107d,0x10fe,0x1071,0x1071,0x1071,0x1077,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe,0x13fe, +0x1074,0x1074,0x1077,0x1083,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a, +0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a,0x1080,0x107a, +0x1080,0x107a,0x1080,0x107a,0x1518,0x1515,0x1518,0x1515,0x151b,0x151b,0x16f8,0x13fe,0x108c,0x108c,0x108f,0x108f, +0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f, +0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108f,0x108c,0x108c,0x108c,0x108c, +0x108c,0x108c,0x108c,0x108c,0x108c,0x108c,0x108c,0x108c,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x1095,0x1095, +0x1095,0x1095,0x1095,0x1098,0x1098,0x1098,0x10f2,0x10a1,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0, +0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x10b0,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b,0x109b, +0x109b,0x109b,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e, +0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x109e,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf, +0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf, +0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10bf,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1, +0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1, +0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10d1,0x10da,0x10da,0x10da,0x10da,0x10ef,0x10da,0x10da,0x10da, +0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da, +0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10da,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd, +0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd, +0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10dd,0x10e9,0x10e9,0x10e9,0x10e9,0x128a,0x128a,0x128a,0x128a, +0x128a,0x128a,0x128a,0x128a,0x1488,0x1776,0x1776,0x1776,0x1776,0x1776,0x1776,0x1776,0x1776,0x1776,0x18c6,0x18c6, +0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x18c6,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e, +0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x115e,0x1155,0x1155, +0x1158,0x1158,0x115e,0x1155,0x1155,0x1155,0x1155,0x1155,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161, +0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161, +0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x1161,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c, +0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c, +0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x117c,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188, +0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1188, +0x1188,0x1188,0x1188,0x1188,0x1188,0x1188,0x1185,0x118b,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197, +0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197, +0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x1197,0x11a6,0x11a6,0x11a6,0x11b5,0x11bb,0x11bb,0x11bb,0x11bb, +0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb, +0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11bb,0x11a9,0x11b5,0x11b5,0x11a6,0x11a6, +0x11a6,0x11a6,0x11b5,0x11b5,0x11a6,0x11b5,0x11b5,0x11b5,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7, +0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11ca,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c7,0x11c1, +0x11c1,0x11c1,0x11c7,0x11c4,0x1521,0x1524,0x1527,0x1527,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9, +0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11cd,0x11d9,0x11cd,0x11cd,0x11cd,0x11e2,0x11e2,0x11cd, +0x11cd,0x11e2,0x11d9,0x11e2,0x11e2,0x11d9,0x11cd,0x11d0,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9, +0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9, +0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11d9,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4, +0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4, +0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x11f4,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c, +0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c,0x120c, +0x120c,0x120c,0x120c,0x120c,0x120c,0x1209,0x1209,0x1209,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215, +0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215, +0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1215,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224, +0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224, +0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x1224,0x122a,0x122a,0x1239,0x123c,0x123c,0x123c,0x123c,0x123c, +0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c, +0x123c,0x123c,0x123f,0x123c,0x123f,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c,0x123c, +0x123c,0x123c,0x123c,0x123f,0x123c,0x123c,0x123c,0x123c,0x1239,0x1239,0x1239,0x122d,0x122d,0x122d,0x122d,0x1239, +0x1239,0x1233,0x1230,0x1236,0x1236,0x1245,0x1242,0x1242,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248, +0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248, +0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x124e,0x124e,0x124e,0x124b,0x124b,0x124b,0x1248,0x1248, +0x1248,0x1248,0x124b,0x1248,0x1248,0x1248,0x124e,0x124b,0x124e,0x124b,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248, +0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248,0x1248, +0x1248,0x1248,0x1248,0x1248,0x1248,0x124e,0x124b,0x124b,0x1248,0x1248,0x1248,0x1248,0x125a,0x125a,0x1302,0x1257, +0x1302,0x1302,0x1302,0x1302,0x1257,0x125d,0x1284,0x1257,0x1257,0x1257,0x1257,0x1257,0x125d,0x1260,0x1284,0x1284, +0x1260,0x1284,0x1257,0x1260,0x1260,0x1263,0x1284,0x1257,0x1257,0x1284,0x125a,0x125a,0x1371,0x1371,0x1371,0x1371, +0x1371,0x1371,0x1371,0x1371,0x1371,0x1371,0x126c,0x126c,0x126c,0x126c,0x138c,0x136b,0x1275,0x138c,0x138c,0x138c, +0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x138c,0x1824,0x1824,0x1824,0x1824,0x1824,0x1374,0x1374,0x127b,0x1374, +0x1374,0x1374,0x127b,0x1374,0x1374,0x1374,0x1275,0x1275,0x1275,0x1275,0x1275,0x136e,0x1371,0x1371,0x1371,0x1371, +0x1371,0x1371,0x1371,0x1278,0x1371,0x1371,0x1371,0x1371,0x1371,0x1371,0x1371,0x1278,0x12a2,0x12a2,0x12a2,0x12a2, +0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2, +0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x12a2,0x1344,0x1344,0x1344,0x1344, +0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344, +0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1344,0x1359,0x134a,0x1359,0x135c, +0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c, +0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x135c,0x134a,0x134a,0x134a,0x134a, +0x134a,0x134a,0x134a,0x134a,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362, +0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362,0x1362, +0x1362,0x1362,0x1362,0x1362,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368, +0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368,0x1368, +0x1368,0x1368,0x1368,0x1368,0x1398,0x1395,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc, +0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc, +0x18cc,0x18cc,0x18cc,0x18cc,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x139e,0x139e,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x139e,0x13a1,0x13a1,0x13a1,0x139e,0x13a1,0x139e,0x13a1,0x139e,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a7,0x13a1, +0x13a1,0x13a1,0x13a1,0x139e,0x13a1,0x139e,0x139e,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4, +0x13a4,0x13a1,0x13a1,0x13a1,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x139e,0x139e,0x139e,0x139e,0x139e, +0x139e,0x139e,0x139e,0x139e,0x139e,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x139e,0x1533,0x1533, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, 0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, -0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a1, -0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a4,0x13a4,0x13a1, -0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7, -0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7, -0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x1797,0x1797,0x1794,0x16ef,0x13f5,0x13f5,0x13f5,0x13f5, -0x13f5,0x13f5,0x13f2,0x13f2,0x13f2,0x13f2,0x13f2,0x13f2,0x13f5,0x13f5,0x13f5,0x13f5,0x13f5,0x13f5,0x13f5,0x13f5, -0x13f5,0x13f5,0x13f5,0x13f5,0x13f5,0x13f5,0x13f5,0x1539,0x1401,0x1401,0x1401,0x1413,0x1413,0x1413,0x1413,0x1413, -0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413, -0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x1413,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e, -0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e, -0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x142e,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437, -0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437, -0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x1437,0x143d,0x143d,0x1449,0x144f,0x144f,0x144f,0x144f,0x144f, -0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f, -0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x144f,0x1449,0x1449,0x1449,0x143d,0x143d, -0x143d,0x143d,0x143d,0x143d,0x143d,0x143d,0x143d,0x1449,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470, -0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470, -0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1470,0x1521,0x1521,0x1527,0x1527,0x1527,0x1521,0x1521,0x1521, -0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1527,0x1527,0x1527,0x151e,0x151e,0x151e,0x151e, -0x151e,0x151e,0x151e,0x151e,0x1527,0x1527,0x1527,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1527, -0x1521,0x1521,0x1527,0x1527,0x1527,0x1527,0x1521,0x1521,0x1530,0x1521,0x1521,0x1521,0x1521,0x169b,0x169b,0x1521, -0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1815,0x1527,0x1521,0x1521,0x1527,0x1521,0x1521,0x1521, -0x1521,0x1521,0x1521,0x1521,0x1521,0x1527,0x1527,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521,0x1521, -0x1527,0x1521,0x1521,0x1521,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551, -0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551,0x1551, -0x1551,0x1551,0x1551,0x1551,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563, +0x13a1,0x153c,0x1536,0x1536,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x1779,0x1779,0x1779, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x153c,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x153c,0x1779,0x1779, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a7,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a4,0x1536,0x1536,0x153c,0x153c,0x1536,0x153c,0x153c,0x153c,0x1533,0x1533,0x153c,0x153c, +0x13a1,0x13a1,0x13a7,0x13a7,0x13a7,0x16aa,0x13a1,0x13a7,0x13a1,0x13a1,0x13a7,0x1542,0x1542,0x153c,0x153c,0x1779, +0x1779,0x1779,0x1779,0x1779,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c,0x153c, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a4,0x13a1,0x13a1, +0x13a1,0x1536,0x1536,0x153c,0x16aa,0x153c,0x1536,0x153c,0x1779,0x1779,0x1779,0x177c,0x177c,0x177c,0x177c,0x177c, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x153c, +0x13a1,0x153c,0x13a7,0x13a7,0x13a1,0x13a1,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a7, +0x13a7,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13aa,0x13aa,0x13aa,0x13aa,0x13a1,0x13a1,0x13a1,0x13a1,0x13a7,0x13a1,0x13a7,0x13a7,0x13a7,0x13a7, +0x13a7,0x13a7,0x13a7,0x13a7,0x13a7,0x13a1,0x13a1,0x13a1,0x13a7,0x13a1,0x13a1,0x13a1,0x13a1,0x13a7,0x13a7,0x13a7, +0x13a1,0x13a7,0x13a7,0x13a7,0x13a1,0x13a1,0x13a1,0x13a4,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x16aa,0x13a1,0x13a1,0x13a1,0x13a1,0x153c,0x1536,0x1779,0x1404,0x1404,0x1404,0x1404,0x1533,0x1533,0x1533,0x1533, +0x1533,0x1539,0x153c,0x1779,0x1779,0x1779,0x1779,0x1701,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x153c, +0x153c,0x1536,0x1536,0x153c,0x1542,0x1542,0x153c,0x153c,0x153c,0x153c,0x182d,0x1536,0x1536,0x1536,0x1536,0x1536, +0x1536,0x153c,0x1536,0x153c,0x1536,0x1536,0x1536,0x1536,0x153f,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x153c, +0x1536,0x1536,0x1536,0x153c,0x1533,0x1533,0x1533,0x1533,0x1533,0x1533,0x153c,0x13a1,0x13a1,0x13a1,0x13a1,0x13a1, +0x148e,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad, +0x13ad,0x148e,0x13ad,0x13ad,0x13ad,0x148e,0x13ad,0x148e,0x13ad,0x148e,0x13ad,0x148e,0x13ad,0x13ad,0x13ad,0x148e, +0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x148e,0x148e,0x13ad,0x13ad,0x13ad,0x13ad,0x148e,0x13ad,0x148e,0x148e, +0x13ad,0x13ad,0x13ad,0x13ad,0x148e,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad,0x13ad, +0x13ad,0x16b0,0x16b0,0x177f,0x177f,0x13b0,0x13b0,0x13b0,0x13ad,0x13ad,0x13ad,0x13b0,0x13b0,0x13b0,0x13b0,0x13b0, +0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f, +0x13b6,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3, +0x13b3,0x13b3,0x13b6,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3, +0x13b3,0x13b3,0x13b3,0x13b9,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3, +0x13b3,0x13b3,0x13b3,0x13b3,0x13b9,0x13b9,0x13b9,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3,0x13b3, +0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc, +0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc,0x13bc, +0x17ac,0x17ac,0x17a9,0x1704,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x1407,0x1407,0x1407,0x1407,0x1407,0x1407, +0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x140a,0x154b, +0x1416,0x1416,0x1416,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428, +0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428,0x1428, +0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443, +0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443,0x1443, +0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c, +0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c,0x144c, +0x1452,0x1452,0x145e,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464, +0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464,0x1464, +0x1464,0x1464,0x1464,0x145e,0x145e,0x145e,0x1452,0x1452,0x1452,0x1452,0x1452,0x1452,0x1452,0x1452,0x1452,0x145e, +0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485, +0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485,0x1485, +0x1536,0x1536,0x153c,0x153c,0x153c,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536, +0x1536,0x153c,0x153c,0x153c,0x1533,0x1533,0x1533,0x1533,0x1533,0x1533,0x1533,0x1533,0x153c,0x153c,0x153c,0x1536, +0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x153c,0x1536,0x1536,0x153c,0x153c,0x153c,0x153c,0x1536,0x1536, +0x1542,0x1536,0x1536,0x1536,0x1536,0x16ad,0x16ad,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536, +0x182a,0x153c,0x1536,0x1536,0x153c,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x153c,0x153c,0x1536, +0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x1536,0x153c,0x1536,0x1536,0x1536,0x1563,0x1563,0x1563,0x1563, 0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563, -0x1563,0x1563,0x1563,0x1563,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569, -0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569,0x1569, -0x1569,0x1569,0x1569,0x1569,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c, -0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c,0x156c, -0x156c,0x156c,0x156c,0x156c,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab, -0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab,0x15ab, -0x15ab,0x15ab,0x15ab,0x159c,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4, -0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15b4,0x15ae, -0x15b7,0x15b7,0x15b7,0x15b7,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba,0x15ba, -0x15ba,0x15ba,0x15ba,0x15ba,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15cc,0x15d5,0x15d5,0x15d5, -0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5,0x15d5, -0x15d5,0x15d5,0x15d5,0x15d5,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de, -0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de,0x15de, -0x15de,0x15de,0x15de,0x15de,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0, -0x15f0,0x15f0,0x15f0,0x15f0,0x15ed,0x15ed,0x15ed,0x15e1,0x15e1,0x15e1,0x15e1,0x15e1,0x15e1,0x15e1,0x15e1,0x15ed, -0x15ed,0x15e1,0x15ed,0x15e4,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0, +0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1563,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575, +0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x1575,0x157b,0x157b,0x157b,0x157b, +0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b, +0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157b,0x157e,0x157e,0x157e,0x157e, +0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e, +0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x157e,0x15bd,0x15bd,0x15bd,0x15bd, +0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd, +0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15bd,0x15ae,0x15c6,0x15c6,0x15c6,0x15c6, +0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6, +0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c6,0x15c0,0x15c9,0x15c9,0x15c9,0x15c9,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc, +0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15cc,0x15e7,0x15e7,0x15e7,0x15e7, +0x15e7,0x15e7,0x15e7,0x15e7,0x15de,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7, +0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15e7,0x15f0,0x15f0,0x15f0,0x15f0, 0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0, -0x15f0,0x15f0,0x15f0,0x15f0,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614, -0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614,0x1614, -0x1614,0x1611,0x1611,0x1611,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d, -0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x161d,0x1623,0x1623,0x1623,0x1620,0x1620,0x1620, -0x161d,0x161d,0x161d,0x161d,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632, -0x1632,0x1632,0x1632,0x1632,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1638,0x1638,0x162c,0x1629,0x1629, -0x1629,0x1629,0x1629,0x1629,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632, -0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632,0x1632, -0x1632,0x1632,0x1632,0x1632,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e, -0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163e,0x163b,0x163b,0x163b,0x163b,0x163b, -0x163b,0x163b,0x163b,0x163b,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641, -0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641,0x1641, -0x1641,0x1641,0x1641,0x1641,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665, -0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665,0x1665, -0x1665,0x1665,0x1665,0x1665,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e, -0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e,0x166e, -0x166e,0x166e,0x166e,0x166e,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686, -0x1686,0x1686,0x1686,0x1686,0x1671,0x1680,0x1680,0x1671,0x1671,0x1671,0x1671,0x1671,0x1671,0x1680,0x1671,0x1683, -0x1683,0x1671,0x1683,0x1671,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686, -0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686,0x1686, -0x1686,0x1686,0x1686,0x1686,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f, -0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f,0x168f, -0x168f,0x168f,0x168f,0x168f,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695, -0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695,0x1695, -0x1695,0x1695,0x1695,0x1695,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5, -0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5,0x16f5, -0x16f5,0x16f5,0x16f5,0x16f5,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731, -0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731, -0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1737,0x1734,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731, -0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x1731,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a, -0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a, -0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173a,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d, -0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d, -0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x173d,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f, +0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x15f0,0x1602,0x1602,0x1602,0x1602, +0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x15ff,0x15ff,0x15ff,0x15f3, +0x15f3,0x15f3,0x15f3,0x15f3,0x15f3,0x15f3,0x15f3,0x15ff,0x15ff,0x15f3,0x15ff,0x15f6,0x1602,0x1602,0x1602,0x1602, +0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602, +0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1602,0x1626,0x1626,0x1626,0x1626, +0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626, +0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1626,0x1623,0x1623,0x1623,0x162f,0x162f,0x162f,0x162f, +0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f,0x162f, +0x162f,0x162f,0x1635,0x1635,0x1635,0x1632,0x1632,0x1632,0x162f,0x162f,0x162f,0x162f,0x1644,0x1644,0x1644,0x1644, +0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1638,0x1638,0x1638,0x1638, +0x1638,0x1638,0x1638,0x164a,0x164a,0x163e,0x163b,0x163b,0x163b,0x163b,0x163b,0x163b,0x1644,0x1644,0x1644,0x1644, +0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644, +0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1644,0x1650,0x1650,0x1650,0x1650, +0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650,0x1650, +0x1650,0x1650,0x1650,0x164d,0x164d,0x164d,0x164d,0x164d,0x164d,0x164d,0x164d,0x164d,0x1653,0x1653,0x1653,0x1653, +0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653, +0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1653,0x1677,0x1677,0x1677,0x1677, +0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677, +0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1677,0x1680,0x1680,0x1680,0x1680, +0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680, +0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1680,0x1698,0x1698,0x1698,0x1698, +0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1683,0x1692,0x1692,0x1683, +0x1683,0x1683,0x1683,0x1683,0x1683,0x1692,0x1683,0x1695,0x1695,0x1683,0x1695,0x1683,0x1698,0x1698,0x1698,0x1698, +0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698, +0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x1698,0x16a1,0x16a1,0x16a1,0x16a1, +0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1, +0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a1,0x16a7,0x16a7,0x16a7,0x16a7, +0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7, +0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x16a7,0x170a,0x170a,0x170a,0x170a, +0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a, +0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x170a,0x1746,0x1746,0x1746,0x1746, +0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746, +0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x174c,0x1749, +0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746,0x1746, +0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f, 0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f, -0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x174f,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752, 0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752, -0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755, -0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755, -0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1758,0x1758,0x1758,0x1758,0x1755, -0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1755,0x1758,0x1758,0x1758, -0x1758,0x1758,0x1758,0x1758,0x1758,0x1755,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758, -0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758, -0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1758,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770, -0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770, -0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x1770,0x17b5,0x17b5,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2, -0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2, -0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b2,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5, -0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5, -0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x17b5,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803, -0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1800,0x1800,0x1800, -0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x17eb,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803, -0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803, -0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x1803,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a, -0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a, -0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182a,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d, -0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d, -0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0x182d,0,0,0,0 +0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752,0x1752, +0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764, +0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764,0x1764, +0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767, +0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767,0x1767, +0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a, +0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a, +0x176a,0x176a,0x176a,0x176d,0x176d,0x176d,0x176d,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a,0x176a, +0x176a,0x176a,0x176a,0x176a,0x176a,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176a,0x176d,0x176d, +0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d, +0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d,0x176d, +0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785, +0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785,0x1785, +0x17ca,0x17ca,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7, +0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7,0x17c7, +0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca, +0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca,0x17ca, +0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818, +0x1818,0x1818,0x1818,0x1818,0x1818,0x1815,0x1815,0x1815,0x1800,0x1800,0x1800,0x1800,0x1800,0x1800,0x1800,0x1800, +0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818, +0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818,0x1818, +0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f, +0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f,0x183f, +0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842, +0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842,0x1842, +0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899, +0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899,0x1899, +0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba, +0x18ba,0x18ba,0x18ba,0x18a5,0x18ab,0x18a8,0x18a8,0x18a8,0x18a8,0x18b7,0x18bd,0x18a8,0x18a8,0x18a8,0x18a8,0x18b4, +0x18ba,0x18a8,0x18a8,0x18a8,0x18a8,0x18a8,0x18a8,0x18b7,0x18b7,0x18a8,0x18a8,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba, +0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba,0x18ba, +0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc, +0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc,0x18cc, +0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db, +0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db,0x18db, +0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1, +0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1,0x18e1, +0,0,0,0 }; static const UTrie2 propsVectorsTrie={ propsVectorsTrie_index, - propsVectorsTrie_index+4844, + propsVectorsTrie_index+4880, NULL, - 4844, - 23696, + 4880, + 24356, 0xa40, - 0x136c, + 0x1390, 0x0, 0x0, 0x110000, - 0x6f78, + 0x7230, NULL, 0, FALSE, FALSE, 0, NULL }; -static const uint32_t propsVectors[6195]={ +static const uint32_t propsVectors[6375]={ 0x67,0,0,0x67,0,0xe00000,0x67,0x80000,0x20,0x867,0,0,0xa67,0,0,0xb67, 0,0,0xc67,0,0,0xd67,0,0,0xe67,0,0,0x1067,0,0,0x1167,0, 0,0x1267,0,0,0x1367,0,0,0x1467,0,0,0x1567,0,0,0x1667,0,0, 0x1767,0,0,0x1867,0,0,0x1967,0,0,0x1a67,0,0,0x1b67,0,0,0x1d67, 0,0,0x1f67,0,0,0x2067,0,0,0x2267,0,0,0x2367,0,0,0x2467,0, 0,0x2567,0,0,0x2767,0,0,0x2867,0x80000,0x20,0x2967,0,0,0x2a67,0,0x1600000, -0x2b67,0,0,0x2d67,0,0,0x3067,0x20000000,0,0x3167,0x20000000,0,0x3267,0x20000000,0,0x3a67, -0,0,0x3b67,0,0,0x3c67,0,0,0x3e67,0,0,0x4067,0,0,0x4167,0, -0,0x4367,0,0,0x4467,0,0,0x4867,0,0,0x4967,0,0,0x4a67,0,0, -0x5067,0,0,0x5167,0,0,0x5467,0,0,0x5567,0,0,0x5667,0x80000,0x20,0x5767, -0,0,0x5867,0,0,0x5967,0,0,0x5b67,0,0,0x5c67,0,0,0x5d67,0, -0,0x6067,0x80000,0x20,0x6267,0,0,0x6367,0,0,0x6467,0,0,0x6567,0,0, -0x6f67,0,0,0x7067,0,0,0x7367,0x20000000,0,0x7567,0,0,0x7667,0,0,0x7767, -0,0,0x7867,0,0,0x7a67,0,0,0x7b67,0,0,0x7c67,0,0,0x7e67,0, -0,0x7f67,0,0,0x8167,0,0,0x8267,0,0,0x8367,0,0,0x8467,0,0, -0x8567,0,0,0x8667,0,0,0x8767,0,0,0x8867,0,0,0x8967,0,0,0x8b67, -0,0,0x8c67,0,0,0x8e67,0x20000000,0,0x8f67,0,0,0x9067,0,0,0x9167,0, -0,0x9267,0,0,0x9367,0,0,0x9567,0,0,0x9667,0,0,0x9767,0,0, -0x9867,0,0,0x9967,0,0,0x9a67,0,0,0x9c67,0,0,0x9f67,0,0,0xa167, -0,0,0xa367,0,0,0xa467,0,0,0xa567,0,0,0xa667,0,0,0xa767,0, -0,0xa867,0,0,0xa967,0,0,0xaa67,0,0xe00000,0xab67,0,0xe00000,0xac67,0,0, -0xad67,0,0,0xae67,0,0,0xaf67,0,0,0xb167,0,0,0xb267,0,0,0xb367, -0,0,0xb467,0,0,0xb567,0,0,0xb767,0,0,0xb867,0,0,0xb967,0, -0,0xba67,0,0,0xbc67,0,0,0xbd67,0,0,0xbe67,0,0,0xbf67,0,0, -0xc067,0,0,0xc167,0,0,0xc267,0,0,0xc367,0,0xe00000,0xc467,0,0xe00000,0xc667, -0,0,0xc767,0,0,0xc867,0,0,0xc967,0,0,0xca67,0,0,0xcb67,0, -0,0xcc67,0,0xe00000,0xcf67,0,0xe00000,0xd067,0,0xe00000,0xd267,0,0,0xd367,0,0, -0xd467,0,0,0xd567,0,0,0xd667,0,0,0xd867,0,0,0xd967,0,0,0xda67, -0,0,0xdb67,0,0,0xdc67,0,0,0xdd67,0,0,0xde67,0,0,0xdf67,0, -0,0xe067,0,0,0xe167,0,0,0xe267,0,0,0xe367,0,0xe00000,0xe467,0,0, -0xe567,0,0,0xe667,0,0,0xe767,0,0,0xe867,0,0,0xe967,0,0,0xea67, -0,0,0xeb67,0,0,0xec67,0,0,0xed67,0,0,0xee67,0,0,0xef67,0, -0,0xf167,0,0,0xf367,0,0,0xf567,0,0,0xf667,0,0,0xf767,0,0, -0xf867,0,0,0xf967,0,0,0xfa67,0,0xe00000,0xfb67,0,0,0xfc67,0,0,0xfd67, -0,0,0xfe67,0,0,0x10167,0,0,0x10267,0,0,0x10367,0,0,0x10467,0, -0,0x10567,0,0xe00000,0x10667,0,0,0x10767,0,0,0x10867,0,0,0x10967,0,0, -0x10a67,0,0,0x10b67,0,0,0x10c67,0,0,0x10d67,0,0,0x10e67,0,0,0x10f67, -0,0,0x11067,0,0,0x11167,0,0,0xa0067,0,0xe00000,0xa4667,0,0xe00000,0xa4767,0, -0xe00000,0xa4f67,0,0xe00000,0xa5e67,0,0xe00000,0xa5f67,0,0xe00000,0xac567,0,0xe00000,0xad167,0,0xe00000, -0xb0067,0,0xe00000,0x11000100,0,0x900020,0x11000100,0x40000001,0x440020,0x11000100,0x40000001,0x643020,0x11000100,0x40000001,0xa5a040,0x11000100, -0x40000001,0x116a8a0,0x11000200,0,0x900020,0x11000200,0x4000001,0xc4000b,0x11000200,0x7c00100,0x220402,0x11000200,0x24000000,0x10200000,0x11000200,0x24000008, -0x1710000,0x11000200,0x40000001,0x1d3b020,0x11000219,0x7c00100,0x220401,0x11000219,0x7c00100,0x250401,0x11000319,0x7c00100,0x220401,0x11000319,0x7c00100,0x220402, -0x11000319,0x7c00100,0x250400,0x11000319,0x7c00100,0x250401,0x11000419,0x7c00100,0x220400,0x11000419,0x7c00100,0x220401,0x11000419,0x7c00100,0x220402,0x11000419, -0x7c00100,0x230400,0x11000419,0x7c00100,0x250400,0x11000419,0x7c00100,0x250401,0x11000419,0x7c00100,0x250402,0x11000519,0x7c00100,0x220400,0x11000519,0x7c00100, -0x230400,0x11000600,0x4000400,0x200000,0x11000600,0x4000400,0x200002,0x11000600,0x4000400,0x201000,0x11000600,0x7c00500,0x220400,0x11000600,0x7c00500,0x230400, -0x11000600,0x7c00500,0x530400,0x11000600,0x7c00d00,0x230400,0x11000619,0x7c00500,0x22040f,0x11000800,0x4000010,0x1001401,0x11000800,0x4000400,0x200001,0x11000800, -0x6800010,0x201001,0x11000800,0x7c00500,0x230401,0x11000807,0x7c00100,0x220400,0x11000807,0x7c00100,0x250400,0x1100080e,0x4000400,0x200000,0x1100080e,0x4000400, -0x200002,0x1100080e,0x7000500,0x220402,0x1100080e,0x7c00100,0x220400,0x1100080e,0x7c00100,0x220401,0x1100080e,0x7c00100,0x220402,0x1100080e,0x7c00100,0x250400, -0x1100080e,0x7c00100,0x250401,0x1100080e,0x7c00120,0x220402,0x1100080e,0x7c00120,0x250402,0x11000908,0x4000000,0x200000,0x11000908,0x7c00100,0x220400,0x11000908, -0x7c00100,0x220401,0x11000908,0x7c00100,0x250400,0x11000908,0x7c00100,0x250401,0x11000a03,0x4000000,0x200000,0x11000a03,0x4000000,0x270000,0x11000a03,0x7c00100, -0x220400,0x11000a03,0x7c00100,0x220402,0x11000a03,0x7c00100,0x250400,0x11000a03,0x7c00500,0x230400,0x11000b13,0x2802500,0x962460,0x11000b13,0x4000000,0x200000, -0x11000b13,0x4000000,0x201000,0x11000b13,0x4000000,0x230400,0x11000b13,0x4000002,0x400000,0x11000b13,0x4000010,0x200000,0x11000b13,0x7c00100,0x2633800,0x11000c00, -0,0x218960,0x11000c02,0x2802100,0x962460,0x11000c02,0x2802400,0x962460,0x11000c02,0x4000000,0x200000,0x11000c02,0x4000000,0x1329400,0x11000c02,0x4000000, -0x1329800,0x11000c02,0x4000000,0x1500000,0x11000c02,0x6800000,0x1329800,0x11000c02,0x7c00100,0x230400,0x11000c02,0x7c00100,0x230401,0x11000c02,0x7c00100,0x230402, -0x11000c02,0x7c00500,0x230400,0x11000c02,0x7d00100,0x230400,0x11000c02,0xc000010,0xb48000,0x11000f0a,0x2802100,0x962460,0x11000f0a,0x2802400,0x962460,0x11000f0a, -0x2806400,0x962460,0x11000f0a,0x4000000,0x200000,0x11000f0a,0x6800100,0x962540,0x11000f0a,0x7c00100,0x230400,0x11000f0a,0x7c00100,0x230401,0x11001004,0x2802100, -0x962460,0x11001004,0x2802400,0x962460,0x11001004,0x2806400,0x962460,0x11001004,0x4000000,0x200000,0x11001004,0x4000000,0x1500000,0x11001004,0x6800100,0x962540, -0x11001004,0x6800100,0x962541,0x11001004,0x7c00100,0x230400,0x11001004,0x7c00100,0x230401,0x11001110,0x2802100,0x962460,0x11001110,0x2802400,0x962460,0x11001110, -0x2806400,0x962460,0x11001110,0x6800100,0x962540,0x11001110,0x7c00100,0x230400,0x11001110,0x7c00100,0x230401,0x1100120f,0x2802100,0x962460,0x1100120f,0x2802400, -0x962460,0x1100120f,0x2806400,0x962460,0x1100120f,0x6800100,0x962540,0x1100120f,0x7c00100,0x230400,0x1100131f,0x2802100,0x962460,0x1100131f,0x2802400,0x962460, -0x1100131f,0x2806400,0x962460,0x1100131f,0x4000000,0x200000,0x1100131f,0x6800000,0x1329800,0x1100131f,0x6800100,0x962540,0x1100131f,0x6800100,0x962541,0x1100131f, -0x7c00100,0x230400,0x1100131f,0x7c00100,0x230401,0x11001423,0x2802100,0x962460,0x11001423,0x2806400,0x962460,0x11001423,0x6800100,0x962540,0x11001423,0x6800100, -0x962541,0x11001423,0x7c00100,0x230400,0x11001423,0x7c00100,0x230401,0x11001524,0x2802100,0x962460,0x11001524,0x2802100,0x962461,0x11001524,0x2806400,0x962460, -0x11001524,0x6800000,0x1329800,0x11001524,0x6800100,0x962540,0x11001524,0x7c00100,0x230400,0x11001615,0x2802100,0x962460,0x11001615,0x2806400,0x962460,0x11001615, -0x6800000,0x1329800,0x11001615,0x6800100,0x962540,0x11001615,0x6800100,0x962541,0x11001615,0x7c00100,0x230400,0x1100171a,0x2802100,0x962460,0x1100171a,0x2806400, -0x962460,0x1100171a,0x6800000,0x1329800,0x1100171a,0x6800100,0x962540,0x1100171a,0x6800100,0x962541,0x1100171a,0x7c00100,0x230400,0x11001900,0x4000000,0x1600000, -0x11001926,0x2802100,0x1862460,0x11001926,0x2802400,0x1862460,0x11001926,0x2806100,0x1862460,0x11001926,0x4000000,0x200000,0x11001926,0x4000010,0x400000,0x11001926, -0x6800000,0x1329800,0x11001926,0x7800100,0x1830142,0x11001926,0x7c00100,0x1830000,0x11001926,0x7c00900,0x1830000,0x11001926,0x7e00100,0x1830000,0x11001a18,0x2802100, -0x1862460,0x11001a18,0x2802400,0x1862460,0x11001a18,0x6800000,0x1329800,0x11001a18,0x7800100,0x1830142,0x11001a18,0x7c00100,0x1830000,0x11001a18,0x7c00100,0x1830002, -0x11001a18,0x7c00900,0x1830000,0x11001a18,0x7e00100,0x1830000,0x11001d0c,0x7c00100,0x230400,0x11001d0c,0x7c00100,0x250400,0x11001e12,0x7c00100,0x2230500,0x11001e12, -0x7c00100,0x2330520,0x11001e12,0x7c80100,0x2330520,0x11002619,0x7c00100,0x220401,0x11002619,0x7c00100,0x220402,0x11002619,0x7c00100,0x250401,0x1100270e,0x4000400, -0x200001,0x1100270e,0x4000400,0x200002,0x1100270e,0x4000400,0x500001,0x1100270e,0x7c00100,0x220401,0x1100270e,0x7c00100,0x250401,0x11002800,0x80000,0x918820, -0x11002800,0x80000,0x1c18020,0x11002800,0x180000,0x918820,0x11002800,0x4000001,0x440001,0x11002800,0x4000001,0x440002,0x11002800,0x4000001,0xc4000b,0x11002800, -0x6800000,0x201c00,0x11002800,0x6800020,0x201c00,0x11002800,0x24000000,0x200000,0x11002800,0x24000000,0x200002,0x11002800,0x24000000,0x810000,0x11002800,0x24000000, -0x1410000,0x11002800,0x24000000,0x1500000,0x11002800,0x24000000,0x1500002,0x11002800,0x24000002,0x400000,0x11002800,0x24000006,0xc0000b,0x11002800,0x24000008,0x1410000, -0x11002800,0x24000008,0x1710000,0x11002800,0x24000020,0x1001400,0x11002800,0x24000020,0x1500002,0x11002800,0x2c000010,0x1248000,0x11002800,0x2c000010,0x11248002,0x11002800, -0x40000001,0x63b020,0x11002800,0x40080000,0x918820,0x11002801,0x80000,0x2a65620,0x11002801,0x82000,0x962460,0x11002900,0x4000000,0x20000e,0x11002900,0x4000000, -0x20000f,0x11002900,0x4000020,0x20000e,0x11002900,0x4000020,0x20000f,0x11002900,0x4000020,0x81000e,0x11002900,0x4000020,0x81000f,0x11002900,0x4000020,0x141000e, -0x11002900,0x4000020,0x141000f,0x11002900,0x4000022,0x20000e,0x11002900,0x4000022,0x20000f,0x11002a00,0x4000000,0x1500000,0x11002a00,0x4000000,0x1600000,0x11002a00, -0x4000000,0x1600002,0x11002b01,0x2000,0x962460,0x11002b01,0x2802020,0x962460,0x11002c00,0x4000000,0x200000,0x11002c00,0x4000000,0x200002,0x11002c00,0x4000000, -0x20000f,0x11002c00,0x4000020,0x200000,0x11002c00,0x7c00000,0x200000,0x11002c00,0x7c00020,0x200000,0x11002c00,0x7c00120,0x220405,0x11002c00,0x7c00120,0x230402, -0x11002c00,0x7c00120,0x250402,0x11002c00,0x7c00120,0x250405,0x11002c19,0x7c00100,0x250400,0x11002c19,0x7c00100,0x250401,0x11002d00,0x4000000,0x100006,0x11002d00, -0x4000000,0x200006,0x11002d19,0x7c00100,0x220402,0x11002d19,0x7c00100,0x230400,0x11002d19,0x7c00100,0x250402,0x11002e00,0x24000000,0x200000,0x11002e00,0x24000020, -0x200000,0x11002e00,0x24000020,0x200001,0x11002e00,0x24000020,0x10200000,0x11002f00,0x24000020,0x200000,0x11002f00,0x24000020,0x200001,0x11002f00,0x24000020,0x200002, -0x11002f00,0x24000020,0xf00000,0x11002f00,0x24000020,0x1600000,0x11002f00,0x24000022,0x1600000,0x11003000,0x24000000,0x200000,0x11003000,0x24000000,0x10200000,0x11003000, -0x24000020,0x200000,0x11003000,0x24000020,0x810000,0x11003000,0x24000020,0x1410000,0x11003100,0x24000000,0x200000,0x11003200,0x24000000,0x200000,0x11003300,0x4000000, -0x100003,0x11003400,0x24000000,0x100000,0x11003400,0x24000000,0x200000,0x11003500,0x24000000,0x200000,0x11003600,0x24000000,0x200000,0x11003600,0x24000000,0x10200000, -0x11003600,0x24000020,0x200000,0x11003700,0x24000000,0x200000,0x11003700,0x24000000,0xe00000,0x11003700,0x24000000,0x10200000,0x11003700,0x24000000,0x10e00000,0x11003700, -0x24000000,0x928045a0,0x11003700,0x24000020,0x200000,0x11003800,0x4000000,0x100000,0x11003800,0x24000000,0x200000,0x11003800,0x24000000,0xb00000,0x11003800,0x24000000, -0xe00000,0x11003800,0x24000000,0x1710000,0x11003800,0x24000000,0x10200000,0x11003800,0x24000000,0x10b00000,0x11003800,0x24000000,0x10e00000,0x11003800,0x24000000,0x10e05200, -0x11003800,0x24000000,0x928045a0,0x11005003,0x7c00100,0x220402,0x11005013,0x2802500,0x962460,0x11005013,0x4000020,0x200005,0x11005013,0x7c00100,0x2633801,0x11005013, -0x7c00100,0x2633802,0x11005013,0x7c00100,0x2633805,0x11005019,0x7c00100,0x220402,0x11005100,0x24000000,0x810000,0x11005100,0x24000000,0x1410000,0x11005102,0x7000100, -0x230408,0x11005102,0x7c00100,0x230404,0x11005102,0x7c00100,0x230407,0x11005102,0x7c00100,0x230408,0x11005102,0x7c00100,0x230409,0x11005201,0x2802400,0x962460, -0x11005500,0x80000,0x1e18820,0x11005502,0x7000100,0x230408,0x11005502,0x7c00100,0x230404,0x11005502,0x7c00100,0x230407,0x11005502,0x7c00100,0x230408,0x11005502, -0x7c00100,0x230409,0x11005667,0x1000,0,0x11020200,0x80004,0x418820,0x11020200,0x4000000,0x100006,0x11020200,0x4000000,0x10000f,0x11020200,0x4000400, -0x100002,0x11020200,0x4000400,0x500002,0x11020200,0x6800c00,0x101000,0x11020200,0x24000000,0x100000,0x11020200,0x24000000,0x1400000,0x11020200,0x24000000,0x1500000, -0x11020200,0x24000000,0x1600000,0x11020200,0x24000000,0x10200000,0x11020200,0x24000020,0x100000,0x11020200,0x24000020,0x1600000,0x11020219,0x7c00100,0x12040f,0x11020219, -0x7c00100,0x220400,0x11020219,0x7c00100,0x220401,0x11020219,0x7c00100,0x250400,0x11020319,0x7c00100,0x220400,0x11020319,0x7c00100,0x220401,0x11020319,0x7c00100, -0x220402,0x11020319,0x7c00100,0x250400,0x11020319,0x7c00100,0x250402,0x11020319,0x7d00100,0x220402,0x11020419,0x7c00100,0x220401,0x11020519,0x7c00100,0x220400, -0x11020600,0x4000400,0x100002,0x11020600,0x4000400,0x200000,0x11020600,0x7c00500,0x130400,0x11020600,0x7c00d00,0x130400,0x11020701,0x2802400,0x962460,0x11020701, -0x2802400,0x962461,0x11020701,0x2802400,0xc62460,0x1102080e,0x7c00100,0x220400,0x1102080e,0x7c00100,0x250400,0x11020908,0x7c00100,0x220400,0x11020908,0x7c00100, -0x220401,0x11020908,0x7c00100,0x250400,0x11020908,0x7c00100,0x250401,0x11022800,0x24000000,0x100000,0x11022800,0x24000000,0x200000,0x11022800,0x24000000,0x200002, -0x11022800,0x24000000,0x401000,0x11022800,0x24000000,0xf00002,0x11022800,0x24000000,0xf0ac02,0x11022800,0x24000000,0x1500000,0x11022800,0x24000002,0x100000,0x11022800, -0x24000002,0x370000,0x11022800,0x24000002,0x470000,0x11022800,0x24000006,0x400000,0x11022800,0x24000008,0x1710000,0x11022800,0x24000008,0x1712c00,0x11022800,0x24000020, -0x100000,0x11022800,0x24000020,0x1500000,0x11022800,0x24000020,0x1500002,0x11022900,0x4000000,0x10000e,0x11022900,0x4000000,0x10000f,0x11022919,0x7c00100,0x12040f, -0x11022c00,0x4000000,0x100002,0x11022c00,0x4000000,0x1500002,0x11022c00,0x4000000,0x1600002,0x11022c00,0x4000000,0x1010000f,0x11022c00,0x7c00120,0x120405,0x11022c0e, -0x7c00100,0x250401,0x11022c19,0x7c00100,0x150401,0x11022d00,0x4000000,0x100006,0x11022d00,0x4000000,0x200006,0x11022d19,0x7c00100,0x120402,0x11022d19,0x7c00100, -0x150402,0x11022e00,0x24000000,0x200000,0x11022e00,0x24000020,0x100000,0x11022e00,0x24000020,0x10100000,0x11022f00,0x24000020,0x100000,0x11022f00,0x24000020,0x100001, -0x11022f00,0x24000020,0x100002,0x11023000,0x24000000,0x100000,0x11023300,0x4000000,0x100002,0x11023300,0x4000000,0x100003,0x11023300,0x4000100,0x120403,0x11023300, -0x4000100,0x150403,0x11023300,0x4000100,0x10150403,0x11023400,0x24000000,0x100000,0x11023500,0x24000000,0x100000,0x11023600,0x24000000,0x100000,0x11023600,0x24000020, -0x100000,0x11023600,0x24000020,0x10100000,0x11023700,0x24000000,0x100000,0x11023700,0x24000000,0xe00000,0x11023700,0x24000000,0x10100000,0x11023700,0x24000000,0x10e00000, -0x11023700,0x24000020,0x100000,0x11023700,0x24000020,0x10100000,0x11023800,0x4000000,0x100000,0x11023800,0x24000000,0x200000,0x11024e67,0,0,0x11025600, -0x4000000,0x100000,0x11042a00,0x4000000,0x1600000,0x11045700,0x4000000,0x20000a,0x11045700,0x4000020,0x20000a,0x11045712,0x7c00100,0xe3040a,0x11045712,0x7c80100, -0xe3040a,0x11045716,0x7c00100,0xe30c0a,0x11045716,0x7c00100,0x2530c0a,0x11063d00,0x4000001,0x440011,0x11065700,0x4000000,0x810011,0x11065700,0x4000000,0xe00011, -0x11065700,0x4000000,0x1410011,0x11065700,0x4000000,0x1500011,0x11065700,0x4000000,0x1600011,0x11065700,0x4000006,0xe70011,0x11065700,0x4000008,0xe00011,0x11065700, -0x4000008,0xe02c11,0x11065700,0x4000010,0x871411,0x11065700,0x4000010,0x1201411,0x11065700,0x4000010,0x1271011,0x11065700,0x4000020,0xe00011,0x11065700,0x4000400, -0xe00011,0x11065700,0x4000420,0xe00011,0x11065700,0x6800000,0xe01c11,0x11065700,0x6800040,0xe00011,0x11065700,0xc000010,0x80ac11,0x11065700,0xc000010,0xb48011, -0x11065719,0x7c00100,0xe20411,0x11065719,0x7c00100,0xe50411,0x11065719,0x7c00140,0xe20411,0x11065719,0x7c00140,0xe50411,0x11080100,0x6800000,0x201c00,0x11080100, -0x68000c0,0x11329800,0x11080100,0x24000000,0x200000,0x11080100,0x24000000,0x810000,0x11080100,0x24000000,0x1410000,0x11080100,0x24000000,0x1500000,0x11080100,0x24000000, -0x1600000,0x11080100,0x24000000,0x1b00000,0x11080100,0x24000000,0x2410000,0x11080100,0x24000000,0x10200000,0x11080100,0x24000006,0xd70000,0x11080100,0x24000008,0x1713c00, -0x11080100,0x24000008,0x1714000,0x11080100,0x24000010,0x1001400,0x11080100,0x24000010,0x1071000,0x11080100,0x24000010,0x1071400,0x11080100,0x24000020,0x200000,0x11080100, -0x24000020,0x400000,0x11080100,0x24000020,0x1600000,0x11080100,0x24000400,0x200000,0x11080100,0x24000420,0x200000,0x11080100,0x2c000010,0xb48000,0x11080100,0x2c000010, -0x100ac00,0x11080100,0x44000001,0x1a40000,0x11080119,0x7c00100,0x220400,0x11080119,0x7c00100,0x250400,0x11080119,0x7c001c0,0x220400,0x11080119,0x7c001c0,0x250400, -0x11080200,0x4000400,0x200002,0x11080200,0x24000000,0x200000,0x11080200,0x24000000,0x1500000,0x11080200,0x24000000,0x1600000,0x11080200,0x24000020,0x200000,0x110a1e12, -0x7c00100,0x2130480,0x110a1e12,0x7c80100,0x2130480,0x110a3000,0x24000000,0x30e00000,0x110a3000,0x24100000,0x810001,0x110a3000,0x24100000,0x1410001,0x110a3700,0x24000000, -0x30200000,0x110a3d00,0x4000000,0xe00000,0x110a3d00,0x4000000,0xe00002,0x110a3d00,0x24000000,0xe00000,0x110a3d11,0x7c00300,0xe30000,0x110a3d11,0x7c00900,0x1230400, -0x110a3d12,0x2802400,0x962460,0x110a3e14,0x7c00100,0xe30000,0x110a3e14,0x7c00100,0xe30001,0x110a3e14,0x7c00100,0x2530000,0x110a3e14,0x7c00900,0x1230000,0x110a3e14, -0x7c00900,0x1230001,0x110a3f16,0x7c00100,0xe30c00,0x110a3f16,0x7c00100,0xe30c01,0x110a3f16,0x7c00100,0x2530c00,0x110a3f16,0x7c00900,0x1230c00,0x110a3f16,0x7c00900, -0x1230c01,0x110a4005,0x7c00100,0xe30400,0x110a4112,0x7c00100,0xe30402,0x110a4112,0x7c80100,0xe30402,0x110a4400,0x4000000,0xe00000,0x110a4412,0x4000000,0xe00002, -0x110a4412,0x4000000,0xe00003,0x110a4416,0x4000000,0xe00c03,0x110a4500,0x4000000,0xe0000d,0x110a4516,0x4000000,0xe00c0d,0x110a4711,0x7c40300,0xe30000,0x110a4f11, -0x7c00300,0xe30001,0x110a4f11,0x7c40300,0xe30000,0x110a5300,0x4000000,0x810010,0x110a5300,0x4000000,0xe00002,0x110a5300,0x4000000,0xe00010,0x110a5300,0x4000000, -0x1410010,0x110a5300,0x4000002,0xe70010,0x110a5300,0x4000008,0x810010,0x110a5300,0x4000008,0x1410010,0x110a5300,0x6800000,0xe01c02,0x110a5300,0x6800000,0xe01c10, -0x110a5400,0x4000000,0x81000c,0x110a5400,0x4000000,0xe0000c,0x110a5400,0x4000000,0x141000c,0x110a5400,0x4000000,0x150000c,0x110a5400,0x4000000,0x160000c,0x110a5400, -0x4000002,0xe7000c,0x110a5400,0x4000010,0x87140c,0x110a5400,0x4000010,0xe7000c,0x110a5400,0x4000010,0x120140c,0x110a5400,0x4000010,0x127100c,0x110a5400,0x4000020, -0xe0000c,0x110a5400,0x4000026,0xe7000c,0x110a5400,0xc000010,0x80ac0c,0x110a5400,0xc000010,0xb4800c,0x11400a0c,0xc000010,0x1049400,0x11400c0e,0x4000010,0xb00000, -0x11400c0e,0x4000010,0x1071400,0x11400c0e,0xc000010,0xb48000,0x11400c11,0x7c00900,0x230400,0x11400f34,0xc000010,0x448000,0x11400f44,0xc000010,0x448000,0x11401d70, -0x4000000,0x200000,0x11403d92,0x4000000,0xe00000,0x11445787,0x4000004,0x120000a,0x11445787,0x4000008,0x81000a,0x11445787,0x4000008,0x141000a,0x11445787,0x4000010, -0x87000a,0x11445787,0xc000010,0x84800a,0x11445790,0x3802500,0x126246a,0x11445790,0x7c00d00,0x2530c0a,0x114a3d87,0x24000000,0x810000,0x114a3d87,0x24000000,0x1410000, -0x114a3d87,0x24000008,0x810000,0x114a3d87,0x24000008,0x1410000,0x114a3d87,0x24000010,0x870000,0x114a3d87,0x2c000010,0x848000,0x114a3d8d,0x4000000,0xe00000,0x114a3d8d, -0x24000000,0xe00000,0x114a3d8d,0x24000002,0x1200000,0x114a3d8d,0x24000002,0x10e00000,0x114a3d8d,0x24000008,0x810000,0x114a3d8d,0x24000008,0x1410000,0x114a3d90,0x7c00900, -0x930c00,0x114a3d90,0x7c00900,0xe30c00,0x114a3d92,0x7c00300,0xe30000,0x114a3e90,0x7000400,0x1200c02,0x114a3f87,0x4000004,0x1200000,0x114a3f90,0x7c00d00,0x2530c00, -0x114a4292,0x4000000,0xe00000,0x114a4292,0x4000000,0xe0000f,0x114a4492,0x4000000,0xe00002,0x114a4492,0x4000000,0xe00003,0x114a4492,0x4000000,0x10e00003,0x114a4592, -0x4000000,0xe00002,0x114a4592,0x4000000,0xe0000d,0x1180090a,0x2802400,0x962460,0x11800c17,0x2802100,0x962460,0x11800c17,0x2802500,0x962460,0x11800f1d,0x2802400, -0x962460,0x11800f29,0x2802400,0x962460,0x11820700,0x2802400,0x962460,0x11820700,0x2802500,0x962460,0x118a3d93,0x2802400,0x962460,0x118a3e90,0x2802400,0x962460, -0x11c00904,0x2802400,0x962460,0x11c00908,0x2802400,0x962460,0x11c00c1b,0x6800000,0x1329800,0x11c00f58,0x6800000,0x1329800,0x11c0105d,0x6800000,0x1329800,0x11c01161, -0x6800000,0x1329800,0x11c01265,0x6800000,0x1329800,0x11c01469,0x4000000,0x200000,0x11c01469,0x6800000,0x1329800,0x11c01469,0x7c00100,0x230400,0x11c0511b,0x7c00100, -0x230408,0x20000067,0x1000,0,0x20000b13,0x2802400,0x962460,0x20000b13,0x2802500,0x962460,0x20001b27,0x2802100,0x962460,0x20001b27,0x2802100,0x962461, -0x20001b27,0x2802400,0x962460,0x20001b27,0x2806400,0x962460,0x20001b27,0x2902100,0x962462,0x20001b27,0x4000000,0x200000,0x20001b27,0x4000000,0x400000,0x20001b27, -0x4000000,0x500000,0x20001b27,0x4000000,0x810000,0x20001b27,0x4000000,0xb00000,0x20001b27,0x4000000,0xc0000b,0x20001b27,0x4000000,0x1410000,0x20001b27,0x4000010, -0xb00000,0x20001b27,0x4000010,0xc00000,0x20001b27,0x6800000,0x1329800,0x20001b27,0x6800100,0x462540,0x20001b27,0x6800400,0x962540,0x20001b27,0x7c00100,0x230400, -0x20001b27,0x7c00100,0x230401,0x20002619,0x7c00100,0x220401,0x20002a00,0x4000000,0x1600000,0x20004b67,0,0x1900020,0x20004c67,0,0x1900020,0x20004d67, -0,0x1900020,0x20006d67,0x1000,0,0x20006e67,0x1000,0,0x20026d67,0,0,0x20026e67,0,0,0x200a4a12,0x7c00100, -0x1f304c1,0x200a4a12,0x7c00100,0x20304e1,0x21005600,0x4000000,0x700000,0x21022a00,0x4000000,0x1600000,0x30000419,0x7c00100,0x220400,0x30000419,0x7c00100,0x220401, -0x30000419,0x7c00100,0x250400,0x30000419,0x7c00100,0x250401,0x30000519,0x7c00100,0x220400,0x30000600,0x4000400,0x200000,0x30000600,0x7c00500,0x230400,0x30000605, -0x4000400,0x200000,0x3000080e,0x7c00100,0x220400,0x30000908,0x2000,0x962460,0x30000908,0x7c00100,0x220400,0x30000908,0x7c00100,0x220401,0x30000908,0x7c00100, -0x250400,0x30000908,0x7c00100,0x250401,0x30000a03,0x4000006,0x400000,0x30000c02,0x4000000,0x200000,0x30000c02,0x7c00100,0x230400,0x30000d22,0,0x218960, -0x30000d22,0x2802100,0x962460,0x30000d22,0x2802400,0x962460,0x30000d22,0x2802500,0x962460,0x30000d22,0x4000000,0x200000,0x30000d22,0x4000010,0x200000,0x30000d22, -0x7c00100,0x230400,0x30000d22,0xc000010,0x248000,0x30000e25,0x2802500,0x962460,0x30000e25,0x7c00100,0x230400,0x30001821,0x2802100,0x962460,0x30001821,0x2806400, -0x962460,0x30001821,0x4000000,0x200000,0x30001821,0x6800100,0x962540,0x30001821,0x6800100,0x962541,0x30001821,0x7c00100,0x230400,0x30001b27,0x2802100,0x962460, -0x30001b27,0x2802400,0x962460,0x30001b27,0x4000000,0x200000,0x30001b27,0x4000000,0x400000,0x30001b27,0x7c00100,0x230400,0x30001c1c,0x2802100,0x1862460,0x30001c1c, -0x2802400,0x1862460,0x30001c1c,0x2806400,0x1862460,0x30001c1c,0x4000000,0x200000,0x30001c1c,0x6800100,0x1862400,0x30001c1c,0x6800100,0x1862540,0x30001c1c,0x7c00100, -0x1830000,0x30001c1c,0x7c00100,0x1830001,0x30001c1c,0xc000010,0x448000,0x30001f0b,0x4000000,0x200000,0x30001f0b,0x4000010,0x200000,0x30001f0b,0x4000010,0x400000, -0x30001f0b,0x6800000,0x200000,0x30001f0b,0x7c00100,0x230400,0x30001f0b,0xc000010,0x248000,0x30002006,0x7c00100,0x250400,0x30002128,0x4000010,0x200000,0x30002128, -0x7c00100,0x230400,0x30002128,0xc000010,0x248000,0x3000221d,0x4000000,0x810000,0x3000221d,0x4000000,0x1410000,0x3000221d,0x4000001,0x440000,0x3000221d,0x7c00100, -0x230400,0x30002300,0x4000010,0x400000,0x30002320,0x7c00100,0x230400,0x30002417,0x2802100,0x1862460,0x30002417,0x2802400,0x1862460,0x30002417,0x2806400,0x1862460, -0x30002417,0x2882000,0x1862460,0x30002417,0x4000000,0x200000,0x30002417,0x4000000,0x400000,0x30002417,0x4000000,0x1600000,0x30002417,0x4000010,0x400000,0x30002417, -0x4000010,0x1200000,0x30002417,0x6800000,0x1329800,0x30002417,0x6800100,0x1862540,0x30002417,0x7c00100,0x1830000,0x30002417,0x7d00100,0x1830000,0x3000251b,0x80000, -0xc18820,0x3000251b,0x2802100,0x962460,0x3000251b,0x3c02100,0x962460,0x3000251b,0x4000000,0x200000,0x3000251b,0x4000006,0x500000,0x3000251b,0x4000010,0x400000, -0x3000251b,0x4000010,0xb70000,0x3000251b,0x4000800,0x200000,0x3000251b,0x6800000,0x1329800,0x3000251b,0x7c00100,0x230400,0x3000251b,0x7c00900,0x230400,0x3000251b, -0xc000010,0xb48000,0x3000251b,0x12882000,0x962460,0x30002800,0x4000001,0xc41c0b,0x30002800,0x24000000,0x200000,0x30002800,0x2c000010,0x1248002,0x30002800,0x2c000010, -0x11248002,0x30002a00,0x4000000,0x1600000,0x30002b01,0x2000,0x962460,0x30002c00,0x4000000,0x200000,0x30002c00,0x7c00100,0x10220405,0x30002d19,0x7c00100,0x250400, -0x30002e00,0x24000000,0x200000,0x30003000,0x24000000,0x200000,0x30003100,0x24000000,0x200000,0x30003600,0x24000000,0x200000,0x30003700,0x24000000,0x200000,0x3000392e, -0x24000000,0x200000,0x30005013,0x7c00100,0x2633801,0x30005600,0,0x918820,0x30020600,0x4000400,0x500000,0x30020701,0x2802400,0x962460,0x30020701,0x2802400, -0xc62460,0x300a3a11,0x4020000,0xe00000,0x300a3a11,0x4020000,0xe00002,0x300a3b11,0x4020000,0xe00002,0x300a3c00,0x4008000,0xe00000,0x300a3c00,0x4010000,0xe00000, -0x300a3d11,0x7c00300,0xe30002,0x300a4305,0x7c00100,0xe30400,0x300a4611,0x7c40300,0xe30000,0x300a4829,0x7c00100,0xe30400,0x300a4829,0x7c00900,0x1230400,0x300a4929, -0x4000000,0xe00000,0x30402576,0x4000010,0x400000,0x30402576,0x4000010,0xb70000,0x30402576,0xc000010,0xb48000,0x304a3d92,0x4000000,0xe00000,0x30800c17,0x2802100, -0x962460,0x30c01c6e,0x6800000,0x1329800,0x3100080e,0x7c00120,0x220402,0x3100080e,0x7c00120,0x250402,0x31005167,0x1000,0,0x3100581e,0x4000000,0x200000, -0x3100581e,0x7c00100,0x230400,0x3100590d,0x7c00100,0x230400,0x31005a09,0x7c00100,0x220400,0x31005a09,0x7c00100,0x250400,0x31005b00,0x4000000,0x200000,0x31005c00, -0x80000,0x918820,0x31005c00,0x2802000,0x962460,0x31005c00,0x2802400,0x962460,0x31005c00,0x4000000,0x200000,0x31005c00,0x4000000,0x200001,0x31005c00,0x6800000, -0x962540,0x31005c00,0x6800400,0x962540,0x31005c01,0x2802400,0x962460,0x31005d00,0x4000020,0x200005,0x31005d00,0x6800020,0x1329805,0x31005d00,0x7c00120,0x220405, -0x31005d00,0x7c00120,0x250405,0x31006000,0x82000,0x962460,0x31006000,0x180000,0x918820,0x310a5e11,0x7c40300,0xe30000,0x310a5f11,0x7c00300,0xe30001,0x32000419, -0x7c00100,0x250400,0x3200080e,0x4000020,0x200000,0x3200080e,0x7c00100,0x220400,0x3200080e,0x7c00100,0x250400,0x32000908,0x7c00100,0x220400,0x32000908,0x7c00100, -0x250400,0x32000c02,0x7c00100,0x230400,0x32000e25,0x7c00100,0x230400,0x32001d0c,0x7c00100,0x230400,0x32002800,0x80000,0x1e18820,0x32002800,0x80020,0x218820, -0x32002800,0x4000001,0x440002,0x32002800,0x24000000,0x200000,0x32002800,0x24000000,0x200002,0x32002800,0x24000020,0x200000,0x32002800,0x2c000010,0x1248002,0x32002919, -0x7c00100,0x22040f,0x32002a00,0x4000000,0x1600000,0x32002b01,0x2000,0x962460,0x32002b01,0x2802000,0x962460,0x32002b01,0x2802020,0x962460,0x32002c00,0x4000000, -0x200000,0x32002c00,0x4000020,0x200000,0x32002c00,0x4000020,0x200005,0x32002c00,0x7c00120,0x220405,0x32002c00,0x7c00120,0x250405,0x32002e00,0x24000020,0x200000, -0x32002f00,0x24000020,0x200000,0x32003000,0x24000000,0x200000,0x32003000,0x24000020,0x200000,0x32003500,0x24000000,0x200000,0x32003600,0x24000020,0x200000,0x32003600, -0x24000020,0x10200000,0x32003700,0x24000000,0x100000,0x32003700,0x24000000,0x200000,0x32003700,0x24000000,0x10200000,0x32003800,0x24000000,0x810000,0x32003800,0x24000000, -0x1410000,0x32005102,0x4000000,0x1500008,0x32005502,0x7c00100,0x230400,0x32006108,0x7c00100,0x220400,0x32006108,0x7c00100,0x250400,0x3200622a,0x2802100,0x962460, -0x3200622a,0x2806000,0x962460,0x3200622a,0x7c00100,0x230400,0x3200632b,0x2802100,0x962460,0x3200632b,0x2806000,0x962460,0x3200632b,0x7c00100,0x230400,0x3200642c, -0x2802100,0x962460,0x3200642c,0x7c00100,0x230400,0x3200652d,0x2802100,0x962460,0x3200652d,0x7c00100,0x230400,0x32006600,0x24000020,0x200000,0x32006700,0x24000020, -0x200000,0x32006800,0x24000020,0x200000,0x32006800,0x24000020,0x10200000,0x32006900,0x24000020,0x200000,0x32006900,0x24000020,0x810000,0x32006900,0x24000020,0x1410000, -0x32006a00,0x24000020,0x200000,0x32006a00,0x24000020,0x200001,0x32006a00,0x24000020,0x200002,0x32020701,0x2882000,0xc62460,0x32023300,0x4000000,0x100000,0x32026c01, -0x12882000,0x962460,0x32065700,0x4000000,0x810011,0x32065700,0x4000000,0x1410011,0x32086600,0x24000020,0x810000,0x32086600,0x24000020,0x1410000,0x32086900,0x24000020, -0x810000,0x32086900,0x24000020,0x1410000,0x320a3600,0x24000020,0x30200000,0x320a3d11,0x7c00100,0x1230400,0x320a3e14,0x7c00100,0xe30010,0x320a3e14,0x7c00100,0x2530000, -0x320a3f16,0x7c00100,0xe30c10,0x320a4400,0x4000000,0xe00003,0x320a4929,0x4000000,0xe00000,0x320a4f11,0x7c00300,0xe30001,0x320a6b16,0x7c00100,0x2530c00,0x32406372, -0xc000010,0x448000,0x324a3d95,0x4000000,0x10e00000,0x324a3d95,0x7c00100,0x1230400,0x324a3f90,0x4000002,0x1200c00,0x324a538d,0x24000000,0xe00000,0x32820701,0x2802000, -0x962460,0x40000419,0x7c00100,0x220400,0x40000519,0x7c00100,0x220400,0x40000600,0x4000400,0x200000,0x4000080e,0x7c00100,0x220400,0x4000080e,0x7c00100,0x250400, -0x4000080e,0x7c00100,0x250402,0x40000c02,0,0x218960,0x40000c02,0x2802100,0x962460,0x40000c02,0x2802400,0x962460,0x40000c02,0x2802500,0x962460,0x40000c02, -0x4000000,0x200000,0x40000c02,0x4000000,0x1071400,0x40000c02,0x7c00100,0x230400,0x40000d22,0x7c00100,0x230400,0x40000f0a,0x7c00100,0x230400,0x40001004,0x7c00100, -0x230400,0x40001110,0x2802100,0x962460,0x40001110,0x6800100,0x962540,0x4000120f,0x2802100,0x962460,0x4000120f,0x4000000,0x1600000,0x4000120f,0x7c00100,0x230400, -0x4000131f,0x7c00100,0x230400,0x40001423,0x4000000,0x200000,0x40001423,0x4000000,0x1600000,0x40001615,0x2802400,0x962460,0x40001615,0x7c00100,0x230400,0x40002417, -0x2802400,0x1862460,0x40002417,0x4000000,0x200000,0x40002800,0x6800000,0x201c00,0x40002800,0x24000002,0x200000,0x40002c00,0x4000000,0x200002,0x40003000,0x24000000, -0x10200000,0x40003000,0x24000020,0x200000,0x40003700,0x24000000,0x200000,0x40003700,0x24000000,0x10200000,0x40005a09,0x7c00100,0x220400,0x40005a09,0x7c00100,0x250400, -0x40005d00,0x7c00120,0x220405,0x40006f30,0x2802100,0x962460,0x40006f30,0x2802400,0x962460,0x40006f30,0x4000000,0x200000,0x40006f30,0x6800000,0x1329800,0x40006f30, -0x6800100,0x962540,0x40006f30,0x7c00100,0x230400,0x40006f30,0xc000010,0xb48000,0x40007034,0x7c00100,0x1830000,0x40007117,0x4000000,0x200000,0x40007208,0x7c00100, -0x220400,0x4000720e,0x7c00100,0x220400,0x4000720e,0x7c00500,0x22040e,0x4000720e,0x7c00500,0x22040f,0x40007219,0x7c00100,0x220400,0x40007219,0x7c00500,0x220400, -0x40007219,0x7c00500,0x22040e,0x40007219,0x7c00500,0x22040f,0x40007300,0x24000000,0x200000,0x40007300,0x24000000,0x10200000,0x40007400,0x4000000,0x200000,0x40007531, -0x7c00100,0x230400,0x40007631,0x7c00100,0x230400,0x40007835,0x4000010,0x400000,0x40007835,0x7c00100,0x230400,0x40007933,0x7c00100,0x230400,0x40007a32,0x6800000, -0x1329800,0x40007a32,0x7c00100,0x230400,0x40007b2f,0x7c00100,0x230400,0x40007c00,0x4000000,0x200000,0x40020701,0x2802400,0x962460,0x40020701,0x2802400,0xc62460, -0x40023300,0x4000000,0x200000,0x40027d01,0x12882000,0x962460,0x400a3700,0x24000000,0x30200000,0x400a3700,0x24000000,0x30e00000,0x400a4400,0x4000000,0xe0000d,0x400a4412, -0x4000000,0xe00002,0x400a4412,0x4000000,0xe00003,0x400a4500,0x4000000,0xe0000d,0x400a5300,0x4000000,0x810010,0x400a5300,0x4000000,0x1410010,0x404077b8,0x4000000, -0x200000,0x404077bb,0x4000000,0x200000,0x404077bb,0x4000000,0x400000,0x40c0511b,0x4000000,0x200000,0x41000419,0x7c00100,0x220400,0x41000419,0x7c00100,0x250400, -0x4100080e,0x7c00100,0x220400,0x4100080e,0x7c00100,0x250400,0x41000908,0x7c00100,0x220400,0x41000908,0x7c00100,0x250400,0x41000b13,0x2802000,0x962460,0x41000b13, -0x2802100,0x962460,0x41000b13,0x4000000,0xb00000,0x41000c02,0x2802100,0x962460,0x41000c02,0x4000000,0xb00000,0x41000c02,0x4000000,0x1500000,0x41000f0a,0x7c00100, -0x230400,0x41001004,0x7c00100,0x230400,0x41001423,0x7c00100,0x230400,0x41001b27,0x4000000,0x500000,0x41001d0c,0x7c00100,0x230400,0x41001d0c,0x7c00100,0x23040f, -0x41001f0b,0x2802100,0x962460,0x41001f0b,0x4000000,0x200000,0x41001f0b,0x7c00100,0x230400,0x41002800,0x24000000,0x200000,0x41002800,0x24000000,0x400000,0x41002919, -0x7c00100,0x22040e,0x41002a00,0x4000000,0x1600000,0x41002b01,0x2802020,0x962460,0x41002c00,0x4000000,0x200000,0x41002c00,0x7c00120,0x220405,0x41003000,0x24000000, -0x200000,0x41003700,0x24000000,0x200000,0x41003700,0x24000000,0x10200000,0x41003700,0x24000000,0x10e00000,0x41005d00,0x7c00120,0x220405,0x41006600,0x24000020,0x200000, -0x41006600,0x24000020,0x810000,0x41006600,0x24000020,0x1410000,0x41007208,0x7c00100,0x22040f,0x41007219,0x7c00100,0x220400,0x41007300,0x24000000,0x200000,0x41007e0e, -0x2802000,0x962460,0x41007e0e,0x4000000,0x200000,0x41007f0e,0x4000000,0x200000,0x41007f0e,0x7c00100,0x230400,0x41008002,0x7c00100,0x230400,0x41008137,0x2802100, -0x962460,0x41008137,0x4000000,0x200000,0x41008137,0x6800100,0x962540,0x41008137,0x7c00100,0x230400,0x41008301,0x2802000,0x962460,0x41008407,0x4000000,0x200000, -0x41008407,0x4000000,0x400000,0x41008407,0x4000000,0xb00000,0x41008407,0x7c00100,0x220400,0x41008407,0x7c00100,0x250400,0x4100850b,0x7c00100,0x230400,0x4100860b, -0x4000000,0x200000,0x4100860b,0x7c00100,0x230400,0x4100870c,0x7c00100,0x220400,0x41008838,0x7c00100,0x220400,0x41008838,0x7c00100,0x250400,0x41008939,0x2802000, -0x962460,0x41008939,0x2802100,0x962460,0x41008939,0x2806000,0x962460,0x41008939,0x4000000,0x200000,0x41008939,0x4000000,0x400000,0x41008939,0x7c00100,0x230400, -0x41008939,0xc000010,0x448000,0x41008a00,0x4000000,0x200000,0x41008b3b,0x4000000,0x1800000,0x41008b3b,0x6800000,0x1329800,0x41008b3b,0x7c00100,0x1830000,0x41008b3b, -0x7e00100,0x1830000,0x41008c3d,0x4000010,0x400000,0x41008c3d,0x7c00100,0x230400,0x41008d0e,0x7c00100,0x22040f,0x41008d19,0x7c00100,0x220400,0x41008d19,0x7c00100, -0x22040f,0x41008e00,0x24000000,0x200000,0x41008e00,0x24000000,0x400000,0x41008e00,0x24000000,0x1710000,0x41008e00,0x24000006,0x400000,0x41008f3a,0x2802000,0x962460, -0x41008f3a,0x2802100,0x962460,0x41008f3a,0x2806000,0x962460,0x41008f3a,0x4000000,0x200000,0x41008f3a,0x6800100,0x962540,0x41008f3a,0x7c00100,0x230400,0x4100903c, -0x7c00100,0x230400,0x4100903c,0x7c00100,0x23040f,0x41020701,0x2802000,0x962460,0x41020701,0x2802000,0xc62460,0x410a3700,0x24000000,0x30200000,0x410a3700,0x24000000, -0x30e00000,0x410a4412,0x4000000,0xe00003,0x410a4711,0x7c40300,0xe30000,0x410a4f11,0x7c00300,0xe30001,0x410a9100,0x4000000,0x800010,0x410a9100,0x4000000,0x810010, -0x410a9100,0x4000000,0x870010,0x410a9100,0x4000000,0xb00010,0x410a9100,0x4000000,0xf00010,0x410a9100,0x4000000,0x1001410,0x410a9100,0x4000000,0x1071010,0x410a9100, -0x4000000,0x1071410,0x410a9100,0x4000000,0x1410010,0x414a8292,0x4000000,0xe00000,0x41808300,0x2802000,0x962460,0x41c01469,0x6800000,0x1329800,0x50000419,0x7c00100, -0x220400,0x50000419,0x7c00100,0x250400,0x5000080e,0x7c00100,0x220400,0x50000908,0x7c00100,0x220400,0x50000908,0x7c00100,0x250400,0x50000b13,0x2802500,0x962460, -0x50000f0a,0x7c00100,0x230400,0x50001615,0x2802100,0x962460,0x50001615,0x7c00100,0x230400,0x50002b01,0x2802020,0x962460,0x50002c00,0x4000000,0x200000,0x50002c19, -0x7c00100,0x220400,0x50002d19,0x7c00100,0x220400,0x50003000,0x24000000,0x200000,0x50003000,0x24000020,0x200000,0x50003700,0x24000000,0x200000,0x50005d00,0x7c00120, -0x220405,0x50005d00,0x7c00120,0x250405,0x50006108,0x7c00100,0x220400,0x50006108,0x7c00100,0x250400,0x50006600,0x24000020,0x200000,0x50007300,0x24000000,0x200000, -0x50008301,0x2802400,0x962460,0x50008a00,0x7c00500,0x230400,0x50009257,0x2802400,0x962460,0x50009257,0x4000000,0x200000,0x50009257,0x4000010,0x1071400,0x50009257, -0x6800000,0x1329800,0x50009257,0x7c00100,0x230400,0x50009257,0x7c00500,0x230400,0x50009257,0x7c00900,0x230400,0x50009257,0xc000010,0xb48000,0x5000933e,0x2802100, -0x962460,0x5000933e,0x2802400,0x962460,0x5000933e,0x4000000,0x200000,0x5000933e,0x4000000,0x400000,0x5000933e,0x4000010,0x400000,0x5000933e,0x6800000,0x1329800, -0x5000933e,0x6800100,0x962540,0x5000933e,0x6800100,0x962541,0x5000933e,0x6804400,0x962540,0x5000933e,0x7c00100,0x230400,0x5000933e,0x7c00100,0x230401,0x5000933e, -0xc000010,0x448000,0x50009419,0x7c00100,0x220400,0x50009419,0x7c00100,0x250400,0x50009500,0x4000400,0x200000,0x5000965a,0x4000000,0x500000,0x5000965a,0x7c00100, -0x230400,0x5000965a,0xc000010,0xb48000,0x5000975b,0x4000000,0x200000,0x5000975b,0x4000010,0x400000,0x5000975b,0x7c00100,0x230400,0x50009865,0x7c00100,0x230400, -0x50009965,0x4000010,0x400000,0x50009965,0x7c00100,0x230400,0x50409a92,0x4000000,0x200000,0x5100080e,0x7c00100,0x220400,0x5100080e,0x7c00100,0x250400,0x51000c02, -0x2802100,0x962460,0x51000c02,0x4000000,0x1500000,0x51000c02,0x4000020,0x200000,0x51000c02,0x7c00100,0x230400,0x51000f0a,0x7c00100,0x230400,0x51000f0a,0x7c00500, -0x230400,0x51001110,0x2802100,0x962460,0x5100131f,0x2802100,0x962460,0x51001423,0x7c00100,0x230400,0x51001524,0x2802100,0x962460,0x51001524,0x4000000,0x200000, -0x51001524,0x7c00100,0x230400,0x5100171a,0x2802100,0x962460,0x5100171a,0x4000000,0x200000,0x5100171a,0x4000000,0x1500000,0x5100171a,0x7c00100,0x230400,0x51001b27, -0x4000000,0x200000,0x51001b27,0x4000000,0x400000,0x51001b27,0x4000000,0x500000,0x51001b27,0x7c00100,0x230400,0x51001c1c,0x2802100,0x1862460,0x51001c1c,0x2802400, -0x1862460,0x51001c1c,0x2806400,0x1862460,0x51001c1c,0x4000000,0x1800000,0x51001c1c,0x6800000,0x1329800,0x51001c1c,0x6800000,0x1862400,0x51001c1c,0x6800100,0x1862400, -0x51001c1c,0x6800100,0x1862540,0x51001c1c,0x6800400,0x1862400,0x51001c1c,0x7c00100,0x1830000,0x5100251b,0x7c00100,0x230400,0x51002619,0x7c00100,0x220400,0x51002619, -0x7c00100,0x250400,0x51002800,0x80020,0x218820,0x51002c00,0x4000000,0x200000,0x51002d19,0x7c00100,0x230400,0x51003700,0x24000000,0x200000,0x51003700,0x24000000, -0xe00000,0x51005201,0x2802400,0x962460,0x51005c00,0x4000000,0x200000,0x51006108,0x7c00100,0x220400,0x51006108,0x7c00100,0x250400,0x51006600,0x24000020,0x200000, -0x51006600,0x24000020,0x810000,0x51006600,0x24000020,0x1410000,0x51007300,0x24000000,0x200000,0x51007300,0x24000020,0x200000,0x51008002,0x7c00100,0x230400,0x51008301, -0x2802000,0x962460,0x51008301,0x2802400,0x962460,0x51008a00,0x7c00500,0x230400,0x51008e00,0x24000000,0x200000,0x51008e00,0x24000000,0x400000,0x51008e00,0x24000000, -0x810000,0x51008e00,0x24000000,0x1400000,0x51008e00,0x24000000,0x1410000,0x51008e00,0x24000000,0x1710000,0x51008e00,0x24000002,0x200000,0x51008e00,0x24000500,0x230400, -0x51008e00,0x2c000010,0xb48000,0x51009419,0x7c00100,0x220400,0x51009419,0x7c00100,0x22040e,0x51009419,0x7c00100,0x22040f,0x51009419,0x7c00100,0x250400,0x51009500, -0x4000000,0x200000,0x51009500,0x7c00500,0x230400,0x51009519,0x7c00100,0x220400,0x51009519,0x7c00100,0x22040f,0x51009519,0x7c00100,0x230400,0x51009519,0x7c00100, -0x250400,0x51009b71,0x2802100,0x962460,0x51009b71,0x6800000,0x1329800,0x51009b71,0x6800100,0x962540,0x51009b71,0x6804400,0x962540,0x51009b71,0x7c00100,0x230400, -0x51009c52,0x2802100,0x962460,0x51009c52,0x2802400,0x962460,0x51009c52,0x2802c00,0x962460,0x51009c52,0x4000010,0x400000,0x51009c52,0x6800000,0x1329800,0x51009c52, -0x6800100,0x962540,0x51009c52,0x7c00100,0x230400,0x51009c52,0xc000010,0x448000,0x51009d6d,0x6800000,0x1329800,0x51009d6d,0x7c00100,0x230400,0x51009d6d,0x7c00500, -0x230400,0x51009d6d,0x7c00d00,0x230400,0x51009d6d,0xc000010,0x448000,0x51009e08,0x2802100,0x962460,0x51009f63,0x4000010,0x400000,0x51009f63,0x6800000,0x1329800, -0x51009f63,0x7c00100,0x230400,0x51009f63,0x7c00900,0x230400,0x51009f63,0xc000010,0x448000,0x51009f63,0xc000010,0xb48000,0x5100a008,0x2000,0x962460,0x5100a008, -0x2802400,0x962460,0x5100a008,0x4000000,0x200000,0x5100a008,0x7c00100,0x220400,0x5100a008,0x7c00100,0x230400,0x5100a008,0x7c00100,0x250400,0x5100a008,0x7c00500, -0x230400,0x5100a16f,0x2806400,0x962460,0x5100a16f,0x6800000,0x1329800,0x5100a16f,0x6800100,0x962540,0x5100a16f,0x7c00100,0x230400,0x5100a16f,0xc000010,0x448000, -0x5100a24f,0x2802100,0x962460,0x5100a24f,0x2802400,0x962460,0x5100a24f,0x6800000,0x1329800,0x5100a24f,0x7c00100,0x230400,0x5100a24f,0xc000010,0x448000,0x5100a36e, -0x2802100,0x962460,0x5100a36e,0x4000000,0x200000,0x5100a36e,0x6800100,0x962540,0x5100a36e,0x6804400,0x962540,0x5100a36e,0x7c00100,0x230400,0x5100a442,0x2802100, -0x962460,0x5100a442,0x4000000,0x200000,0x5100a442,0x6800000,0x1329800,0x5100a442,0x6800100,0x962540,0x5100a442,0x7c00100,0x230400,0x5100a442,0xc000010,0x448000, -0x5100a500,0x4000000,0x200000,0x5100a600,0x4000000,0x200000,0x5100a601,0x2802000,0x962460,0x5100a76b,0x7c00100,0x230400,0x5100a868,0x7c00100,0x230400,0x5100a96c, -0x4000000,0x200000,0x5100a96c,0x7c00100,0x230400,0x5100aa00,0x4000000,0xe00000,0x5100ab00,0x4000000,0xe00000,0x51086600,0x24000020,0x810000,0x51086600,0x24000020, -0x1410000,0x510a4005,0x7c00100,0xe30400,0x510a4711,0x7c40300,0xe30000,0x510a7300,0x24000000,0x30200000,0x510aaa00,0x4000000,0x30e00000,0x5140a2b3,0x4000400,0x400000, -0x514a8292,0x4000000,0xe00000,0x51802b84,0x2802000,0x962460,0x51c00908,0x2802400,0x962460,0x51c0a008,0x2802400,0x962460,0x52000f0a,0x2802100,0x962460,0x52000f0a, -0x6800100,0x962540,0x52000f0a,0x7c00100,0x230400,0x52001004,0x4000000,0x1600000,0x52001b00,0x4000000,0x200000,0x52001c1c,0x2802100,0x1862460,0x52001c1c,0x6800100, -0x1862400,0x52001c1c,0x6800400,0x1862400,0x52001e12,0x7c00100,0x2230500,0x52001e12,0x7c00100,0x2330520,0x52002128,0x4000002,0x400000,0x52002128,0x7c00100,0x230400, -0x52002a00,0x4000000,0x1500000,0x52002a00,0x4000000,0x1600000,0x52002d00,0x4000000,0x200006,0x52003000,0x24000000,0x200000,0x52006108,0x7c00100,0x220400,0x52006108, -0x7c00100,0x250400,0x52008301,0x2802400,0x962460,0x52008407,0x2802400,0x962460,0x52008407,0x7c00100,0x220400,0x52008407,0x7c00100,0x250400,0x52008b3b,0x6800000, -0x1800000,0x52008b3b,0x7c00100,0x1830000,0x52008e00,0x24000000,0x400000,0x52009419,0x7c00100,0x250400,0x5200975b,0x4000000,0x200000,0x5200ac7e,0x2802000,0x962460, -0x5200ac7e,0x2802100,0x962460,0x5200ac7e,0x2802400,0x962460,0x5200ac7e,0x4000010,0x200000,0x5200ac7e,0x7c00100,0x230400,0x5200ad28,0x7c00100,0x230400,0x5200ae6a, -0x2802100,0x1862460,0x5200ae6a,0x2802400,0x962460,0x5200ae6a,0x2802400,0x1862460,0x5200ae6a,0x2806000,0x1862460,0x5200ae6a,0x4000000,0x1800000,0x5200ae6a,0x6800000, -0x1329800,0x5200ae6a,0x6800100,0x1862400,0x5200ae6a,0x6800100,0x1862540,0x5200ae6a,0x7c00100,0x1830000,0x5200ae6a,0x7c00900,0x1830000,0x5200ae6a,0xc000010,0x1848000, -0x5200b083,0x4000010,0x400000,0x5200b083,0x7c00100,0x230400,0x5200b083,0xc000010,0x448000,0x5200b182,0x2802400,0x962460,0x5200b182,0x4000000,0x200000,0x5200b182, -0x4000010,0x400000,0x5200b182,0x7c00100,0x230400,0x5200b182,0xc000010,0x448000,0x5200b30a,0x2802400,0x962460,0x5200b30a,0x4000000,0x200000,0x5200b30a,0x7c00100, -0x230400,0x5200b54e,0x2802100,0x962460,0x5200b54e,0x2802400,0x962460,0x5200b54e,0x4000000,0x200000,0x5200b54e,0x4000010,0x400000,0x5200b54e,0x6800000,0x1329800, -0x5200b54e,0x6800100,0x962540,0x5200b54e,0x6804400,0x962540,0x5200b54e,0x7c00100,0x230400,0x5200b54e,0xc000010,0x448000,0x5200b61c,0x4000000,0x1800000,0x5200b61c, -0x6800400,0x1862400,0x5200b61c,0x7c00100,0x1830000,0x5200b61c,0x7c00900,0x1830000,0x5200b77f,0x2802100,0x1862460,0x5200b77f,0x2802400,0x1862460,0x5200b77f,0x4000000, -0x1800000,0x5200b77f,0x4000010,0x1800000,0x5200b77f,0x7c00100,0x1830000,0x5200b77f,0x7c00500,0x1830000,0x5200b77f,0x7c00900,0x1830000,0x5200b77f,0x7e00100,0x1830000, -0x5200b873,0x2802100,0x962460,0x5200b873,0x2806400,0x962460,0x5200b873,0x6800000,0x1329800,0x5200b873,0x6800100,0x962540,0x5200b873,0x6800400,0x962540,0x5200b873, -0x7c00100,0x230400,0x5200b873,0xc000010,0x448000,0x5200b912,0x7c00100,0x2230500,0x5200b912,0x7c00100,0x2330520,0x5200ba74,0x4000000,0x200000,0x5200ba74,0x4000010, -0x400000,0x5200ba74,0x7c00100,0x230400,0x5200bb85,0x4000000,0x200000,0x5200bb85,0x7c00100,0x230400,0x5200bc75,0x4000000,0x400000,0x5200bc75,0x4000010,0x400000, -0x5200bc75,0x7c00100,0x230400,0x5200bd7d,0x4000000,0x200000,0x5200bd7d,0x7c00100,0x230400,0x5200be7a,0x4000000,0x200000,0x5200be7a,0x7c00100,0x230400,0x5200bf58, -0x7c00100,0x230400,0x5200c002,0x4000000,0x200000,0x5200c178,0,0x218960,0x5200c178,0x2802000,0x962460,0x5200c178,0x2802100,0x962460,0x5200c178,0x2802400, -0x962460,0x5200c178,0x2806400,0x962460,0x5200c178,0x4000000,0x200000,0x5200c178,0x6800100,0x962540,0x5200c178,0x7c00100,0x230400,0x5200c178,0x7c00100,0x230401, -0x5200c178,0xc000010,0x448000,0x5200c247,0x7c00100,0x230400,0x5200c247,0x7c00100,0x830400,0x5200c247,0x7c00100,0x1430400,0x5200c300,0x4000000,0x200003,0x52022d00, -0x4000000,0x100006,0x52023700,0x24000000,0x100000,0x52023700,0x24000000,0xe00000,0x52023700,0x24000000,0x10100000,0x52023700,0x24000000,0x10e00000,0x52023700,0x24000000, -0x928045a0,0x52024400,0x4000000,0x100000,0x52027300,0x24000000,0x100000,0x5202c300,0x4000000,0x100000,0x5202c300,0x4000000,0x100002,0x5202c300,0x4000000,0x100003, -0x5202c300,0x4000000,0x10000d,0x5202c300,0x4000100,0x150400,0x5202c300,0x4000100,0x15040d,0x5202c300,0x4000100,0x10150400,0x520a1e12,0x7c00100,0x2130480,0x520a3700, -0x24000000,0x30e00000,0x520a3800,0x24000000,0x30100000,0x520a4711,0x7c40300,0xe30000,0x520a4f11,0x7c00300,0xe30001,0x520a7300,0x24000000,0x30100000,0x520ab412,0x7c00100, -0x2130480,0x520ac400,0x4000000,0xe00002,0x520ac400,0x4000000,0xe0000d,0x520ac400,0x4000000,0x30e0000d,0x520ac414,0x4000000,0xe0000d,0x520ac511,0x7c40300,0xe30000, -0x5240af78,0x6800400,0x962540,0x5240af78,0x7c00100,0x230400,0x5240af79,0x4000400,0x200000,0x5240af79,0x6800100,0x962540,0x5240b298,0x4000000,0x200000,0x5240b2a2, -0x4000000,0x200000,0x5240b2a2,0x4000000,0x1500000,0x5240b5b6,0x7c00900,0x230400,0x524a4492,0x4000000,0xe00003,0x5280af78,0x2802400,0x962460,0x5280af79,0x2802400, -0x962460,0x5280af7b,0x2802400,0x962460,0x5280af7d,0x2802400,0x962460,0x52c0b3ad,0x2802400,0x962460,0x52c0b3b1,0x7c00100,0x230400,0x60000c02,0x2802100,0x962460, -0x60000c02,0x7c00100,0x230400,0x60000f0a,0x2802100,0x962460,0x60000f0a,0x6800100,0x962540,0x60000f0a,0x7c00100,0x230400,0x6000131f,0x4000000,0x200000,0x6000171a, -0x7c00100,0x230400,0x6000171a,0x7c00100,0x230560,0x60001b27,0x2802100,0x962460,0x60001b27,0x4000000,0xc00000,0x60001b27,0x7c00100,0x230400,0x60001f0b,0x2802000, -0x962460,0x60002919,0x7c00100,0x22040e,0x60002a00,0x4000000,0x1600000,0x60003000,0x24000000,0x10200000,0x60003000,0x24000000,0x10e00000,0x60003700,0x24000000,0x200000, -0x60003800,0x24000000,0x1710000,0x60005102,0x4000000,0x200000,0x60006108,0x7c00100,0x220400,0x60006108,0x7c00100,0x250400,0x60006600,0x24000020,0x200000,0x60008301, -0x2802000,0x962460,0x6000903c,0x2806000,0x962460,0x6000903c,0x4000000,0x400000,0x60009519,0x7c00100,0x220400,0x60009519,0x7c00100,0x250400,0x6000a008,0x7c00100, -0x220400,0x6000a008,0x7c00100,0x250400,0x6000c300,0x4000000,0x32703580,0x6000c654,0x2802000,0x962460,0x6000c654,0x4000010,0x200000,0x6000c654,0x7c00100,0x230400, -0x6000c73f,0x2802000,0x962460,0x6000c73f,0x2802100,0x962460,0x6000c73f,0x4000000,0x200000,0x6000c73f,0x6800100,0x962540,0x6000c73f,0x6804000,0x962540,0x6000c73f, -0x7c00100,0x230400,0x6000c80b,0x7c00100,0x230400,0x6000c941,0x2802100,0x962460,0x6000c941,0x2806000,0x962460,0x6000c941,0x4000000,0x200000,0x6000c941,0x4000010, -0x200000,0x6000c941,0x6800000,0x1329800,0x6000c941,0x6800100,0x962540,0x6000c941,0x7c00100,0x230400,0x6000c941,0xc000010,0x448000,0x6000ca82,0x7c00100,0x230400, -0x6000cc00,0x4000000,0xe00000,0x6000d000,0x4000000,0x200000,0x6002c300,0x4000000,0x100000,0x6002c300,0x4000000,0x10000d,0x6002c300,0x4000100,0x150400,0x6002c300, -0x4000100,0x15040d,0x6002c300,0x4000100,0x10150400,0x600a3000,0x24000000,0x30200000,0x600a3000,0x24000000,0x30e00000,0x600a3700,0x24000000,0x30200000,0x600a3800,0x24000000, -0x30200000,0x600a3800,0x24000000,0xb28045a0,0x600a4305,0x7c00100,0xe30400,0x600ac300,0x4000000,0x30100000,0x600ac400,0x4000000,0x10e0000d,0x600ac400,0x4000000,0x30e0000d, -0x600acb14,0x7c00100,0xe30000,0x600acb16,0x7c00100,0xe30c00,0x600acc00,0x4000000,0x30e00000,0x600acd00,0x4000000,0x30200000,0x600acd00,0x4000000,0x30e00000,0x600acd00, -0x4000000,0x30e05200,0x600acd00,0x4000000,0xb0e00000,0x600acd00,0x4000000,0xb28045a0,0x600acd00,0x4000000,0xb28049c0,0x600ace00,0x4000000,0x30e00000,0x600ace00,0x4000000, -0xb28045a0,0x600acf00,0x4000000,0x30e00000,0x600acf00,0x4000000,0xb28045a0,0x600ad111,0x7c40300,0xe30000,0x604ac492,0x4000000,0x30e00003,0x61000a03,0x4000000,0x1600000, -0x61000c02,0,0x218960,0x6100120f,0x4000000,0x200000,0x61001a18,0x7c00100,0x1830000,0x61001d0c,0x7c00100,0x230400,0x61001d0c,0x7c00100,0x250400,0x61006600, -0x24000020,0x200000,0x61008407,0x7c00100,0x220400,0x61008407,0x7c00100,0x250400,0x6100870c,0x7c00100,0x220400,0x61008e00,0x24000000,0x200000,0x61008e00,0x24000000, -0x400000,0x61008e00,0x24000002,0x300000,0x6100903c,0x7c00100,0x230400,0x61009519,0x7c00100,0x220400,0x61009519,0x7c00100,0x250400,0x61009519,0x7c00500,0x22040f, -0x61009b71,0x2802100,0x962460,0x61009b71,0x2806400,0x962460,0x61009b71,0x7c00100,0x230400,0x6100a008,0x2802100,0x962460,0x6100c300,0x4000000,0x20000f,0x6100cd00, -0x4000000,0x200000,0x6100d202,0x2802400,0x962460,0x6100d202,0x2802500,0x962460,0x6100d202,0x7c00100,0x230400,0x6100d302,0x4000020,0x200000,0x6100d302,0x7c00120, -0x230405,0x6100d476,0x2802100,0x962460,0x6100d476,0x2802100,0x962461,0x6100d476,0x2806400,0x962460,0x6100d476,0x4000000,0x400000,0x6100d476,0x6800000,0x1329800, -0x6100d476,0x6800100,0x962540,0x6100d476,0x7c00100,0x230400,0x6100d476,0xc000010,0x448000,0x6100d573,0x2802100,0x962460,0x6100d573,0x2806400,0x962460,0x6100d573, -0x6800100,0x962540,0x6100d573,0x7c00100,0x230400,0x6100d573,0x7c00900,0x230400,0x6100d573,0xc000010,0x448000,0x6100d68d,0x7c00100,0x230400,0x6100d756,0x7c00100, -0x230400,0x6100d85c,0x2802400,0x962460,0x6100d85c,0x6800100,0x962540,0x6100d85c,0x7c00100,0x230400,0x6100d85c,0x7c00500,0x230400,0x6100d997,0x2802100,0x962460, -0x6100d997,0x4000000,0x200000,0x6100d997,0x4000000,0x400000,0x6100d997,0x6800000,0x1329800,0x6100d997,0x6800100,0x962540,0x6100d997,0x6804400,0x962540,0x6100d997, -0x7c00100,0x230400,0x6100d997,0x7c00100,0x230560,0x6100d997,0xc000010,0x448000,0x6100da98,0x6800000,0x1329800,0x6100da98,0x7c00100,0x230400,0x6100db71,0x4000000, -0x200000,0x6100dc99,0x2802100,0x962460,0x6100dc99,0x2802400,0x962460,0x6100dc99,0x6800000,0x1329800,0x6100dc99,0x6800100,0x962540,0x6100dc99,0x6804400,0x962540, -0x6100dc99,0x7c00100,0x230400,0x610a4711,0x7c40300,0xe30000,0x610a4f11,0x7c00300,0xe30001,0x610ace00,0x4000000,0x30e00000,0x6140af78,0x7c00100,0x230400,0x6140af79, -0x6800100,0x962540,0x6140af82,0x7c00100,0x230400,0x6180af79,0x2802400,0x962460,0x62002a00,0x4000000,0x1600000,0x63000c00,0x80000,0x918820,0x63002800,0x80000, -0x918820,0x7000080e,0x7c00100,0x250400,0x70000a03,0x4000000,0x200000,0x70000c00,0,0x218960,0x70000f0a,0x7c00100,0x230400,0x70001004,0x7c00100,0x230400, -0x70001524,0x2802100,0x962460,0x70001524,0x7c00100,0x230400,0x70001615,0x2802100,0x962460,0x7000171a,0x2802100,0x962460,0x70001821,0x6800000,0x1329800,0x70002320, -0x7c00100,0x230400,0x70002a00,0x4000000,0x1500000,0x70002a00,0x4000000,0x1600000,0x70003000,0x24000000,0x200000,0x70003000,0x24000000,0x10200000,0x70003800,0x24000000, -0xe00000,0x70005201,0x2802400,0x962460,0x7000581e,0x7c00100,0x230400,0x70006108,0x7c00100,0x220400,0x70006108,0x7c00100,0x250400,0x70006f30,0x7c00100,0x230400, -0x70007300,0x24000000,0x200000,0x70007f0e,0x4000000,0x200000,0x70008301,0x2802100,0x962460,0x70008301,0x2802400,0x962460,0x70008e00,0x24000000,0x200000,0x70008e00, -0x24000000,0x400000,0x70008e00,0x24000002,0x400000,0x70008e00,0x24000008,0x1410000,0x70008e00,0x24000010,0x400000,0x70008e00,0x2c000010,0x448000,0x70009519,0x7c00100, -0x220400,0x70009519,0x7c00100,0x230400,0x70009519,0x7c00100,0x250400,0x70009865,0x7c00100,0x230400,0x70009965,0x4000010,0x400000,0x70009965,0x7c00100,0x230400, -0x7000a008,0x7c00100,0x220400,0x7000a008,0x7c00100,0x250400,0x7000a008,0x7c00500,0x22040f,0x7000a50e,0x4000000,0x200000,0x7000b61c,0x2802400,0x1862460,0x7000b61c, -0x6800400,0x1862400,0x7000b61c,0x7c00100,0x1830000,0x7000c300,0x4000000,0x100000,0x7000c941,0x2806000,0x962460,0x7000cc00,0x4000000,0xe00000,0x7000cd00,0x4000000, -0x200000,0x7000cd00,0x4000000,0xe00000,0x7000cd00,0x4000000,0x10200000,0x7000cd00,0x4000000,0x10e00000,0x7000cd00,0x4000000,0x10e05200,0x7000cd00,0x4000000,0x90e00000, -0x7000cd00,0x4000000,0x928045a0,0x7000cf00,0x4000000,0xe00000,0x7000cf00,0x4000000,0x10e00000,0x7000d202,0x2802100,0x962460,0x7000d202,0x7c00100,0x230400,0x7000d997, -0x7c00100,0x230400,0x7000d997,0xc000010,0x248000,0x7000dd86,0x2802400,0x962460,0x7000dd86,0x7c00100,0x230400,0x7000dd86,0xc000010,0x448000,0x7000de9f,0x4000000, -0x200000,0x7000de9f,0x7c00100,0x230400,0x7000e001,0x2000,0x962460,0x7000e001,0x2802400,0x962460,0x7000e187,0x2802000,0x962460,0x7000e187,0x2802100,0x962460, -0x7000e187,0x4000000,0x200000,0x7000e187,0x7c00100,0x230400,0x7000e187,0xc000010,0x448000,0x7000e288,0x7c00100,0x230400,0x7000e300,0x4000000,0x200000,0x7000e489, -0x2802100,0x962460,0x7000e489,0x2802400,0x962460,0x7000e489,0x6800100,0x962540,0x7000e489,0x6800100,0x962541,0x7000e489,0x6804400,0x962540,0x7000e489,0x7c00100, -0x230400,0x7000e489,0x7c00900,0x230400,0x7000e59d,0x2802100,0x962460,0x7000e59d,0x2802400,0x962460,0x7000e59d,0x4000000,0x200000,0x7000e59d,0x4000010,0x200000, -0x7000e59d,0x6800100,0x962540,0x7000e59d,0x6804400,0x962540,0x7000e59d,0x7c00100,0x230400,0x7000e59d,0xc000010,0x448000,0x7000e691,0x2802100,0x962460,0x7000e691, -0x2802400,0x962460,0x7000e691,0x2806400,0x962460,0x7000e691,0x6800000,0x1329800,0x7000e691,0x6800100,0x962540,0x7000e691,0x7c00100,0x230400,0x7000e700,0x4000400, -0x200000,0x7000e70e,0x7c00100,0x220400,0x7000e719,0x7c00100,0x220400,0x7000e719,0x7c00500,0x22040f,0x7000e853,0x7c00100,0x230400,0x7000e9a0,0x2802400,0x962460, -0x7000e9a0,0x4000000,0x200000,0x7000e9a0,0x4000000,0x500000,0x7000e9a0,0x7c00100,0x230400,0x7000ea79,0x2802400,0x962460,0x7000ea79,0x4000000,0x200000,0x7000ea79, -0x4000000,0xf00000,0x7000ea79,0x4000010,0x400000,0x7000ea79,0x7c00100,0x230400,0x7000eb8c,0x2802400,0x962460,0x7000eb8c,0x4000000,0x200000,0x7000eb8c,0x7c00100, -0x230400,0x7000eca3,0x2802100,0x962460,0x7000eca3,0x2806400,0x962460,0x7000eca3,0x4000000,0x200000,0x7000eca3,0x6800000,0x1329800,0x7000eca3,0x6800100,0x962540, -0x7000eca3,0x7c00100,0x230400,0x7000eca3,0xc000010,0x448000,0x7000ed95,0x6800000,0x1329800,0x7000ed95,0x7c00100,0x230400,0x7000ed95,0xc000010,0x448000,0x7000ee1c, -0x2802400,0x1862460,0x7000ee1c,0x6800000,0x1329800,0x7000ee1c,0x7c00100,0x1830000,0x7000ee1c,0x7c00900,0x1830000,0x7000ef8f,0x4000000,0x200000,0x7000ef8f,0x7c00100, -0x230400,0x7000f08e,0x4000000,0x200000,0x7000f08e,0x7c00100,0x230400,0x7000f159,0x2802100,0x962460,0x7000f159,0x7c00100,0x230400,0x7000f200,0x4000000,0x200000, -0x7000f200,0x4000000,0x1200000,0x7000f200,0x4000000,0x1710000,0x7000f34b,0x2802100,0x962460,0x7000f34b,0x4000000,0x200000,0x7000f34b,0x4000010,0x400000,0x7000f34b, -0x6800000,0x1329800,0x7000f34b,0x7c00100,0x230400,0x7000f34b,0x7c00900,0x230400,0x7000f34b,0xc000010,0x448000,0x7000f490,0x4000000,0x200000,0x7000f490,0x7c00100, -0x230400,0x7000f5a5,0x7c00100,0x230400,0x7000f67b,0x4000000,0x200000,0x7000f67b,0x4000010,0x200000,0x7000f67b,0x7c00100,0x230400,0x7000f8a6,0x2802100,0x962460, -0x7000f8a6,0x2802400,0x962460,0x7000f8a6,0x2806400,0x962460,0x7000f8a6,0x4000000,0x500000,0x7000f8a6,0x4000010,0xb00000,0x7000f8a6,0x4000800,0x200000,0x7000f8a6, -0x6800100,0x962540,0x7000f8a6,0x6800100,0x962541,0x7000f8a6,0x7c00100,0x230400,0x7000f8a6,0xc000010,0x448000,0x7000f921,0x4000000,0x200000,0x7000fa00,0x4000000, -0x200000,0x7000fb9e,0x2802100,0x962460,0x7000fb9e,0x2802400,0x962460,0x7000fb9e,0x2806400,0x962460,0x7000fb9e,0x4000000,0x200000,0x7000fb9e,0x6800000,0x1329800, -0x7000fb9e,0x6800100,0x962540,0x7000fb9e,0x6800100,0x962541,0x7000fb9e,0x7c00100,0x230400,0x7000fc92,0x4000000,0x200000,0x7000fc92,0x6800000,0x1329800,0x7000fc92, -0x7c00100,0x220400,0x7000fc92,0x7c00100,0x230400,0x7000fc92,0x7c00100,0x250400,0x700acd00,0x4000000,0x30e00000,0x700acd00,0x4000000,0xb28045a0,0x700ace00,0x4000000, -0x30e00000,0x700acf00,0x4000000,0x30e00000,0x700acf00,0x4000000,0xb0e00000,0x7040dfbd,0x4000000,0x200000,0x7040f7c1,0x80000,0x918820,0x7080af79,0x2802400,0x962460, -0x7080dfbd,0x2802400,0x962460,0x70c0e4bf,0x2802400,0x962460,0x70c0e4bf,0x6800100,0x962540,0x8000120f,0x7c00100,0x230400,0x80001524,0x7c00100,0x230400,0x8000171a, -0x7c00100,0x230400,0x80002006,0x7c00100,0x220400,0x80002006,0x7c00100,0x250400,0x80002a00,0x4000000,0x1500000,0x80002d00,0x4000000,0x200000,0x80005208,0x2802400, -0x962460,0x80005c00,0x4000000,0x200000,0x80007300,0x24000000,0x200000,0x80009519,0x7c00100,0x220400,0x80009519,0x7c00100,0x230400,0x80009519,0x7c00100,0x250400, -0x80009865,0x7c00100,0x230400,0x8000a008,0x2802100,0x962460,0x8000b30a,0x4000000,0x500000,0x8000b30a,0x7c00100,0x230400,0x8000cd00,0x4000000,0xe00000,0x8000d202, -0x2802500,0x962460,0x8000d202,0x7c00100,0x230400,0x8000d68d,0x4000000,0x200000,0x8000d997,0x2802400,0x962460,0x8000d997,0x4000000,0x200000,0x8000d997,0x4000000, -0x400000,0x8000d997,0x4000000,0x500000,0x8000d997,0x7c00100,0x230400,0x8000d997,0xc000010,0x448000,0x8000e489,0x2802100,0x962460,0x8000e489,0x7c00100,0x230400, -0x8000e719,0x7c00100,0x220400,0x8000f8a6,0x2802100,0x962460,0x8000f8a6,0x7c00100,0x230400,0x8000f8a6,0xc000010,0x448000,0x8000fda1,0x2802100,0x1862460,0x8000fda1, -0x2806400,0x1862460,0x8000fda1,0x4000000,0x1800000,0x8000fda1,0x6800000,0x1329800,0x8000fda1,0x6800100,0x1862540,0x8000fda1,0x7c00100,0x1830000,0x8000fda1,0xc000010, -0x448000,0x8000fe9c,0x7c00100,0x230400,0x8000fe9c,0x7c00100,0x830400,0x8000fe9c,0x7c00100,0x1430400,0x8000ff06,0x7c00100,0x220400,0x80010165,0x7c00100,0x230400, -0x800102a2,0x4000000,0x200000,0x800102a2,0x7c00100,0x230400,0x800103a4,0x7c00100,0x230400,0x800103a4,0xc000010,0x448000,0x8001044c,0x4000000,0x200000,0x8001044c, -0x7c00100,0x220400,0x8001044c,0x7c00100,0x250400,0x80010670,0x2802000,0x962460,0x80010670,0x4000000,0x200000,0x80010670,0x4000010,0x400000,0x80010670,0xc000010, -0x448000,0x800a4711,0x7c40300,0xe30000,0x800acd00,0x4000000,0x30e00000,0x800acd00,0x4000000,0x72904de0,0x800ace00,0x4000000,0x30e00000,0x800acf00,0x4000000,0x30e00000, -0x800b0011,0x7c40300,0xe30000,0x800b0500,0x4000000,0x30e00000,0x800b0500,0x4000000,0xb28045a0,0x90001615,0x7c00100,0x230400,0x9000171a,0x4000000,0x200000,0x9000171a, -0x7c00100,0x230400,0x90003000,0x24000000,0x200000,0x90007f0e,0x4000000,0x200000,0x90008301,0x2802000,0x962460,0x90008e00,0x24000000,0x400000,0x90009519,0x7c00100, -0x250400,0x9000a16f,0x2802100,0x962460,0x9000d200,0,0x218960,0x9000d202,0x2802000,0x962460,0x9000d202,0x2802100,0x962460,0x9000d202,0x7c00100,0x230400, -0x9000e59d,0x2802100,0x962460,0x900107a7,0x2802100,0x962460,0x900107a7,0x2802400,0x962460,0x900107a7,0x2802c00,0x962460,0x900107a7,0x4000000,0x1400000,0x900107a7, -0x6800000,0x1329800,0x900107a7,0x7c00100,0x220400,0x900107a7,0x7c00100,0x250400,0x900108a8,0x2802100,0x962460,0x900108a8,0x2806400,0x962460,0x900108a8,0x4000000, -0x200000,0x900108a8,0x4000000,0x400000,0x900108a8,0x4000010,0x400000,0x900108a8,0x6800000,0x1329800,0x900108a8,0x6800100,0x962540,0x900108a8,0x7c00100,0x230400, -0x900108a8,0xc000010,0x448000,0x90010908,0x7c00100,0x220400,0x90010a38,0x2802100,0x962460,0x90010ca9,0x2802100,0x962460,0x90010ca9,0x4000000,0x500000,0x90010ca9, -0x4000010,0xb00000,0x90010ca9,0x6800100,0x962540,0x90010ca9,0x7c00100,0x230400,0x90010d1b,0x4000000,0x500000,0x90010eaa,0x2802100,0x962460,0x90010eaa,0x2802400, -0x962460,0x90010eaa,0x2806400,0x962460,0x90010eaa,0x4000000,0x200000,0x90010eaa,0x4000000,0x400000,0x90010eaa,0x4000010,0x400000,0x90010eaa,0x6800000,0x1329800, -0x90010eaa,0x6800100,0x962540,0x90010eaa,0x7c00100,0x230400,0x90010eaa,0xc000010,0x448000,0x90010fab,0x7c00100,0x220400,0x90010fab,0x7c00100,0x250400,0x9002c300, -0x4000000,0x100000,0x900ac400,0x4000000,0xe0000d,0x900acd00,0x4000000,0x30e00000,0x900acd00,0x4000000,0xb28045a0,0x900acf00,0x4000000,0x30e00000,0x900b0500,0x4000000, -0xe00000,0x900b0500,0x4000000,0x30e00000,0x900b0500,0x4000000,0xb28045a0,0x900b0b9a,0x7c00900,0x1230400,0x900b109a,0x7c00300,0xe30000,0x900b119a,0x7c00300,0xe30000, -0x90408e06,0x24000000,0x400000}; +0x2b67,0,0,0x2d67,0,0,0x3167,0x20000000,0,0x3267,0x20000000,0,0x3a67,0,0,0x3b67, +0,0,0x3c67,0,0,0x3e67,0,0,0x4067,0,0,0x4167,0,0,0x4367,0, +0,0x4467,0,0,0x4867,0,0,0x4967,0,0,0x4a67,0,0,0x5067,0,0, +0x5167,0,0,0x5467,0,0,0x5567,0,0,0x5667,0x80000,0x20,0x5767,0,0,0x5867, +0,0,0x5967,0,0,0x5b67,0,0,0x5c67,0,0,0x5d67,0,0,0x6067,0x80000, +0x20,0x6267,0,0,0x6367,0,0,0x6467,0,0,0x6567,0,0,0x6f67,0,0, +0x7067,0,0,0x7367,0x20000000,0,0x7567,0,0,0x7667,0,0,0x7767,0,0,0x7867, +0,0,0x7a67,0,0,0x7b67,0,0,0x7c67,0,0,0x7e67,0,0,0x7f67,0, +0,0x8167,0,0,0x8267,0,0,0x8367,0,0,0x8467,0,0,0x8567,0,0, +0x8667,0,0,0x8767,0,0,0x8867,0,0,0x8967,0,0,0x8b67,0,0,0x8c67, +0,0,0x8e67,0x20000000,0,0x8f67,0,0,0x9067,0,0,0x9167,0,0,0x9267,0, +0,0x9367,0,0,0x9567,0,0,0x9667,0,0,0x9767,0,0,0x9867,0,0, +0x9967,0,0,0x9a67,0,0,0x9c67,0,0,0x9f67,0,0,0xa167,0,0,0xa367, +0,0,0xa467,0,0,0xa567,0,0,0xa667,0,0,0xa767,0,0,0xa867,0, +0,0xa967,0,0,0xaa67,0,0xe00000,0xab67,0,0xe00000,0xac67,0,0,0xad67,0,0, +0xae67,0,0,0xaf67,0,0,0xb167,0,0,0xb267,0,0,0xb367,0,0,0xb467, +0,0,0xb567,0,0,0xb767,0,0,0xb867,0,0,0xb967,0,0,0xba67,0, +0,0xbc67,0,0,0xbd67,0,0,0xbe67,0,0,0xbf67,0,0,0xc067,0,0, +0xc167,0,0,0xc267,0,0,0xc367,0,0xe00000,0xc467,0,0xe00000,0xc667,0,0,0xc767, +0,0,0xc867,0,0,0xc967,0,0,0xca67,0,0,0xcc67,0,0xe00000,0xcf67,0, +0xe00000,0xd067,0,0xe00000,0xd267,0,0,0xd367,0,0,0xd467,0,0,0xd567,0,0, +0xd667,0,0,0xd867,0,0,0xd967,0,0,0xda67,0,0,0xdb67,0,0,0xdc67, +0,0,0xdd67,0,0,0xde67,0,0,0xdf67,0,0,0xe067,0,0,0xe167,0, +0,0xe267,0,0,0xe367,0,0xe00000,0xe467,0,0,0xe567,0,0,0xe667,0,0, +0xe767,0,0,0xe867,0,0,0xe967,0,0,0xea67,0,0,0xeb67,0,0,0xec67, +0,0,0xed67,0,0,0xee67,0,0,0xef67,0,0,0xf167,0,0,0xf367,0, +0,0xf567,0,0,0xf667,0,0,0xf767,0,0,0xf867,0,0,0xf967,0,0, +0xfa67,0,0xe00000,0xfb67,0,0,0xfc67,0,0,0xfd67,0,0,0xfe67,0,0,0x10167, +0,0,0x10267,0,0,0x10367,0,0,0x10467,0,0,0x10567,0,0xe00000,0x10667,0, +0,0x10767,0,0,0x10867,0,0,0x10967,0,0,0x10a67,0,0,0x10b67,0,0, +0x10c67,0,0,0x10d67,0,0,0x10e67,0,0,0x10f67,0,0,0x11067,0,0,0x11167, +0,0,0x11367,0,0,0x11467,0,0,0x11567,0,0,0x11667,0,0,0x11767,0, +0,0x11867,0,0,0xa0067,0,0xe00000,0xa4667,0,0xe00000,0xa4767,0,0xe00000,0xa4f67,0,0xe00000, +0xa5e67,0,0xe00000,0xa5f67,0,0xe00000,0xac567,0,0xe00000,0xad167,0,0xe00000,0xb0067,0,0xe00000,0xb1267, +0,0xe00000,0x11000100,0,0x900020,0x11000100,0x40000001,0x440020,0x11000100,0x40000001,0x643020,0x11000100,0x40000001,0xa5a040,0x11000100,0x40000001, +0x116a8a0,0x11000200,0,0x900020,0x11000200,0x4000001,0xc4000b,0x11000200,0x7c00100,0x220402,0x11000200,0x24000000,0x10200000,0x11000200,0x24000008,0x1710000, +0x11000200,0x40000001,0x1d3b020,0x11000219,0x7c00100,0x220401,0x11000219,0x7c00100,0x250401,0x11000319,0x7c00100,0x220401,0x11000319,0x7c00100,0x220402,0x11000319, +0x7c00100,0x250400,0x11000319,0x7c00100,0x250401,0x11000419,0x7c00100,0x220400,0x11000419,0x7c00100,0x220401,0x11000419,0x7c00100,0x220402,0x11000419,0x7c00100, +0x230400,0x11000419,0x7c00100,0x250400,0x11000419,0x7c00100,0x250401,0x11000419,0x7c00100,0x250402,0x11000519,0x7c00100,0x220400,0x11000519,0x7c00100,0x230400, +0x11000600,0x4000400,0x200000,0x11000600,0x4000400,0x200002,0x11000600,0x4000400,0x200400,0x11000600,0x7c00500,0x220400,0x11000600,0x7c00500,0x230400,0x11000600, +0x7c00500,0x530400,0x11000600,0x7c00d00,0x230400,0x11000619,0x7c00500,0x22040f,0x11000800,0x4000010,0x1001401,0x11000800,0x4000400,0x200001,0x11000800,0x6800010, +0x201001,0x11000800,0x7c00500,0x230401,0x11000807,0x7c00100,0x220400,0x11000807,0x7c00100,0x250400,0x1100080e,0x4000400,0x200000,0x1100080e,0x4000400,0x200002, +0x1100080e,0x7000500,0x220402,0x1100080e,0x7c00100,0x220400,0x1100080e,0x7c00100,0x220401,0x1100080e,0x7c00100,0x220402,0x1100080e,0x7c00100,0x250400,0x1100080e, +0x7c00100,0x250401,0x1100080e,0x7c00120,0x220402,0x1100080e,0x7c00120,0x250402,0x11000908,0x4000000,0x200000,0x11000908,0x7c00100,0x220400,0x11000908,0x7c00100, +0x220401,0x11000908,0x7c00100,0x250400,0x11000908,0x7c00100,0x250401,0x11000a03,0x4000000,0x200000,0x11000a03,0x4000000,0x270000,0x11000a03,0x7c00100,0x220400, +0x11000a03,0x7c00100,0x220402,0x11000a03,0x7c00100,0x250400,0x11000a03,0x7c00500,0x230400,0x11000b13,0x2802500,0x962460,0x11000b13,0x4000000,0x200000,0x11000b13, +0x4000000,0x201000,0x11000b13,0x4000000,0x230400,0x11000b13,0x4000002,0x400000,0x11000b13,0x4000010,0x200000,0x11000b13,0x7c00100,0x2633800,0x11000c00,0x80000000, +0x218960,0x11000c02,0x2802100,0x962460,0x11000c02,0x2802400,0x962460,0x11000c02,0x4000000,0x200000,0x11000c02,0x4000000,0x1329400,0x11000c02,0x4000000,0x1329800, +0x11000c02,0x4000000,0x1500000,0x11000c02,0x6800000,0x1329800,0x11000c02,0x7c00100,0x230400,0x11000c02,0x7c00100,0x230401,0x11000c02,0x7c00100,0x230402,0x11000c02, +0x7c00500,0x230400,0x11000c02,0x7d00100,0x230400,0x11000c02,0xc000010,0xb48000,0x11000f0a,0x2802100,0x962460,0x11000f0a,0x2802400,0x962460,0x11000f0a,0x2806400, +0x962460,0x11000f0a,0x4000000,0x200000,0x11000f0a,0x6800100,0x962540,0x11000f0a,0x7c00100,0x230400,0x11000f0a,0x7c00100,0x230401,0x11001004,0x2802100,0x962460, +0x11001004,0x2802400,0x962460,0x11001004,0x2806400,0x962460,0x11001004,0x4000000,0x200000,0x11001004,0x4000000,0x1500000,0x11001004,0x6800100,0x962540,0x11001004, +0x6800100,0x962541,0x11001004,0x7c00100,0x230400,0x11001004,0x7c00100,0x230401,0x11001110,0x2802100,0x962460,0x11001110,0x2802400,0x962460,0x11001110,0x2806400, +0x962460,0x11001110,0x6800100,0x962540,0x11001110,0x7c00100,0x230400,0x11001110,0x7c00100,0x230401,0x1100120f,0x2802100,0x962460,0x1100120f,0x2802400,0x962460, +0x1100120f,0x2806400,0x962460,0x1100120f,0x6800100,0x962540,0x1100120f,0x7c00100,0x230400,0x1100131f,0x2802100,0x962460,0x1100131f,0x2802400,0x962460,0x1100131f, +0x2806400,0x962460,0x1100131f,0x4000000,0x200000,0x1100131f,0x6800000,0x1329800,0x1100131f,0x6800100,0x962540,0x1100131f,0x6800100,0x962541,0x1100131f,0x7c00100, +0x230400,0x1100131f,0x7c00100,0x230401,0x11001423,0x2802100,0x962460,0x11001423,0x2806400,0x962460,0x11001423,0x6800100,0x962540,0x11001423,0x6800100,0x962541, +0x11001423,0x7c00100,0x230400,0x11001423,0x7c00100,0x230401,0x11001524,0x2802100,0x962460,0x11001524,0x2802100,0x962461,0x11001524,0x2806400,0x962460,0x11001524, +0x6800000,0x1329800,0x11001524,0x6800100,0x962540,0x11001524,0x7c00100,0x230400,0x11001615,0x2802100,0x962460,0x11001615,0x2806400,0x962460,0x11001615,0x6800000, +0x1329800,0x11001615,0x6800100,0x962540,0x11001615,0x6800100,0x962541,0x11001615,0x7c00100,0x230400,0x1100171a,0x2802100,0x962460,0x1100171a,0x2806400,0x962460, +0x1100171a,0x6800000,0x1329800,0x1100171a,0x6800100,0x962540,0x1100171a,0x6800100,0x962541,0x1100171a,0x7c00100,0x230400,0x11001900,0x4000000,0x1600000,0x11001926, +0x2802100,0x1862460,0x11001926,0x2802400,0x1862460,0x11001926,0x2806100,0x1862460,0x11001926,0x4000000,0x200000,0x11001926,0x4000010,0x400000,0x11001926,0x6800000, +0x1329800,0x11001926,0x7800100,0x1830142,0x11001926,0x7c00100,0x1830000,0x11001926,0x7c00900,0x1830000,0x11001926,0x7e00100,0x1830000,0x11001a18,0x2802100,0x1862460, +0x11001a18,0x2802400,0x1862460,0x11001a18,0x6800000,0x1329800,0x11001a18,0x7800100,0x1830142,0x11001a18,0x7c00100,0x1830000,0x11001a18,0x7c00100,0x1830002,0x11001a18, +0x7c00900,0x1830000,0x11001a18,0x7e00100,0x1830000,0x11001d0c,0x7c00100,0x230400,0x11001d0c,0x7c00100,0x250400,0x11001e12,0x7c00100,0x2230500,0x11001e12,0x7c00100, +0x2330520,0x11001e12,0x7c80100,0x2330520,0x11002619,0x7c00100,0x220401,0x11002619,0x7c00100,0x220402,0x11002619,0x7c00100,0x250401,0x1100270e,0x4000400,0x200001, +0x1100270e,0x4000400,0x200002,0x1100270e,0x4000400,0x500001,0x1100270e,0x7c00100,0x220401,0x1100270e,0x7c00100,0x250401,0x11002800,0x80000,0x918820,0x11002800, +0x80000,0x1c18020,0x11002800,0x180000,0x918820,0x11002800,0x4000001,0x440001,0x11002800,0x4000001,0x440002,0x11002800,0x4000001,0xc4000b,0x11002800,0x6800000, +0x201c00,0x11002800,0x6800020,0x201c00,0x11002800,0x24000000,0x200000,0x11002800,0x24000000,0x200002,0x11002800,0x24000000,0x810000,0x11002800,0x24000000,0x1410000, +0x11002800,0x24000000,0x1500000,0x11002800,0x24000000,0x1500002,0x11002800,0x24000002,0x400000,0x11002800,0x24000006,0xc0000b,0x11002800,0x24000008,0x1410000,0x11002800, +0x24000008,0x1710000,0x11002800,0x24000020,0x1001400,0x11002800,0x24000020,0x1500002,0x11002800,0x2c000010,0x1248000,0x11002800,0x2c000010,0x11248002,0x11002800,0x40000001, +0x63b020,0x11002800,0x40080000,0x918820,0x11002801,0x80000,0x2a65620,0x11002801,0x82000,0x962460,0x11002900,0x4000000,0x20000e,0x11002900,0x4000000,0x20000f, +0x11002900,0x4000020,0x20000e,0x11002900,0x4000020,0x20000f,0x11002900,0x4000020,0x81000e,0x11002900,0x4000020,0x81000f,0x11002900,0x4000020,0x141000e,0x11002900, +0x4000020,0x141000f,0x11002900,0x4000022,0x20000e,0x11002900,0x4000022,0x20000f,0x11002a00,0x4000000,0x1500000,0x11002a00,0x4000000,0x1600000,0x11002a00,0x4000000, +0x1600002,0x11002b01,0x2000,0x962460,0x11002b01,0x2802020,0x962460,0x11002c00,0x4000000,0x200000,0x11002c00,0x4000000,0x200002,0x11002c00,0x4000000,0x20000f, +0x11002c00,0x4000020,0x200000,0x11002c00,0x7c00000,0x200000,0x11002c00,0x7c00020,0x200000,0x11002c00,0x7c00120,0x220405,0x11002c00,0x7c00120,0x230402,0x11002c00, +0x7c00120,0x250402,0x11002c00,0x7c00120,0x250405,0x11002c19,0x7c00100,0x250400,0x11002c19,0x7c00100,0x250401,0x11002d00,0x4000000,0x100006,0x11002d00,0x4000000, +0x200006,0x11002d19,0x7c00100,0x220402,0x11002d19,0x7c00100,0x230400,0x11002d19,0x7c00100,0x250402,0x11002e00,0x24000000,0x200000,0x11002e00,0x24000020,0x200000, +0x11002e00,0x24000020,0x200001,0x11002e00,0x24000020,0x10200000,0x11002f00,0x24000020,0x200000,0x11002f00,0x24000020,0x200001,0x11002f00,0x24000020,0x200002,0x11002f00, +0x24000020,0xf00000,0x11002f00,0x24000020,0x1600000,0x11002f00,0x24000022,0x1600000,0x11003000,0x24000000,0x200000,0x11003000,0x24000000,0x10200000,0x11003000,0x24000020, +0x200000,0x11003000,0x24000020,0x810000,0x11003000,0x24000020,0x1410000,0x11003100,0x24000000,0x200000,0x11003200,0x24000000,0x200000,0x11003300,0x4000000,0x100003, +0x11003400,0x24000000,0x100000,0x11003400,0x24000000,0x200000,0x11003500,0x24000000,0x200000,0x11003600,0x24000000,0x200000,0x11003600,0x24000000,0x10200000,0x11003600, +0x24000020,0x200000,0x11003700,0x24000000,0x200000,0x11003700,0x24000000,0xe00000,0x11003700,0x24000000,0x10200000,0x11003700,0x24000000,0x10e00000,0x11003700,0x24000000, +0x928045a0,0x11003700,0x24000020,0x200000,0x11003800,0x4000000,0x100000,0x11003800,0x24000000,0x200000,0x11003800,0x24000000,0xb00000,0x11003800,0x24000000,0xe00000, +0x11003800,0x24000000,0x1710000,0x11003800,0x24000000,0x10200000,0x11003800,0x24000000,0x10b00000,0x11003800,0x24000000,0x10e00000,0x11003800,0x24000000,0x10e05200,0x11003800, +0x24000000,0x928045a0,0x11005003,0x7c00100,0x220402,0x11005013,0x2802500,0x962460,0x11005013,0x4000020,0x200005,0x11005013,0x7c00100,0x2633801,0x11005013,0x7c00100, +0x2633802,0x11005013,0x7c00100,0x2633805,0x11005019,0x7c00100,0x220402,0x11005100,0x24000000,0x810000,0x11005100,0x24000000,0x1410000,0x11005102,0x7000100,0x230408, +0x11005102,0x7c00100,0x230404,0x11005102,0x7c00100,0x230407,0x11005102,0x7c00100,0x230408,0x11005102,0x7c00100,0x230409,0x11005201,0x2802400,0x962460,0x11005500, +0x80000,0x1e18820,0x11005502,0x7000100,0x230408,0x11005502,0x7c00100,0x230404,0x11005502,0x7c00100,0x230407,0x11005502,0x7c00100,0x230408,0x11005502,0x7c00100, +0x230409,0x11005667,0x1000,0,0x11020200,0x80004,0x418820,0x11020200,0x4000000,0x100006,0x11020200,0x4000000,0x10000f,0x11020200,0x4000400,0x100002, +0x11020200,0x4000400,0x500002,0x11020200,0x6800c00,0x101000,0x11020200,0x24000000,0x100000,0x11020200,0x24000000,0x1400000,0x11020200,0x24000000,0x1500000,0x11020200, +0x24000000,0x1600000,0x11020200,0x24000000,0x10200000,0x11020200,0x24000020,0x100000,0x11020200,0x24000020,0x1600000,0x11020219,0x7c00100,0x12040f,0x11020219,0x7c00100, +0x220400,0x11020219,0x7c00100,0x220401,0x11020219,0x7c00100,0x250400,0x11020319,0x7c00100,0x220400,0x11020319,0x7c00100,0x220401,0x11020319,0x7c00100,0x220402, +0x11020319,0x7c00100,0x250400,0x11020319,0x7c00100,0x250402,0x11020319,0x7d00100,0x220402,0x11020419,0x7c00100,0x220401,0x11020519,0x7c00100,0x220400,0x11020600, +0x4000400,0x100002,0x11020600,0x4000400,0x200400,0x11020600,0x7c00500,0x130400,0x11020600,0x7c00d00,0x130400,0x11020701,0x2802400,0x962460,0x11020701,0x2802400, +0x962461,0x11020701,0x2802400,0xc62460,0x1102080e,0x7c00100,0x220400,0x1102080e,0x7c00100,0x250400,0x11020908,0x7c00100,0x220400,0x11020908,0x7c00100,0x220401, +0x11020908,0x7c00100,0x250400,0x11020908,0x7c00100,0x250401,0x11022800,0x24000000,0x100000,0x11022800,0x24000000,0x200000,0x11022800,0x24000000,0x200002,0x11022800, +0x24000000,0x401000,0x11022800,0x24000000,0xf00002,0x11022800,0x24000000,0xf0ac02,0x11022800,0x24000000,0x1500000,0x11022800,0x24000002,0x100000,0x11022800,0x24000002, +0x370000,0x11022800,0x24000002,0x470000,0x11022800,0x24000006,0x400000,0x11022800,0x24000008,0x1710000,0x11022800,0x24000008,0x1712c00,0x11022800,0x24000020,0x100000, +0x11022800,0x24000020,0x1500000,0x11022800,0x24000020,0x1500002,0x11022900,0x4000000,0x10000e,0x11022900,0x4000000,0x10000f,0x11022919,0x7c00100,0x12040f,0x11022c00, +0x4000000,0x100002,0x11022c00,0x4000000,0x1500002,0x11022c00,0x4000000,0x1600002,0x11022c00,0x4000000,0x1010000f,0x11022c00,0x7c00120,0x120405,0x11022c0e,0x7c00100, +0x250401,0x11022c19,0x7c00100,0x150401,0x11022d00,0x4000000,0x100006,0x11022d00,0x4000000,0x200006,0x11022d19,0x7c00100,0x120402,0x11022d19,0x7c00100,0x150402, +0x11022e00,0x24000000,0x200000,0x11022e00,0x24000020,0x100000,0x11022e00,0x24000020,0x10100000,0x11022f00,0x24000020,0x100000,0x11022f00,0x24000020,0x100001,0x11022f00, +0x24000020,0x100002,0x11023000,0x24000000,0x100000,0x11023300,0x4000000,0x100002,0x11023300,0x4000000,0x100003,0x11023300,0x4000100,0x120403,0x11023300,0x4000100, +0x150403,0x11023300,0x4000100,0x10150403,0x11023400,0x24000000,0x100000,0x11023500,0x24000000,0x100000,0x11023600,0x24000000,0x100000,0x11023600,0x24000020,0x100000, +0x11023600,0x24000020,0x10100000,0x11023700,0x24000000,0x100000,0x11023700,0x24000000,0xe00000,0x11023700,0x24000000,0x10100000,0x11023700,0x24000000,0x10e00000,0x11023700, +0x24000020,0x100000,0x11023700,0x24000020,0x10100000,0x11023700,0x24000020,0x10105200,0x11023800,0x4000000,0x100000,0x11023800,0x24000000,0x200000,0x11024e67,0, +0,0x11025600,0x4000000,0x100000,0x11042a00,0x4000000,0x1600000,0x11045700,0x4000000,0x20000a,0x11045700,0x4000020,0x20000a,0x11045712,0x7c00100,0xe3040a, +0x11045712,0x7c80100,0xe3040a,0x11045716,0x7c00100,0xe30c0a,0x11045716,0x7c00100,0x2530c0a,0x11065700,0x4000000,0x810011,0x11065700,0x4000000,0xe00011,0x11065700, +0x4000000,0x1410011,0x11065700,0x4000000,0x1500011,0x11065700,0x4000000,0x1600011,0x11065700,0x4000006,0xe70011,0x11065700,0x4000008,0xe00011,0x11065700,0x4000008, +0xe02c11,0x11065700,0x4000010,0x871411,0x11065700,0x4000010,0x1201411,0x11065700,0x4000010,0x1271011,0x11065700,0x4000020,0xe00011,0x11065700,0x4000400,0xe00011, +0x11065700,0x4000420,0xe00011,0x11065700,0x6800000,0xe01c11,0x11065700,0x6800040,0xe00011,0x11065700,0xc000010,0x80ac11,0x11065700,0xc000010,0xb48011,0x11065719, +0x7c00100,0xe20411,0x11065719,0x7c00100,0xe50411,0x11065719,0x7c00140,0xe20411,0x11065719,0x7c00140,0xe50411,0x11080100,0x6800000,0x201c00,0x11080100,0x68000c0, +0x19329800,0x11080100,0x24000000,0x200000,0x11080100,0x24000000,0x810000,0x11080100,0x24000000,0x1410000,0x11080100,0x24000000,0x1500000,0x11080100,0x24000000,0x1600000, +0x11080100,0x24000000,0x1b00000,0x11080100,0x24000000,0x2410000,0x11080100,0x24000000,0x18200000,0x11080100,0x24000006,0xd70000,0x11080100,0x24000008,0x1713c00,0x11080100, +0x24000008,0x1714000,0x11080100,0x24000010,0x1001400,0x11080100,0x24000010,0x1071000,0x11080100,0x24000010,0x1071400,0x11080100,0x24000020,0x200000,0x11080100,0x24000020, +0x400000,0x11080100,0x24000020,0x1600000,0x11080100,0x24000400,0x200000,0x11080100,0x24000420,0x200000,0x11080100,0x2c000010,0xb48000,0x11080100,0x2c000010,0x100ac00, +0x11080100,0x44000001,0x1a40000,0x11080119,0x7c00100,0x220400,0x11080119,0x7c00100,0x250400,0x11080119,0x7c001c0,0x220400,0x11080119,0x7c001c0,0x250400,0x11080200, +0x4000400,0x200002,0x11080200,0x24000000,0x200000,0x11080200,0x24000000,0x1500000,0x11080200,0x24000000,0x1600000,0x11080200,0x24000020,0x200000,0x110a1e12,0x7c00100, +0x2130480,0x110a1e12,0x7c80100,0x2130480,0x110a3000,0x24000000,0x30e00000,0x110a3000,0x24100000,0x810001,0x110a3000,0x24100000,0x1410001,0x110a3700,0x24000000,0x30200000, +0x110a3d11,0x7c00300,0xe30000,0x110a3d11,0x7c00900,0x1230400,0x110a3d12,0x2802400,0x962460,0x110a3e14,0x7c00100,0xe30000,0x110a3e14,0x7c00100,0xe30001,0x110a3e14, +0x7c00100,0x2530000,0x110a3e14,0x7c00900,0x1230000,0x110a3e14,0x7c00900,0x1230001,0x110a3f16,0x7c00100,0xe30c00,0x110a3f16,0x7c00100,0xe30c01,0x110a3f16,0x7c00100, +0x2530c00,0x110a3f16,0x7c00900,0x1230c00,0x110a3f16,0x7c00900,0x1230c01,0x110a4005,0x7c00100,0xe30400,0x110a4112,0x7c00100,0xe30402,0x110a4112,0x7c80100,0xe30402, +0x110a4400,0x4000000,0xe00000,0x110a4412,0x4000000,0xe00002,0x110a4412,0x4000000,0xe00003,0x110a4416,0x4000000,0xe00c03,0x110a4500,0x4000000,0xe0000d,0x110a4516, +0x4000000,0xe00c0d,0x110a4711,0x7c40300,0xe30000,0x110a4f11,0x7c00300,0xe30001,0x110a4f11,0x7c40300,0xe30000,0x110a5300,0x4000000,0x810010,0x110a5300,0x4000000, +0xe00002,0x110a5300,0x4000000,0xe00010,0x110a5300,0x4000000,0x1410010,0x110a5300,0x4000002,0xe70010,0x110a5300,0x4000008,0x810010,0x110a5300,0x4000008,0x1410010, +0x110a5300,0x6800000,0xe01c02,0x110a5300,0x6800000,0xe01c10,0x110a5400,0x4000000,0x81000c,0x110a5400,0x4000000,0xe0000c,0x110a5400,0x4000000,0x141000c,0x110a5400, +0x4000000,0x150000c,0x110a5400,0x4000000,0x160000c,0x110a5400,0x4000002,0xe7000c,0x110a5400,0x4000010,0x87140c,0x110a5400,0x4000010,0xe7000c,0x110a5400,0x4000010, +0x120140c,0x110a5400,0x4000010,0x127100c,0x110a5400,0x4000020,0xe0000c,0x110a5400,0x4000026,0xe7000c,0x110a5400,0xc000010,0x80ac0c,0x110a5400,0xc000010,0xb4800c, +0x11400a0c,0xc000010,0x1049400,0x11400c0e,0x4000010,0xb00000,0x11400c0e,0x4000010,0x1071400,0x11400c0e,0xc000010,0xb48000,0x11400c13,0x7c00900,0x230400,0x11400f36, +0xc000010,0x448000,0x11400f46,0xc000010,0x448000,0x11401d72,0x4000000,0x200000,0x11403d95,0x4000000,0xe00000,0x1144578a,0x4000004,0x120000a,0x1144578a,0x4000008, +0x81000a,0x1144578a,0x4000008,0x141000a,0x1144578a,0x4000010,0x87000a,0x1144578a,0xc000010,0x84800a,0x11445793,0x3802500,0x126246a,0x11445793,0x7c00d00,0x2530c0a, +0x11463d8a,0x4000001,0x440011,0x114a3d8a,0x4000000,0xe00000,0x114a3d8a,0x4000000,0xe00002,0x114a3d8a,0x24000000,0x810000,0x114a3d8a,0x24000000,0xe00000,0x114a3d8a, +0x24000000,0x1410000,0x114a3d8a,0x24000008,0x810000,0x114a3d8a,0x24000008,0x1410000,0x114a3d8a,0x24000010,0x870000,0x114a3d8a,0x2c000010,0x848000,0x114a3d90,0x4000000, +0xe00000,0x114a3d90,0x24000000,0xe00000,0x114a3d90,0x24000002,0x1200000,0x114a3d90,0x24000002,0x10e00000,0x114a3d90,0x24000008,0x810000,0x114a3d90,0x24000008,0x1410000, +0x114a3d93,0x7c00900,0x930c00,0x114a3d93,0x7c00900,0xe30c00,0x114a3d95,0x7c00300,0xe30000,0x114a3e93,0x7000400,0x1200c02,0x114a3f8a,0x4000004,0x1200000,0x114a3f93, +0x7c00d00,0x2530c00,0x114a4295,0x4000000,0xe00000,0x114a4295,0x4000000,0xe0000f,0x114a4495,0x4000000,0xe00002,0x114a4495,0x4000000,0xe00003,0x114a4495,0x4000000, +0x10e00003,0x114a4595,0x4000000,0xe00002,0x114a4595,0x4000000,0xe0000d,0x1180090a,0x2802400,0x962460,0x11800c19,0x2802100,0x962460,0x11800c19,0x2802500,0x962460, +0x11800f1f,0x2802400,0x962460,0x11800f2b,0x2802400,0x962460,0x11820700,0x2802400,0x962460,0x11820700,0x2802500,0x962460,0x118a3d96,0x2802400,0x962460,0x118a3e93, +0x2802400,0x962460,0x11c00904,0x2802400,0x962460,0x11c00908,0x2802400,0x962460,0x11c00c1d,0x6800000,0x1329800,0x11c00f5a,0x6800000,0x1329800,0x11c0105f,0x6800000, +0x1329800,0x11c01163,0x6800000,0x1329800,0x11c01267,0x6800000,0x1329800,0x11c0146b,0x4000000,0x200000,0x11c0146b,0x6800000,0x1329800,0x11c0146b,0x7c00100,0x230400, +0x11c0511d,0x7c00100,0x230408,0x20000067,0x1000,0,0x20000b13,0x2802400,0x962460,0x20000b13,0x2802500,0x962460,0x20001b27,0x2802100,0x962460,0x20001b27, +0x2802100,0x962461,0x20001b27,0x2802400,0x962460,0x20001b27,0x2806400,0x962460,0x20001b27,0x2902100,0x962462,0x20001b27,0x4000000,0x200000,0x20001b27,0x4000000, +0x400000,0x20001b27,0x4000000,0x500000,0x20001b27,0x4000000,0x810000,0x20001b27,0x4000000,0xb00000,0x20001b27,0x4000000,0xc0000b,0x20001b27,0x4000000,0x1410000, +0x20001b27,0x4000010,0xb00000,0x20001b27,0x4000010,0xc00000,0x20001b27,0x6800000,0x1329800,0x20001b27,0x6800100,0x462540,0x20001b27,0x6800400,0x962540,0x20001b27, +0x7c00100,0x230400,0x20001b27,0x7c00100,0x230401,0x20002619,0x7c00100,0x220401,0x20002a00,0x4000000,0x1600000,0x20004b67,0,0x1900020,0x20004c67,0, +0x1900020,0x20004d67,0,0x1900020,0x20006d67,0x1000,0,0x20006e67,0x1000,0,0x20026d67,0,0,0x20026e67,0,0, +0x200a4a12,0x7c00100,0x1f304c1,0x200a4a12,0x7c00100,0x20304e1,0x21005600,0x4000000,0x700000,0x21022a00,0x4000000,0x1600000,0x30000419,0x7c00100,0x220400,0x30000419, +0x7c00100,0x220401,0x30000419,0x7c00100,0x250400,0x30000419,0x7c00100,0x250401,0x30000519,0x7c00100,0x220400,0x30000600,0x4000400,0x200400,0x30000600,0x7c00500, +0x230400,0x30000605,0x4000400,0x200000,0x3000080e,0x7c00100,0x220400,0x30000908,0x2000,0x962460,0x30000908,0x7c00100,0x220400,0x30000908,0x7c00100,0x220401, +0x30000908,0x7c00100,0x250400,0x30000908,0x7c00100,0x250401,0x30000a03,0x4000006,0x400000,0x30000c02,0x4000000,0x200000,0x30000c02,0x7c00100,0x230400,0x30000d22, +0x2802100,0x962460,0x30000d22,0x2802400,0x962460,0x30000d22,0x2802500,0x962460,0x30000d22,0x4000000,0x200000,0x30000d22,0x4000010,0x200000,0x30000d22,0x7c00100, +0x230400,0x30000d22,0xc000010,0x248000,0x30000d22,0x80000000,0x218960,0x30000e25,0x2802500,0x962460,0x30000e25,0x7c00100,0x230400,0x30001821,0x2802100,0x962460, +0x30001821,0x2806400,0x962460,0x30001821,0x4000000,0x200000,0x30001821,0x6800100,0x962540,0x30001821,0x6800100,0x962541,0x30001821,0x7c00100,0x230400,0x30001b27, +0x2802100,0x962460,0x30001b27,0x2802400,0x962460,0x30001b27,0x4000000,0x200000,0x30001b27,0x4000000,0x400000,0x30001b27,0x7c00100,0x230400,0x30001c1c,0x2802100, +0x1862460,0x30001c1c,0x2802400,0x1862460,0x30001c1c,0x2806400,0x1862460,0x30001c1c,0x4000000,0x200000,0x30001c1c,0x6800100,0x1862400,0x30001c1c,0x6800100,0x1862540, +0x30001c1c,0x7c00100,0x1830000,0x30001c1c,0x7c00100,0x1830001,0x30001c1c,0xc000010,0x448000,0x30001f0b,0x4000000,0x200000,0x30001f0b,0x4000010,0x200000,0x30001f0b, +0x4000010,0x400000,0x30001f0b,0x6800000,0x200000,0x30001f0b,0x7c00100,0x230400,0x30001f0b,0xc000010,0x248000,0x30002006,0x7c00100,0x250400,0x30002128,0x4000010, +0x200000,0x30002128,0x7c00100,0x230400,0x30002128,0xc000010,0x248000,0x3000221d,0x4000000,0x810000,0x3000221d,0x4000000,0x1410000,0x3000221d,0x4000001,0x440000, +0x3000221d,0x7c00100,0x230400,0x30002300,0x4000010,0x400000,0x30002320,0x7c00100,0x230400,0x30002417,0x2802100,0x1862460,0x30002417,0x2802400,0x1862460,0x30002417, +0x2806400,0x1862460,0x30002417,0x2882000,0x1862460,0x30002417,0x4000000,0x200000,0x30002417,0x4000000,0x400000,0x30002417,0x4000000,0x1600000,0x30002417,0x4000010, +0x400000,0x30002417,0x4000010,0x1200000,0x30002417,0x6800000,0x1329800,0x30002417,0x6800100,0x1862540,0x30002417,0x7c00100,0x1830000,0x30002417,0x7d00100,0x1830000, +0x3000251b,0x80000,0xc18820,0x3000251b,0x2802100,0x962460,0x3000251b,0x3c02100,0x962460,0x3000251b,0x4000000,0x200000,0x3000251b,0x4000006,0x500000,0x3000251b, +0x4000010,0x400000,0x3000251b,0x4000010,0xb70000,0x3000251b,0x4000800,0x200000,0x3000251b,0x6800000,0x1329800,0x3000251b,0x7c00100,0x230400,0x3000251b,0x7c00900, +0x230400,0x3000251b,0xc000010,0xb48000,0x3000251b,0x12882000,0x962460,0x30002800,0x4000001,0xc41c0b,0x30002800,0x24000000,0x200000,0x30002800,0x2c000010,0x1248002, +0x30002800,0x2c000010,0x11248002,0x30002a00,0x4000000,0x1600000,0x30002b01,0x2000,0x962460,0x30002c00,0x4000000,0x200000,0x30002c00,0x7c00100,0x10220405,0x30002d19, +0x7c00100,0x250400,0x30002e00,0x24000000,0x200000,0x30003000,0x24000000,0x200000,0x30003100,0x24000000,0x200000,0x30003600,0x24000000,0x200000,0x30003700,0x24000000, +0x200000,0x3000392e,0x24000000,0x200000,0x30005013,0x7c00100,0x2633801,0x30005600,0,0x918820,0x30020600,0x4000400,0x500400,0x30020701,0x2802400,0x962460, +0x30020701,0x2802400,0xc62460,0x300a3a11,0x4020000,0xe00000,0x300a3a11,0x4020000,0xe00002,0x300a3b11,0x4020000,0xe00002,0x300a3c00,0x4008000,0xe00000,0x300a3c00, +0x4010000,0xe00000,0x300a3d11,0x7c00300,0xe30002,0x300a4305,0x7c00100,0xe30400,0x300a4611,0x7c40300,0xe30000,0x300a4829,0x7c00100,0xe30400,0x300a4829,0x7c00900, +0x1230400,0x300a4929,0x4000000,0xe00000,0x30402578,0x4000010,0x400000,0x30402578,0x4000010,0xb70000,0x30402578,0xc000010,0xb48000,0x304a3d95,0x4000000,0xe00000, +0x30800c19,0x2802100,0x962460,0x30c01c70,0x6800000,0x1329800,0x3100080e,0x7c00120,0x220402,0x3100080e,0x7c00120,0x250402,0x31005167,0x1000,0,0x3100581e, +0x4000000,0x200000,0x3100581e,0x7c00100,0x230400,0x3100590d,0x7c00100,0x230400,0x31005a09,0x7c00100,0x220400,0x31005a09,0x7c00100,0x250400,0x31005b00,0x4000000, +0x200000,0x31005c00,0x80000,0x918820,0x31005c00,0x2802000,0x962460,0x31005c00,0x2802400,0x962460,0x31005c00,0x4000000,0x200000,0x31005c00,0x4000000,0x200001, +0x31005c00,0x6800000,0x962540,0x31005c00,0x6800400,0x962540,0x31005c01,0x2802400,0x962460,0x31005d00,0x4000020,0x200005,0x31005d00,0x6800020,0x1329805,0x31005d00, +0x7c00120,0x220405,0x31005d00,0x7c00120,0x250405,0x31006000,0x82000,0x962460,0x31006000,0x180000,0x918820,0x310a5e11,0x7c40300,0xe30000,0x310a5f11,0x7c00300, +0xe30001,0x32000419,0x7c00100,0x250400,0x3200080e,0x4000020,0x200000,0x3200080e,0x7c00100,0x220400,0x3200080e,0x7c00100,0x250400,0x32000908,0x7c00100,0x220400, +0x32000908,0x7c00100,0x250400,0x32000c02,0x7c00100,0x230400,0x32000e25,0x7c00100,0x230400,0x32001d0c,0x7c00100,0x230400,0x32002800,0x80000,0x1e18820,0x32002800, +0x80020,0x218820,0x32002800,0x4000001,0x440002,0x32002800,0x24000000,0x200000,0x32002800,0x24000000,0x200002,0x32002800,0x24000020,0x200000,0x32002800,0x2c000010, +0x1248002,0x32002919,0x7c00100,0x22040f,0x32002a00,0x4000000,0x1600000,0x32002b01,0x2000,0x962460,0x32002b01,0x2802000,0x962460,0x32002b01,0x2802020,0x962460, +0x32002c00,0x4000000,0x200000,0x32002c00,0x4000020,0x200000,0x32002c00,0x4000020,0x200005,0x32002c00,0x7c00120,0x220405,0x32002c00,0x7c00120,0x250405,0x32002e00, +0x24000020,0x200000,0x32002f00,0x24000020,0x200000,0x32003000,0x24000000,0x200000,0x32003000,0x24000020,0x200000,0x32003500,0x24000000,0x200000,0x32003600,0x24000020, +0x200000,0x32003600,0x24000020,0x10200000,0x32003700,0x24000000,0x100000,0x32003700,0x24000000,0x200000,0x32003700,0x24000000,0x10200000,0x32003800,0x24000000,0x810000, +0x32003800,0x24000000,0x1410000,0x32005102,0x4000000,0x1500008,0x32005502,0x7c00100,0x230400,0x32006108,0x7c00100,0x220400,0x32006108,0x7c00100,0x250400,0x3200622a, +0x2802100,0x962460,0x3200622a,0x2806000,0x962460,0x3200622a,0x7c00100,0x230400,0x3200632b,0x2802100,0x962460,0x3200632b,0x2806000,0x962460,0x3200632b,0x7c00100, +0x230400,0x3200642c,0x2802100,0x962460,0x3200642c,0x7c00100,0x230400,0x3200652d,0x2802100,0x962460,0x3200652d,0x7c00100,0x230400,0x32006600,0x24000020,0x200000, +0x32006700,0x24000020,0x200000,0x32006800,0x24000020,0x200000,0x32006800,0x24000020,0x10200000,0x32006900,0x24000020,0x200000,0x32006900,0x24000020,0x810000,0x32006900, +0x24000020,0x1410000,0x32006a00,0x24000020,0x200000,0x32006a00,0x24000020,0x200001,0x32006a00,0x24000020,0x200002,0x32020701,0x2882000,0xc62460,0x32023300,0x4000000, +0x100000,0x32026c01,0x12882000,0x962460,0x32065700,0x4000000,0x810011,0x32065700,0x4000000,0x1410011,0x32086600,0x24000020,0x810000,0x32086600,0x24000020,0x1410000, +0x32086900,0x24000020,0x810000,0x32086900,0x24000020,0x1410000,0x320a3600,0x24000020,0x30200000,0x320a3d11,0x7c00100,0x1230400,0x320a3e14,0x7c00100,0xe30010,0x320a3e14, +0x7c00100,0x2530000,0x320a3f16,0x7c00100,0xe30c10,0x320a4400,0x4000000,0xe00003,0x320a4929,0x4000000,0xe00000,0x320a4f11,0x7c00300,0xe30001,0x320a6b16,0x7c00100, +0x2530c00,0x32406374,0xc000010,0x448000,0x324a3d98,0x4000000,0x10e00000,0x324a3d98,0x7c00100,0x1230400,0x324a3f93,0x4000002,0x1200c00,0x324a5390,0x24000000,0xe00000, +0x32820701,0x2802000,0x962460,0x40000419,0x7c00100,0x220400,0x40000519,0x7c00100,0x220400,0x40000600,0x4000400,0x200400,0x4000080e,0x7c00100,0x220400,0x4000080e, +0x7c00100,0x250400,0x4000080e,0x7c00100,0x250402,0x40000c02,0x2802100,0x962460,0x40000c02,0x2802400,0x962460,0x40000c02,0x2802500,0x962460,0x40000c02,0x4000000, +0x200000,0x40000c02,0x4000000,0x1071400,0x40000c02,0x7c00100,0x230400,0x40000c02,0x80000000,0x218960,0x40000d22,0x7c00100,0x230400,0x40000f0a,0x7c00100,0x230400, +0x40001004,0x7c00100,0x230400,0x40001110,0x2802100,0x962460,0x40001110,0x6800100,0x962540,0x4000120f,0x2802100,0x962460,0x4000120f,0x4000000,0x1600000,0x4000120f, +0x7c00100,0x230400,0x4000131f,0x7c00100,0x230400,0x40001423,0x4000000,0x200000,0x40001423,0x4000000,0x1600000,0x40001615,0x2802400,0x962460,0x40001615,0x7c00100, +0x230400,0x40002417,0x2802400,0x1862460,0x40002417,0x4000000,0x200000,0x40002800,0x6800000,0x201c00,0x40002800,0x24000002,0x200000,0x40002c00,0x4000000,0x200002, +0x40003000,0x24000000,0x10200000,0x40003000,0x24000020,0x200000,0x40003700,0x24000000,0x200000,0x40003700,0x24000000,0x10200000,0x40005a09,0x7c00100,0x220400,0x40005a09, +0x7c00100,0x250400,0x40005d00,0x7c00120,0x220405,0x40006f30,0x2802100,0x962460,0x40006f30,0x2802400,0x962460,0x40006f30,0x4000000,0x200000,0x40006f30,0x6800000, +0x1329800,0x40006f30,0x6800100,0x962540,0x40006f30,0x7c00100,0x230400,0x40006f30,0xc000010,0xb48000,0x40007034,0x7c00100,0x1830000,0x40007117,0x4000000,0x200000, +0x40007208,0x7c00100,0x220400,0x4000720e,0x7c00100,0x220400,0x4000720e,0x7c00500,0x22040e,0x4000720e,0x7c00500,0x22040f,0x40007219,0x7c00100,0x220400,0x40007219, +0x7c00500,0x220400,0x40007219,0x7c00500,0x22040e,0x40007219,0x7c00500,0x22040f,0x40007300,0x24000000,0x200000,0x40007300,0x24000000,0x10200000,0x40007400,0x4000000, +0x200000,0x40007531,0x7c00100,0x230400,0x40007631,0x7c00100,0x230400,0x40007835,0x4000010,0x400000,0x40007835,0x7c00100,0x230400,0x40007933,0x7c00100,0x230400, +0x40007a32,0x6800000,0x1329800,0x40007a32,0x7c00100,0x230400,0x40007b2f,0x7c00100,0x230400,0x40007c00,0x4000000,0x200000,0x40020701,0x2802400,0x962460,0x40020701, +0x2802400,0xc62460,0x40023300,0x4000000,0x200000,0x40027d01,0x12882000,0x962460,0x400a3700,0x24000000,0x30200000,0x400a3700,0x24000000,0x30e00000,0x400a4400,0x4000000, +0xe0000d,0x400a4412,0x4000000,0xe00002,0x400a4412,0x4000000,0xe00003,0x400a4500,0x4000000,0xe0000d,0x400a5300,0x4000000,0x810010,0x400a5300,0x4000000,0x1410010, +0x404077bb,0x4000000,0x200000,0x404077be,0x4000000,0x200000,0x404077be,0x4000000,0x400000,0x40c0511d,0x4000000,0x200000,0x41000419,0x7c00100,0x220400,0x41000419, +0x7c00100,0x250400,0x4100080e,0x7c00100,0x220400,0x4100080e,0x7c00100,0x250400,0x41000908,0x7c00100,0x220400,0x41000908,0x7c00100,0x250400,0x41000b13,0x2802000, +0x962460,0x41000b13,0x2802100,0x962460,0x41000b13,0x4000000,0xb00000,0x41000c02,0x2802100,0x962460,0x41000c02,0x4000000,0xb00000,0x41000c02,0x4000000,0x1500000, +0x41000f0a,0x7c00100,0x230400,0x41001004,0x7c00100,0x230400,0x41001423,0x7c00100,0x230400,0x41001b27,0x4000000,0x500000,0x41001d0c,0x7c00100,0x230400,0x41001d0c, +0x7c00100,0x23040f,0x41001f0b,0x2802100,0x962460,0x41001f0b,0x4000000,0x200000,0x41001f0b,0x7c00100,0x230400,0x41002800,0x24000000,0x200000,0x41002800,0x24000000, +0x400000,0x41002919,0x7c00100,0x22040e,0x41002a00,0x4000000,0x1600000,0x41002b01,0x2802020,0x962460,0x41002c00,0x4000000,0x200000,0x41002c00,0x7c00120,0x220405, +0x41003000,0x24000000,0x200000,0x41003700,0x24000000,0x200000,0x41003700,0x24000000,0x10200000,0x41003700,0x24000000,0x10205200,0x41003700,0x24000000,0x10e00000,0x41005d00, +0x7c00120,0x220405,0x41006600,0x24000020,0x200000,0x41006600,0x24000020,0x810000,0x41006600,0x24000020,0x1410000,0x41007208,0x7c00100,0x22040f,0x41007219,0x7c00100, +0x220400,0x41007300,0x24000000,0x200000,0x41007e0e,0x2802000,0x962460,0x41007e0e,0x4000000,0x200000,0x41007f0e,0x4000000,0x200000,0x41007f0e,0x7c00100,0x230400, +0x41008002,0x7c00100,0x230400,0x41008137,0x2802100,0x962460,0x41008137,0x4000000,0x200000,0x41008137,0x6800100,0x962540,0x41008137,0x7c00100,0x230400,0x41008301, +0x2802000,0x962460,0x41008407,0x4000000,0x200000,0x41008407,0x4000000,0x400000,0x41008407,0x4000000,0xb00000,0x41008407,0x7c00100,0x220400,0x41008407,0x7c00100, +0x250400,0x4100850b,0x7c00100,0x230400,0x4100860b,0x4000000,0x200000,0x4100860b,0x7c00100,0x230400,0x4100870c,0x7c00100,0x220400,0x41008838,0x7c00100,0x220400, +0x41008838,0x7c00100,0x250400,0x41008939,0x2802000,0x962460,0x41008939,0x2802100,0x962460,0x41008939,0x2806000,0x962460,0x41008939,0x4000000,0x200000,0x41008939, +0x4000000,0x400000,0x41008939,0x7c00100,0x230400,0x41008939,0xc000010,0x448000,0x41008a00,0x4000000,0x200000,0x41008b3b,0x4000000,0x1800000,0x41008b3b,0x6800000, +0x1329800,0x41008b3b,0x7c00100,0x1830000,0x41008b3b,0x7e00100,0x1830000,0x41008c3d,0x4000010,0x400000,0x41008c3d,0x7c00100,0x230400,0x41008d0e,0x7c00100,0x22040f, +0x41008d19,0x7c00100,0x220400,0x41008d19,0x7c00100,0x22040f,0x41008e00,0x24000000,0x200000,0x41008e00,0x24000000,0x400000,0x41008e00,0x24000000,0x1710000,0x41008e00, +0x24000006,0x400000,0x41008f3a,0x2802000,0x962460,0x41008f3a,0x2802100,0x962460,0x41008f3a,0x2806000,0x962460,0x41008f3a,0x4000000,0x200000,0x41008f3a,0x6800100, +0x962540,0x41008f3a,0x7c00100,0x230400,0x4100903c,0x7c00100,0x230400,0x4100903c,0x7c00100,0x23040f,0x41020701,0x2802000,0x962460,0x41020701,0x2802000,0xc62460, +0x410a3700,0x24000000,0x30200000,0x410a3700,0x24000000,0x30e00000,0x410a4412,0x4000000,0xe00003,0x410a4711,0x7c40300,0xe30000,0x410a4f11,0x7c00300,0xe30001,0x410a9100, +0x4000000,0x800010,0x410a9100,0x4000000,0x810010,0x410a9100,0x4000000,0x870010,0x410a9100,0x4000000,0xb00010,0x410a9100,0x4000000,0xf00010,0x410a9100,0x4000000, +0x1001410,0x410a9100,0x4000000,0x1071010,0x410a9100,0x4000000,0x1071410,0x410a9100,0x4000000,0x1410010,0x414a8295,0x4000000,0xe00000,0x41808300,0x2802000,0x962460, +0x41c0146b,0x6800000,0x1329800,0x50000419,0x7c00100,0x220400,0x50000419,0x7c00100,0x250400,0x5000080e,0x7c00100,0x220400,0x50000908,0x7c00100,0x220400,0x50000908, +0x7c00100,0x250400,0x50000b13,0x2802500,0x962460,0x50000f0a,0x7c00100,0x230400,0x50001615,0x2802100,0x962460,0x50001615,0x7c00100,0x230400,0x50002b01,0x2802020, +0x962460,0x50002c00,0x4000000,0x200000,0x50002c19,0x7c00100,0x220400,0x50002d19,0x7c00100,0x220400,0x50003000,0x24000000,0x200000,0x50003000,0x24000020,0x200000, +0x50003700,0x24000000,0x200000,0x50005d00,0x7c00120,0x220405,0x50005d00,0x7c00120,0x250405,0x50006108,0x7c00100,0x220400,0x50006108,0x7c00100,0x250400,0x50006600, +0x24000020,0x200000,0x50007300,0x24000000,0x200000,0x50008301,0x2802400,0x962460,0x50008a00,0x7c00500,0x230400,0x50009257,0x2802400,0x962460,0x50009257,0x4000000, +0x200000,0x50009257,0x4000010,0x1071400,0x50009257,0x6800000,0x1329800,0x50009257,0x7c00100,0x230400,0x50009257,0x7c00500,0x230400,0x50009257,0x7c00900,0x230400, +0x50009257,0xc000010,0xb48000,0x5000933e,0x2802100,0x962460,0x5000933e,0x2802400,0x962460,0x5000933e,0x4000000,0x200000,0x5000933e,0x4000000,0x400000,0x5000933e, +0x4000010,0x400000,0x5000933e,0x6800000,0x1329800,0x5000933e,0x6800100,0x962540,0x5000933e,0x6800100,0x962541,0x5000933e,0x6804400,0x962540,0x5000933e,0x7c00100, +0x230400,0x5000933e,0x7c00100,0x230401,0x5000933e,0xc000010,0x448000,0x50009419,0x7c00100,0x220400,0x50009419,0x7c00100,0x250400,0x50009500,0x4000400,0x200400, +0x5000965a,0x4000000,0x500000,0x5000965a,0x7c00100,0x230400,0x5000965a,0xc000010,0xb48000,0x5000975b,0x4000000,0x200000,0x5000975b,0x4000010,0x400000,0x5000975b, +0x7c00100,0x230400,0x50009865,0x7c00100,0x230400,0x50009965,0x4000010,0x400000,0x50009965,0x7c00100,0x230400,0x50409a95,0x4000000,0x200000,0x5100080e,0x7c00100, +0x220400,0x5100080e,0x7c00100,0x250400,0x51000c02,0x2802100,0x962460,0x51000c02,0x4000000,0x1500000,0x51000c02,0x4000020,0x200000,0x51000c02,0x7c00100,0x230400, +0x51000f0a,0x7c00100,0x230400,0x51000f0a,0x7c00500,0x230400,0x51001110,0x2802100,0x962460,0x5100131f,0x2802100,0x962460,0x51001423,0x7c00100,0x230400,0x51001524, +0x2802100,0x962460,0x51001524,0x4000000,0x200000,0x51001524,0x7c00100,0x230400,0x5100171a,0x2802100,0x962460,0x5100171a,0x4000000,0x200000,0x5100171a,0x4000000, +0x1500000,0x5100171a,0x7c00100,0x230400,0x51001b27,0x4000000,0x200000,0x51001b27,0x4000000,0x400000,0x51001b27,0x4000000,0x500000,0x51001b27,0x7c00100,0x230400, +0x51001c1c,0x2802100,0x1862460,0x51001c1c,0x2802400,0x1862460,0x51001c1c,0x2806400,0x1862460,0x51001c1c,0x4000000,0x1800000,0x51001c1c,0x6800000,0x1329800,0x51001c1c, +0x6800000,0x1862400,0x51001c1c,0x6800100,0x1862400,0x51001c1c,0x6800100,0x1862540,0x51001c1c,0x6800400,0x1862400,0x51001c1c,0x7c00100,0x1830000,0x5100251b,0x7c00100, +0x230400,0x51002619,0x7c00100,0x220400,0x51002619,0x7c00100,0x250400,0x51002800,0x80020,0x218820,0x51002c00,0x4000000,0x200000,0x51002d19,0x7c00100,0x230400, +0x51003700,0x24000000,0x200000,0x51003700,0x24000000,0xe00000,0x51005201,0x2802400,0x962460,0x51005c00,0x4000000,0x200000,0x51006108,0x7c00100,0x220400,0x51006108, +0x7c00100,0x250400,0x51006600,0x24000020,0x200000,0x51006600,0x24000020,0x810000,0x51006600,0x24000020,0x1410000,0x51007300,0x24000000,0x200000,0x51007300,0x24000020, +0x200000,0x51008002,0x7c00100,0x230400,0x51008301,0x2802000,0x962460,0x51008301,0x2802400,0x962460,0x51008a00,0x7c00500,0x230400,0x51008e00,0x24000000,0x200000, +0x51008e00,0x24000000,0x400000,0x51008e00,0x24000000,0x810000,0x51008e00,0x24000000,0x1400000,0x51008e00,0x24000000,0x1410000,0x51008e00,0x24000000,0x1710000,0x51008e00, +0x24000002,0x200000,0x51008e00,0x24000500,0x230400,0x51008e00,0x2c000010,0xb48000,0x51009419,0x7c00100,0x220400,0x51009419,0x7c00100,0x22040e,0x51009419,0x7c00100, +0x22040f,0x51009419,0x7c00100,0x250400,0x51009500,0x4000000,0x200400,0x51009500,0x7c00500,0x230400,0x51009519,0x7c00100,0x220400,0x51009519,0x7c00100,0x22040f, +0x51009519,0x7c00100,0x230400,0x51009519,0x7c00100,0x250400,0x51009b71,0x2802100,0x962460,0x51009b71,0x6800000,0x1329800,0x51009b71,0x6800100,0x962540,0x51009b71, +0x6804400,0x962540,0x51009b71,0x7c00100,0x230400,0x51009c52,0x2802100,0x962460,0x51009c52,0x2802400,0x962460,0x51009c52,0x2802c00,0x962460,0x51009c52,0x4000010, +0x400000,0x51009c52,0x6800000,0x1329800,0x51009c52,0x6800100,0x962540,0x51009c52,0x7c00100,0x230400,0x51009c52,0xc000010,0x448000,0x51009d6d,0x6800000,0x1329800, +0x51009d6d,0x7c00100,0x230400,0x51009d6d,0x7c00500,0x230400,0x51009d6d,0x7c00d00,0x230400,0x51009d6d,0xc000010,0x448000,0x51009e08,0x2802100,0x962460,0x51009f63, +0x4000010,0x400000,0x51009f63,0x6800000,0x1329800,0x51009f63,0x7c00100,0x230400,0x51009f63,0x7c00900,0x230400,0x51009f63,0xc000010,0x448000,0x51009f63,0xc000010, +0xb48000,0x5100a008,0x2000,0x962460,0x5100a008,0x2802400,0x962460,0x5100a008,0x4000000,0x200000,0x5100a008,0x7c00100,0x220400,0x5100a008,0x7c00100,0x230400, +0x5100a008,0x7c00100,0x250400,0x5100a008,0x7c00500,0x230400,0x5100a16f,0x2806400,0x962460,0x5100a16f,0x6800000,0x1329800,0x5100a16f,0x6800100,0x962540,0x5100a16f, +0x7c00100,0x230400,0x5100a16f,0xc000010,0x448000,0x5100a24f,0x2802100,0x962460,0x5100a24f,0x2802400,0x962460,0x5100a24f,0x6800000,0x1329800,0x5100a24f,0x7c00100, +0x230400,0x5100a24f,0xc000010,0x448000,0x5100a36e,0x2802100,0x962460,0x5100a36e,0x4000000,0x200000,0x5100a36e,0x6800100,0x962540,0x5100a36e,0x6804400,0x962540, +0x5100a36e,0x7c00100,0x230400,0x5100a442,0x2802100,0x962460,0x5100a442,0x4000000,0x200000,0x5100a442,0x6800000,0x1329800,0x5100a442,0x6800100,0x962540,0x5100a442, +0x7c00100,0x230400,0x5100a442,0xc000010,0x448000,0x5100a500,0x4000000,0x200000,0x5100a600,0x4000000,0x200000,0x5100a601,0x2802000,0x962460,0x5100a76b,0x7c00100, +0x230400,0x5100a868,0x7c00100,0x230400,0x5100a96c,0x4000000,0x200000,0x5100a96c,0x7c00100,0x230400,0x5100aa00,0x4000000,0xe00000,0x5100ab00,0x4000000,0xe00000, +0x51086600,0x24000020,0x810000,0x51086600,0x24000020,0x1410000,0x510a4005,0x7c00100,0xe30400,0x510a4711,0x7c40300,0xe30000,0x510a7300,0x24000000,0x30200000,0x510aaa00, +0x4000000,0x30e00000,0x5140a2b6,0x4000400,0x400000,0x514a8295,0x4000000,0xe00000,0x51802b87,0x2802000,0x962460,0x51c00908,0x2802400,0x962460,0x51c0a008,0x2802400, +0x962460,0x52000f0a,0x2802100,0x962460,0x52000f0a,0x6800100,0x962540,0x52000f0a,0x7c00100,0x230400,0x52001004,0x4000000,0x1600000,0x52001b00,0x4000000,0x200000, +0x52001c1c,0x2802100,0x1862460,0x52001c1c,0x6800100,0x1862400,0x52001c1c,0x6800400,0x1862400,0x52001e12,0x7c00100,0x2230500,0x52001e12,0x7c00100,0x2330520,0x52002128, +0x4000002,0x400000,0x52002128,0x7c00100,0x230400,0x52002a00,0x4000000,0x1500000,0x52002a00,0x4000000,0x1600000,0x52002d00,0x4000000,0x200006,0x52003000,0x24000000, +0x200000,0x52006108,0x7c00100,0x220400,0x52006108,0x7c00100,0x250400,0x52008301,0x2802400,0x962460,0x52008407,0x2802400,0x962460,0x52008407,0x7c00100,0x220400, +0x52008407,0x7c00100,0x250400,0x52008b3b,0x6800000,0x1800000,0x52008b3b,0x7c00100,0x1830000,0x52008e00,0x24000000,0x400000,0x52009419,0x7c00100,0x250400,0x5200975b, +0x4000000,0x200000,0x5200ac7e,0x2802000,0x962460,0x5200ac7e,0x2802100,0x962460,0x5200ac7e,0x2802400,0x962460,0x5200ac7e,0x4000010,0x200000,0x5200ac7e,0x7c00100, +0x230400,0x5200ad28,0x7c00100,0x230400,0x5200ae6a,0x2802100,0x1862460,0x5200ae6a,0x2802400,0x962460,0x5200ae6a,0x2802400,0x1862460,0x5200ae6a,0x2806000,0x1862460, +0x5200ae6a,0x4000000,0x1800000,0x5200ae6a,0x6800000,0x1329800,0x5200ae6a,0x6800100,0x1862400,0x5200ae6a,0x6800100,0x1862540,0x5200ae6a,0x7c00100,0x1830000,0x5200ae6a, +0x7c00900,0x1830000,0x5200ae6a,0xc000010,0x1848000,0x5200b083,0x4000010,0x400000,0x5200b083,0x7c00100,0x230400,0x5200b083,0xc000010,0x448000,0x5200b182,0x2802400, +0x962460,0x5200b182,0x4000000,0x200000,0x5200b182,0x4000010,0x400000,0x5200b182,0x7c00100,0x230400,0x5200b182,0xc000010,0x448000,0x5200b30a,0x2802400,0x962460, +0x5200b30a,0x4000000,0x200000,0x5200b30a,0x7c00100,0x230400,0x5200b54e,0x2802100,0x962460,0x5200b54e,0x2802400,0x962460,0x5200b54e,0x4000000,0x200000,0x5200b54e, +0x4000010,0x400000,0x5200b54e,0x6800000,0x1329800,0x5200b54e,0x6800100,0x962540,0x5200b54e,0x6804400,0x962540,0x5200b54e,0x7c00100,0x230400,0x5200b54e,0xc000010, +0x448000,0x5200b61c,0x4000000,0x1800000,0x5200b61c,0x6800400,0x1862400,0x5200b61c,0x7c00100,0x1830000,0x5200b61c,0x7c00900,0x1830000,0x5200b77f,0x2802100,0x1862460, +0x5200b77f,0x2802400,0x1862460,0x5200b77f,0x4000000,0x1800000,0x5200b77f,0x4000010,0x1800000,0x5200b77f,0x7c00100,0x1830000,0x5200b77f,0x7c00500,0x1830000,0x5200b77f, +0x7c00900,0x1830000,0x5200b77f,0x7e00100,0x1830000,0x5200b873,0x2802100,0x962460,0x5200b873,0x2806400,0x962460,0x5200b873,0x6800000,0x1329800,0x5200b873,0x6800100, +0x962540,0x5200b873,0x6800400,0x962540,0x5200b873,0x7c00100,0x230400,0x5200b873,0xc000010,0x448000,0x5200b912,0x7c00100,0x2230500,0x5200b912,0x7c00100,0x2330520, +0x5200ba74,0x4000000,0x200000,0x5200ba74,0x4000010,0x400000,0x5200ba74,0x7c00100,0x230400,0x5200bb85,0x4000000,0x200000,0x5200bb85,0x7c00100,0x230400,0x5200bc75, +0x4000000,0x400000,0x5200bc75,0x4000010,0x400000,0x5200bc75,0x7c00100,0x230400,0x5200bd7d,0x4000000,0x200000,0x5200bd7d,0x7c00100,0x230400,0x5200be7a,0x4000000, +0x200000,0x5200be7a,0x7c00100,0x230400,0x5200bf58,0x7c00100,0x230400,0x5200c002,0x4000000,0x200000,0x5200c178,0x2802000,0x962460,0x5200c178,0x2802100,0x962460, +0x5200c178,0x2802400,0x962460,0x5200c178,0x2806400,0x962460,0x5200c178,0x4000000,0x200000,0x5200c178,0x6800100,0x962540,0x5200c178,0x7c00100,0x230400,0x5200c178, +0x7c00100,0x230401,0x5200c178,0xc000010,0x448000,0x5200c178,0x80000000,0x218960,0x5200c247,0x7c00100,0x230400,0x5200c247,0x7c00100,0x830400,0x5200c247,0x7c00100, +0x1430400,0x5200c300,0x4000000,0x200003,0x52022d00,0x4000000,0x100006,0x52023700,0x24000000,0x100000,0x52023700,0x24000000,0xe00000,0x52023700,0x24000000,0x10100000, +0x52023700,0x24000000,0x10e00000,0x52023700,0x24000000,0x928045a0,0x52024400,0x4000000,0x100000,0x52027300,0x24000000,0x100000,0x5202c300,0x4000000,0x100000,0x5202c300, +0x4000000,0x100002,0x5202c300,0x4000000,0x100003,0x5202c300,0x4000000,0x10000d,0x5202c300,0x4000100,0x150400,0x5202c300,0x4000100,0x15040d,0x5202c300,0x4000100, +0x10150400,0x520a1e12,0x7c00100,0x2130480,0x520a3700,0x24000000,0x30e00000,0x520a3800,0x24000000,0x30100000,0x520a4711,0x7c40300,0xe30000,0x520a4f11,0x7c00300,0xe30001, +0x520a7300,0x24000000,0x30100000,0x520ab412,0x7c00100,0x2130480,0x520ac400,0x4000000,0xe00002,0x520ac400,0x4000000,0xe0000d,0x520ac400,0x4000000,0x30e0000d,0x520ac414, +0x4000000,0xe0000d,0x520ac511,0x7c40300,0xe30000,0x5240af7a,0x6800400,0x962540,0x5240af7a,0x7c00100,0x230400,0x5240af7b,0x4000400,0x200000,0x5240af7b,0x6800100, +0x962540,0x5240b29b,0x4000000,0x200000,0x5240b2a5,0x4000000,0x200000,0x5240b2a5,0x4000000,0x1500000,0x5240b5b9,0x7c00900,0x230400,0x524a4495,0x4000000,0xe00003, +0x5280af7a,0x2802400,0x962460,0x5280af7b,0x2802400,0x962460,0x5280af7d,0x2802400,0x962460,0x5280af7f,0x2802400,0x962460,0x52c0b3b0,0x2802400,0x962460,0x52c0b3b4, +0x7c00100,0x230400,0x60000c02,0x2802100,0x962460,0x60000c02,0x7c00100,0x230400,0x60000f0a,0x2802100,0x962460,0x60000f0a,0x6800100,0x962540,0x60000f0a,0x7c00100, +0x230400,0x6000131f,0x4000000,0x200000,0x6000171a,0x7c00100,0x230400,0x6000171a,0x7c00100,0x230560,0x60001b27,0x2802100,0x962460,0x60001b27,0x4000000,0xc00000, +0x60001b27,0x7c00100,0x230400,0x60001f0b,0x2802000,0x962460,0x60002919,0x7c00100,0x22040e,0x60002a00,0x4000000,0x1600000,0x60003000,0x24000000,0x10200000,0x60003000, +0x24000000,0x10e00000,0x60003700,0x24000000,0x200000,0x60003800,0x24000000,0x1710000,0x60005102,0x4000000,0x200000,0x60006108,0x7c00100,0x220400,0x60006108,0x7c00100, +0x250400,0x60006600,0x24000020,0x200000,0x60008301,0x2802000,0x962460,0x6000903c,0x2806000,0x962460,0x6000903c,0x4000000,0x400000,0x60009519,0x7c00100,0x220400, +0x60009519,0x7c00100,0x250400,0x6000a008,0x7c00100,0x220400,0x6000a008,0x7c00100,0x250400,0x6000c300,0x4000000,0x3a703580,0x6000c654,0x2802000,0x962460,0x6000c654, +0x4000010,0x200000,0x6000c654,0x7c00100,0x230400,0x6000c73f,0x2802000,0x962460,0x6000c73f,0x2802100,0x962460,0x6000c73f,0x4000000,0x200000,0x6000c73f,0x6800100, +0x962540,0x6000c73f,0x6804000,0x962540,0x6000c73f,0x7c00100,0x230400,0x6000c80b,0x7c00100,0x230400,0x6000c941,0x2802100,0x962460,0x6000c941,0x2806000,0x962460, +0x6000c941,0x4000000,0x200000,0x6000c941,0x4000010,0x200000,0x6000c941,0x6800000,0x1329800,0x6000c941,0x6800100,0x962540,0x6000c941,0x7c00100,0x230400,0x6000c941, +0xc000010,0x448000,0x6000ca82,0x7c00100,0x230400,0x6000cc00,0x4000000,0xe00000,0x6000d000,0x4000000,0x200000,0x6002c300,0x4000000,0x100000,0x6002c300,0x4000000, +0x10000d,0x6002c300,0x4000100,0x150400,0x6002c300,0x4000100,0x15040d,0x6002c300,0x4000100,0x10150400,0x600a3000,0x24000000,0x30200000,0x600a3000,0x24000000,0x30e00000, +0x600a3700,0x24000000,0x30200000,0x600a3800,0x24000000,0x30200000,0x600a3800,0x24000000,0xb28045a0,0x600a4305,0x7c00100,0xe30400,0x600ac300,0x4000000,0x30100000,0x600ac400, +0x4000000,0x10e0000d,0x600ac400,0x4000000,0x30e0000d,0x600acb14,0x7c00100,0xe30000,0x600acb16,0x7c00100,0xe30c00,0x600acc00,0x4000000,0x30e00000,0x600acd00,0x4000000, +0x30200000,0x600acd00,0x4000000,0x30e00000,0x600acd00,0x4000000,0x30e05200,0x600acd00,0x4000000,0xb28045a0,0x600acd00,0x4000000,0xb28049c0,0x600ace00,0x4000000,0x30e00000, +0x600ace00,0x4000000,0xb28045a0,0x600acf00,0x4000000,0x30e00000,0x600acf00,0x4000000,0x30e05200,0x600acf00,0x4000000,0xb28045a0,0x600ad111,0x7c40300,0xe30000,0x604ac495, +0x4000000,0x30e00003,0x61000a03,0x4000000,0x1600000,0x61000c02,0x80000000,0x218960,0x6100120f,0x4000000,0x200000,0x61001a18,0x7c00100,0x1830000,0x61001d0c,0x7c00100, +0x230400,0x61001d0c,0x7c00100,0x250400,0x61006600,0x24000020,0x200000,0x61008407,0x7c00100,0x220400,0x61008407,0x7c00100,0x250400,0x6100870c,0x7c00100,0x220400, +0x61008e00,0x24000000,0x200000,0x61008e00,0x24000000,0x400000,0x61008e00,0x24000002,0x300000,0x6100903c,0x7c00100,0x230400,0x61009519,0x7c00100,0x220400,0x61009519, +0x7c00100,0x250400,0x61009519,0x7c00500,0x22040f,0x61009b71,0x2802100,0x962460,0x61009b71,0x2806400,0x962460,0x61009b71,0x7c00100,0x230400,0x6100a008,0x2802100, +0x962460,0x6100c300,0x4000000,0x20000f,0x6100cd00,0x4000000,0x200000,0x6100d202,0x2802400,0x962460,0x6100d202,0x2802500,0x962460,0x6100d202,0x7c00100,0x230400, +0x6100d302,0x4000020,0x200000,0x6100d302,0x7c00120,0x230405,0x6100d476,0x2802100,0x962460,0x6100d476,0x2802100,0x962461,0x6100d476,0x2806400,0x962460,0x6100d476, +0x4000000,0x400000,0x6100d476,0x6800000,0x1329800,0x6100d476,0x6800100,0x962540,0x6100d476,0x7c00100,0x230400,0x6100d476,0xc000010,0x448000,0x6100d573,0x2802100, +0x962460,0x6100d573,0x2806400,0x962460,0x6100d573,0x6800100,0x962540,0x6100d573,0x7c00100,0x230400,0x6100d573,0x7c00900,0x230400,0x6100d573,0xc000010,0x448000, +0x6100d68d,0x7c00100,0x230400,0x6100d756,0x7c00100,0x230400,0x6100d85c,0x2802400,0x962460,0x6100d85c,0x6800100,0x962540,0x6100d85c,0x7c00100,0x230400,0x6100d85c, +0x7c00500,0x230400,0x6100d997,0x2802100,0x962460,0x6100d997,0x4000000,0x200000,0x6100d997,0x4000000,0x400000,0x6100d997,0x6800000,0x1329800,0x6100d997,0x6800100, +0x962540,0x6100d997,0x6804400,0x962540,0x6100d997,0x7c00100,0x230400,0x6100d997,0x7c00100,0x230560,0x6100d997,0xc000010,0x448000,0x6100da98,0x6800000,0x1329800, +0x6100da98,0x7c00100,0x230400,0x6100db71,0x4000000,0x200000,0x6100dc99,0x2802100,0x962460,0x6100dc99,0x2802400,0x962460,0x6100dc99,0x6800000,0x1329800,0x6100dc99, +0x6800100,0x962540,0x6100dc99,0x6804400,0x962540,0x6100dc99,0x7c00100,0x230400,0x610a4711,0x7c40300,0xe30000,0x610a4f11,0x7c00300,0xe30001,0x610ace00,0x4000000, +0x30e00000,0x6140af7a,0x7c00100,0x230400,0x6140af7b,0x6800100,0x962540,0x6140af84,0x7c00100,0x230400,0x6180af7b,0x2802400,0x962460,0x62002a00,0x4000000,0x1600000, +0x63002800,0x80000,0x918820,0x63c00c11,0x80000,0x918820,0x7000080e,0x7c00100,0x250400,0x70000a03,0x4000000,0x200000,0x70000c00,0x80000000,0x218960,0x70000f0a, +0x7c00100,0x230400,0x70001004,0x7c00100,0x230400,0x70001524,0x2802100,0x962460,0x70001524,0x7c00100,0x230400,0x70001615,0x2802100,0x962460,0x7000171a,0x2802100, +0x962460,0x70001821,0x6800000,0x1329800,0x70002320,0x7c00100,0x230400,0x70002a00,0x4000000,0x1500000,0x70002a00,0x4000000,0x1600000,0x70003000,0x24000000,0x200000, +0x70003000,0x24000000,0x10200000,0x70003800,0x24000000,0xe00000,0x70005201,0x2802400,0x962460,0x7000581e,0x7c00100,0x230400,0x70006108,0x7c00100,0x220400,0x70006108, +0x7c00100,0x250400,0x70006f30,0x7c00100,0x230400,0x70007300,0x24000000,0x200000,0x70007f0e,0x4000000,0x200000,0x70008301,0x2802100,0x962460,0x70008301,0x2802400, +0x962460,0x70008e00,0x24000000,0x200000,0x70008e00,0x24000000,0x400000,0x70008e00,0x24000002,0x400000,0x70008e00,0x24000008,0x1410000,0x70008e00,0x24000010,0x400000, +0x70008e00,0x2c000010,0x448000,0x70009519,0x7c00100,0x220400,0x70009519,0x7c00100,0x230400,0x70009519,0x7c00100,0x250400,0x70009865,0x7c00100,0x230400,0x70009965, +0x4000010,0x400000,0x70009965,0x7c00100,0x230400,0x7000a008,0x7c00100,0x220400,0x7000a008,0x7c00100,0x250400,0x7000a008,0x7c00500,0x22040f,0x7000a50e,0x4000000, +0x200000,0x7000b61c,0x2802400,0x1862460,0x7000b61c,0x6800400,0x1862400,0x7000b61c,0x7c00100,0x1830000,0x7000c300,0x4000000,0x100000,0x7000c941,0x2806000,0x962460, +0x7000cc00,0x4000000,0xe00000,0x7000cd00,0x4000000,0x200000,0x7000cd00,0x4000000,0xe00000,0x7000cd00,0x4000000,0x10200000,0x7000cd00,0x4000000,0x10e00000,0x7000cd00, +0x4000000,0x10e05200,0x7000cd00,0x4000000,0x928045a0,0x7000cf00,0x4000000,0xe00000,0x7000cf00,0x4000000,0x10e00000,0x7000d202,0x2802100,0x962460,0x7000d202,0x7c00100, +0x230400,0x7000d997,0x7c00100,0x230400,0x7000d997,0xc000010,0x248000,0x7000dd86,0x2802400,0x962460,0x7000dd86,0x7c00100,0x230400,0x7000dd86,0xc000010,0x448000, +0x7000de9f,0x4000000,0x200000,0x7000de9f,0x7c00100,0x230400,0x7000e001,0x2000,0x962460,0x7000e001,0x2802400,0x962460,0x7000e187,0x2802000,0x962460,0x7000e187, +0x2802100,0x962460,0x7000e187,0x4000000,0x200000,0x7000e187,0x7c00100,0x230400,0x7000e187,0xc000010,0x448000,0x7000e288,0x7c00100,0x230400,0x7000e300,0x4000000, +0x200000,0x7000e489,0x2802100,0x962460,0x7000e489,0x2802400,0x962460,0x7000e489,0x6800100,0x962540,0x7000e489,0x6800100,0x962541,0x7000e489,0x6804400,0x962540, +0x7000e489,0x7c00100,0x230400,0x7000e489,0x7c00900,0x230400,0x7000e59d,0x2802100,0x962460,0x7000e59d,0x2802400,0x962460,0x7000e59d,0x4000000,0x200000,0x7000e59d, +0x4000010,0x200000,0x7000e59d,0x6800100,0x962540,0x7000e59d,0x6804400,0x962540,0x7000e59d,0x7c00100,0x230400,0x7000e59d,0xc000010,0x448000,0x7000e691,0x2802100, +0x962460,0x7000e691,0x2802400,0x962460,0x7000e691,0x2806400,0x962460,0x7000e691,0x6800000,0x1329800,0x7000e691,0x6800100,0x962540,0x7000e691,0x7c00100,0x230400, +0x7000e700,0x4000400,0x200400,0x7000e70e,0x7c00100,0x220400,0x7000e719,0x7c00100,0x220400,0x7000e719,0x7c00500,0x22040f,0x7000e853,0x7c00100,0x230400,0x7000e9a0, +0x2802400,0x962460,0x7000e9a0,0x4000000,0x200000,0x7000e9a0,0x4000000,0x500000,0x7000e9a0,0x7c00100,0x230400,0x7000ea79,0x2802400,0x962460,0x7000ea79,0x4000000, +0x200000,0x7000ea79,0x4000000,0xf00000,0x7000ea79,0x4000010,0x400000,0x7000ea79,0x7c00100,0x230400,0x7000eb8c,0x2802400,0x962460,0x7000eb8c,0x4000000,0x200000, +0x7000eb8c,0x7c00100,0x230400,0x7000eca3,0x2802100,0x962460,0x7000eca3,0x2806400,0x962460,0x7000eca3,0x4000000,0x200000,0x7000eca3,0x6800000,0x1329800,0x7000eca3, +0x6800100,0x962540,0x7000eca3,0x7c00100,0x230400,0x7000eca3,0xc000010,0x448000,0x7000ed95,0x6800000,0x1329800,0x7000ed95,0x7c00100,0x230400,0x7000ed95,0xc000010, +0x448000,0x7000ee1c,0x2802400,0x1862460,0x7000ee1c,0x6800000,0x1329800,0x7000ee1c,0x7c00100,0x1830000,0x7000ee1c,0x7c00900,0x1830000,0x7000ef8f,0x4000000,0x200000, +0x7000ef8f,0x7c00100,0x230400,0x7000f08e,0x4000000,0x200000,0x7000f08e,0x7c00100,0x230400,0x7000f159,0x2802100,0x962460,0x7000f159,0x7c00100,0x230400,0x7000f200, +0x4000000,0x200000,0x7000f200,0x4000000,0x1200000,0x7000f200,0x4000000,0x1710000,0x7000f34b,0x2802100,0x962460,0x7000f34b,0x4000000,0x200000,0x7000f34b,0x4000010, +0x400000,0x7000f34b,0x6800000,0x1329800,0x7000f34b,0x7c00100,0x230400,0x7000f34b,0x7c00900,0x230400,0x7000f34b,0xc000010,0x448000,0x7000f490,0x4000000,0x200000, +0x7000f490,0x7c00100,0x230400,0x7000f5a5,0x7c00100,0x230400,0x7000f67b,0x4000000,0x200000,0x7000f67b,0x4000010,0x200000,0x7000f67b,0x7c00100,0x230400,0x7000f8a6, +0x2802100,0x962460,0x7000f8a6,0x2802400,0x962460,0x7000f8a6,0x2806400,0x962460,0x7000f8a6,0x4000000,0x500000,0x7000f8a6,0x4000010,0xb00000,0x7000f8a6,0x4000800, +0x200000,0x7000f8a6,0x6800100,0x962540,0x7000f8a6,0x6800100,0x962541,0x7000f8a6,0x7c00100,0x230400,0x7000f8a6,0xc000010,0x448000,0x7000f921,0x4000000,0x200000, +0x7000fa00,0x4000000,0x200000,0x7000fb9e,0x2802100,0x962460,0x7000fb9e,0x2802400,0x962460,0x7000fb9e,0x2806400,0x962460,0x7000fb9e,0x4000000,0x200000,0x7000fb9e, +0x6800000,0x1329800,0x7000fb9e,0x6800100,0x962540,0x7000fb9e,0x6800100,0x962541,0x7000fb9e,0x7c00100,0x230400,0x7000fc92,0x4000000,0x200000,0x7000fc92,0x6800000, +0x1329800,0x7000fc92,0x7c00100,0x220400,0x7000fc92,0x7c00100,0x230400,0x7000fc92,0x7c00100,0x250400,0x700acd00,0x4000000,0x30e00000,0x700acd00,0x4000000,0xb28045a0, +0x700ace00,0x4000000,0x30e00000,0x700acf00,0x4000000,0x30e00000,0x700acf00,0x4000000,0xb28045a0,0x7040dfc0,0x4000000,0x200000,0x7040f7c4,0x80000,0x918820,0x7080af7b, +0x2802400,0x962460,0x7080dfc0,0x2802400,0x962460,0x70c0e4c2,0x2802100,0x962460,0x70c0e4c2,0x2802400,0x962460,0x70c0e4c2,0x6800100,0x962540,0x8000120f,0x7c00100, +0x230400,0x80001524,0x7c00100,0x230400,0x8000171a,0x7c00100,0x230400,0x80002006,0x7c00100,0x220400,0x80002006,0x7c00100,0x250400,0x80002a00,0x4000000,0x1500000, +0x80002d00,0x4000000,0x200000,0x80005208,0x2802400,0x962460,0x80005c00,0x4000000,0x200000,0x80007300,0x24000000,0x200000,0x80009519,0x7c00100,0x220400,0x80009519, +0x7c00100,0x230400,0x80009519,0x7c00100,0x250400,0x80009865,0x7c00100,0x230400,0x8000a008,0x2802100,0x962460,0x8000b30a,0x4000000,0x500000,0x8000b30a,0x7c00100, +0x230400,0x8000cd00,0x4000000,0xe00000,0x8000d202,0x2802500,0x962460,0x8000d202,0x7c00100,0x230400,0x8000d68d,0x4000000,0x200000,0x8000d997,0x2802400,0x962460, +0x8000d997,0x4000000,0x200000,0x8000d997,0x4000000,0x400000,0x8000d997,0x4000000,0x500000,0x8000d997,0x7c00100,0x230400,0x8000d997,0xc000010,0x448000,0x8000e489, +0x2802100,0x962460,0x8000e489,0x7c00100,0x230400,0x8000e719,0x7c00100,0x220400,0x8000f8a6,0x2802100,0x962460,0x8000f8a6,0x7c00100,0x230400,0x8000f8a6,0xc000010, +0x448000,0x8000fda1,0x2802100,0x1862460,0x8000fda1,0x2806400,0x1862460,0x8000fda1,0x4000000,0x1800000,0x8000fda1,0x6800000,0x1329800,0x8000fda1,0x6800100,0x1862540, +0x8000fda1,0x7c00100,0x1830000,0x8000fda1,0xc000010,0x448000,0x8000fe9c,0x7c00100,0x230400,0x8000fe9c,0x7c00100,0x830400,0x8000fe9c,0x7c00100,0x1430400,0x8000ff06, +0x7c00100,0x220400,0x80010165,0x7c00100,0x230400,0x800102a2,0x4000000,0x200000,0x800102a2,0x7c00100,0x230400,0x800103a4,0x7c00100,0x230400,0x800103a4,0xc000010, +0x448000,0x8001044c,0x4000000,0x200000,0x8001044c,0x7c00100,0x220400,0x8001044c,0x7c00100,0x250400,0x80010670,0x2802000,0x962460,0x80010670,0x4000000,0x200000, +0x80010670,0x4000010,0x400000,0x80010670,0xc000010,0x448000,0x800a4711,0x7c40300,0xe30000,0x800acd00,0x4000000,0x30e00000,0x800acd00,0x4000000,0x7a904de0,0x800ace00, +0x4000000,0x30e00000,0x800acf00,0x4000000,0x30e00000,0x800b0011,0x7c40300,0xe30000,0x800b0500,0x4000000,0x30e00000,0x800b0500,0x4000000,0xb28045a0,0x90001615,0x7c00100, +0x230400,0x9000171a,0x4000000,0x200000,0x9000171a,0x7c00100,0x230400,0x90003000,0x24000000,0x200000,0x90007f0e,0x4000000,0x200000,0x90008301,0x2802000,0x962460, +0x90008e00,0x24000000,0x400000,0x90009519,0x7c00100,0x250400,0x9000a16f,0x2802100,0x962460,0x9000d200,0x80000000,0x218960,0x9000d202,0x2802000,0x962460,0x9000d202, +0x2802100,0x962460,0x9000d202,0x7c00100,0x230400,0x9000e59d,0x2802100,0x962460,0x900107a7,0x2802100,0x962460,0x900107a7,0x2802400,0x962460,0x900107a7,0x2802c00, +0x962460,0x900107a7,0x4000000,0x1400000,0x900107a7,0x6800000,0x1329800,0x900107a7,0x7c00100,0x220400,0x900107a7,0x7c00100,0x250400,0x900108a8,0x2802100,0x962460, +0x900108a8,0x2806400,0x962460,0x900108a8,0x4000000,0x200000,0x900108a8,0x4000000,0x400000,0x900108a8,0x4000010,0x400000,0x900108a8,0x6800000,0x1329800,0x900108a8, +0x6800100,0x962540,0x900108a8,0x7c00100,0x230400,0x900108a8,0xc000010,0x448000,0x90010908,0x7c00100,0x220400,0x90010a38,0x2802100,0x962460,0x90010ca9,0x2802100, +0x962460,0x90010ca9,0x4000000,0x500000,0x90010ca9,0x4000010,0xb00000,0x90010ca9,0x6800100,0x962540,0x90010ca9,0x7c00100,0x230400,0x90010d1b,0x4000000,0x500000, +0x90010eaa,0x2802100,0x962460,0x90010eaa,0x2802400,0x962460,0x90010eaa,0x2806400,0x962460,0x90010eaa,0x4000000,0x200000,0x90010eaa,0x4000000,0x400000,0x90010eaa, +0x4000010,0x400000,0x90010eaa,0x6800000,0x1329800,0x90010eaa,0x6800100,0x962540,0x90010eaa,0x7c00100,0x230400,0x90010eaa,0xc000010,0x448000,0x90010fab,0x7c00100, +0x220400,0x90010fab,0x7c00100,0x250400,0x9002c300,0x4000000,0x100000,0x900ac400,0x4000000,0xe0000d,0x900acd00,0x4000000,0x30e00000,0x900acd00,0x4000000,0xb28045a0, +0x900acf00,0x4000000,0x30e00000,0x900b0500,0x4000000,0xe00000,0x900b0500,0x4000000,0x30e00000,0x900b0500,0x4000000,0xb28045a0,0x900b0b9a,0x7c00900,0x1230400,0x900b109a, +0x7c00300,0xe30000,0x900b119a,0x7c00300,0xe30000,0x90408e06,0x24000000,0x400000,0xa0001004,0x4000000,0x200000,0xa0001004,0x7c00100,0x230400,0xa000120f,0x2802100, +0x962460,0xa000120f,0x2802400,0x962460,0xa000171a,0x2802100,0x962460,0xa000171a,0x2806400,0x962460,0xa0002a00,0x4000000,0x1600000,0xa0003000,0x24000000,0x200000, +0xa000581e,0x7c00100,0x230400,0xa0007300,0x24000000,0x200000,0xa0008301,0x2802400,0x962460,0xa0008e00,0x24000000,0x400000,0xa000cf00,0x4000000,0xe00000,0xa0010500, +0x4000000,0x200000,0xa00114af,0x2802100,0x962460,0xa00114af,0x2802400,0x962460,0xa00114af,0x2806400,0x962460,0xa00114af,0x6800000,0x1329800,0xa00114af,0x7c00100, +0x230400,0xa00114af,0x7c00100,0x230560,0xa00116b0,0x2802100,0x962460,0xa00116b0,0x2802800,0x962460,0xa00116b0,0x2806400,0x962460,0xa00116b0,0x4000000,0x400000, +0xa00116b0,0x4000000,0x500000,0xa00116b0,0x4000010,0x400000,0xa00116b0,0x6800100,0x962540,0xa00116b0,0x7c00100,0x230400,0xa00116b0,0x7c00100,0x230560,0xa00116b0, +0xc000010,0x448000,0xa0011722,0x7c00100,0x230400,0xa00118b1,0x2802000,0x962460,0xa00118b1,0x2802100,0x962460,0xa00118b1,0x2806400,0x962460,0xa00118b1,0x4000000, +0x200000,0xa00118b1,0x4000000,0x400000,0xa00118b1,0x4000000,0x500000,0xa00118b1,0x6800100,0x962540,0xa00118b1,0x7c00100,0x230400,0xa00118b1,0x7c00100,0x230560, +0xa00118b1,0xc000010,0x448000,0xa00a4005,0x7c00100,0xe30400,0xa00a4711,0x7c40300,0xe30000,0xa00ac400,0x4000000,0xe00000,0xa00acb14,0x7c00100,0xe30000,0xa00acf00, +0x4000000,0x30e00000,0xa00b0500,0x4000000,0x30e00000,0xa00b0500,0x4000000,0xb28045a0,0xa00b0b96,0x7c00900,0x1230400,0xa00b1211,0x7c40300,0xe30000,0xa00b1314,0x7c00100, +0xe30000,0xa00b1596,0x7c00300,0xe30000,0xa040af86,0x6800400,0x962540}; -static const int32_t countPropsVectors=6195; -static const int32_t propsVectorsColumns=3; -static const uint16_t scriptExtensions[194]={ +static const int32_t countPropsVectors=6375; +static const int32_t propsVectorsColumns=3; /* The code assumes that this value is > 0*/ +static const uint16_t scriptExtensions[198]={ 0x800e,0x8019,8,0x8059,8,2,8,0x8038,8,6,8,0x8019,3,0x800c,2,0x22, -0x8025,2,0x22,0x54,0x79,0x7b,0x80a7,2,0x8022,2,0x8025,2,0x19,4,0xa,0xf, -0x10,0x15,0x19,0x1a,0x1f,0x23,0x24,0x89,0x8097,4,0xa,0xf,0x10,0x15,0x19,0x1a, -0x1f,0x23,0x24,0x8089,4,0xa,0xf,0x10,0x15,0x1a,0x1f,0x21,0x23,0x24,0x3a,0x89, -0x91,0x99,0x9e,0x80a0,4,0xa,0xf,0x10,0x15,0x1a,0x1f,0x21,0x23,0x24,0x30,0x3a, -0x89,0x91,0x99,0x9e,0x80a0,0xa,0x78,0x80a0,0xa,0x55,4,0x3a,0x8076,4,0x5a,0x10, -0x80a4,0x10,0x5f,0xf,0x809d,0xf,0x63,0x23,0x8089,0x23,0x67,0x1c,0x34,0x8076,0x1c,0x6b, -0xc,0x8019,0x2a,0x2b,0x2c,0x802d,0x1b,0x805a,0x800a,0xa,0x8089,0xa,0x8097,0xa,0x15,0x1a, -0x23,0x8024,0xa,0x8015,0xa,0x19,0x8089,5,0x11,0x12,0x14,0x16,0x8029,5,0x11,0x12, -0x14,0x8016,0x8011,5,0x8011,0x11,0x14,0x8016,0xa,0xf,0x10,0x15,0x78,0x91,0x99,0x9e, -0xa0,0x80a3,0xa,0xf,0x10,0x78,0x91,0x99,0x9e,0xa0,0x80a3,4,0x800a,0xa,0xab,0xa, -0x8023,0xa,0xaf,0x19,0x1c,0x804f,0x37,0x804e,0x2f,0x31,0x8053,0x2f,0x8031,2,0x8007,0x89, -0x67,0x8087}; +0x8025,2,0xe,2,0x22,0x54,0x79,0x7b,0x80a7,2,0x8022,2,0x8025,2,0x1b,4, +0xa,0xf,0x10,0x15,0x19,0x1a,0x1f,0x23,0x24,0x89,0x8097,4,0xa,0xf,0x10,0x15, +0x19,0x1a,0x1f,0x23,0x24,0x8089,4,0xa,0xf,0x10,0x15,0x1a,0x1f,0x21,0x23,0x24, +0x3a,0x89,0x91,0x99,0x9e,0x80a0,4,0xa,0xf,0x10,0x15,0x1a,0x1f,0x21,0x23,0x24, +0x30,0x3a,0x89,0x91,0x99,0x9e,0x80a0,0xa,0x78,0x80a0,0xa,0x57,4,0x3a,0x8076,4, +0x5c,0x10,0x80a4,0x10,0x61,0xf,0x809d,0xf,0x65,0x23,0x8089,0x23,0x69,0x1c,0x34,0x8076, +0x1c,0x6d,0xc,0x8019,0x2a,0x2b,0x2c,0x802d,0x1b,0x805a,0x800a,0xa,0x8089,0xa,0x8097,0xa, +0x15,0x1a,0x23,0x8024,0xa,0x8015,0x8004,0xa,0x19,0x8089,5,0x11,0x12,0x14,0x16,0x8029, +5,0x11,0x12,0x14,0x8016,0x8011,5,0x8011,0x11,0x14,0x8016,0xa,0xf,0x10,0x15,0x78, +0x91,0x99,0x9e,0xa0,0x80a3,0xa,0xf,0x10,0x78,0x91,0x99,0x9e,0xa0,0x80a3,4,0x800a, +0xa,0xae,0xa,0x8023,0xa,0xb2,0x19,0x1c,0x804f,0x37,0x804e,0x2f,0x31,0x8053,0x2f,0x8031, +2,0x8007,0x89,0x69,0x8087,0}; -static const int32_t indexes[UPROPS_INDEX_COUNT]={0x28aa,0x28aa,0x28aa,0x28aa,0x606c,3,0x789f,0x7900,0x7900,0x7900,0xb11ae,0x2a75631,0,0,0,0}; +static const int32_t indexes[UPROPS_INDEX_COUNT]={0x2962,0x2962,0x2962,0x2962,0x6280,3,0x7b67,0x7bca,0x7bca,0x7bca,0xb18b1,0x2a75631,0,0,0,0}; #endif // INCLUDED_FROM_UCHAR_C diff --git a/deps/icu-small/source/common/ucharstrie.cpp b/deps/icu-small/source/common/ucharstrie.cpp index d04d315c7913e0..e0b33af5194393 100644 --- a/deps/icu-small/source/common/ucharstrie.cpp +++ b/deps/icu-small/source/common/ucharstrie.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucharstrie.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -175,7 +175,8 @@ UCharsTrie::next(int32_t uchar) { } UStringTrieResult -UCharsTrie::next(const UChar *s, int32_t sLength) { +UCharsTrie::next(ConstChar16Ptr ptr, int32_t sLength) { + const UChar *s=ptr; if(sLength<0 ? *s==0 : sLength==0) { // Empty input. return current(); diff --git a/deps/icu-small/source/common/ucharstriebuilder.cpp b/deps/icu-small/source/common/ucharstriebuilder.cpp index 412a58a45d6bd0..049997a27545ed 100644 --- a/deps/icu-small/source/common/ucharstriebuilder.cpp +++ b/deps/icu-small/source/common/ucharstriebuilder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucharstriebuilder.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -287,7 +287,7 @@ UCharsTrieBuilder::indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UCha UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode) : LinearMatchNode(len, nextNode), s(units) { - hash=hash*37+ustr_hashUCharsN(units, len); + hash=hash*37u+ustr_hashUCharsN(units, len); } UBool diff --git a/deps/icu-small/source/common/ucharstrieiterator.cpp b/deps/icu-small/source/common/ucharstrieiterator.cpp index 68ba8c2177878a..b3132241fe2b7a 100644 --- a/deps/icu-small/source/common/ucharstrieiterator.cpp +++ b/deps/icu-small/source/common/ucharstrieiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucharstrieiterator.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -21,7 +21,7 @@ U_NAMESPACE_BEGIN -UCharsTrie::Iterator::Iterator(const UChar *trieUChars, int32_t maxStringLength, +UCharsTrie::Iterator::Iterator(ConstChar16Ptr trieUChars, int32_t maxStringLength, UErrorCode &errorCode) : uchars_(trieUChars), pos_(uchars_), initialPos_(uchars_), diff --git a/deps/icu-small/source/common/uchriter.cpp b/deps/icu-small/source/common/uchriter.cpp index fd0a407c6b1763..822168f5c8e600 100644 --- a/deps/icu-small/source/common/uchriter.cpp +++ b/deps/icu-small/source/common/uchriter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -25,14 +25,14 @@ UCharCharacterIterator::UCharCharacterIterator() // never default construct! } -UCharCharacterIterator::UCharCharacterIterator(const UChar* textPtr, +UCharCharacterIterator::UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length) : CharacterIterator(textPtr != 0 ? (length>=0 ? length : u_strlen(textPtr)) : 0), text(textPtr) { } -UCharCharacterIterator::UCharCharacterIterator(const UChar* textPtr, +UCharCharacterIterator::UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length, int32_t position) : CharacterIterator(textPtr != 0 ? (length>=0 ? length : u_strlen(textPtr)) : 0, position), @@ -40,7 +40,7 @@ UCharCharacterIterator::UCharCharacterIterator(const UChar* textPtr, { } -UCharCharacterIterator::UCharCharacterIterator(const UChar* textPtr, +UCharCharacterIterator::UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length, int32_t textBegin, int32_t textEnd, @@ -349,7 +349,7 @@ UCharCharacterIterator::move32(int32_t delta, CharacterIterator::EOrigin origin) return pos; } -void UCharCharacterIterator::setText(const UChar* newText, +void UCharCharacterIterator::setText(ConstChar16Ptr newText, int32_t newTextLength) { text = newText; if(newText == 0 || newTextLength < 0) { diff --git a/deps/icu-small/source/common/ucln.h b/deps/icu-small/source/common/ucln.h index 3c8c66ad2f39e5..fe6666efed3f18 100644 --- a/deps/icu-small/source/common/ucln.h +++ b/deps/icu-small/source/common/ucln.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucln.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucln_cmn.cpp b/deps/icu-small/source/common/ucln_cmn.cpp index 657ec337d7e041..7e541a1a5f0f3b 100644 --- a/deps/icu-small/source/common/ucln_cmn.cpp +++ b/deps/icu-small/source/common/ucln_cmn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: ucln_cmn.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucln_cmn.h b/deps/icu-small/source/common/ucln_cmn.h index 56fa73053f5c0c..5db94945172c3d 100644 --- a/deps/icu-small/source/common/ucln_cmn.h +++ b/deps/icu-small/source/common/ucln_cmn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: ucln_cmn.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -35,7 +35,7 @@ typedef enum ECleanupCommonType { UCLN_COMMON_START = -1, UCLN_COMMON_USPREP, UCLN_COMMON_BREAKITERATOR, - UCLN_COMMON_BREAKITERATOR_DICT, + UCLN_COMMON_RBBI, UCLN_COMMON_SERVICE, UCLN_COMMON_LOCALE_KEY_TYPE, UCLN_COMMON_LOCALE, diff --git a/deps/icu-small/source/common/ucln_imp.h b/deps/icu-small/source/common/ucln_imp.h index 5aa5b0d19f3aab..2e985669793b82 100644 --- a/deps/icu-small/source/common/ucln_imp.h +++ b/deps/icu-small/source/common/ucln_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucln_imp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -121,7 +121,9 @@ U_CAPI void U_EXPORT2 UCLN_FINI () /* READ READ READ READ! Are you getting compilation errors from windows.h? Any source file which includes this (ucln_imp.h) header MUST be defined with language extensions ON. */ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE diff --git a/deps/icu-small/source/common/ucmndata.c b/deps/icu-small/source/common/ucmndata.cpp similarity index 97% rename from deps/icu-small/source/common/ucmndata.c rename to deps/icu-small/source/common/ucmndata.cpp index 6b7d78d104d186..251c7ba1823887 100644 --- a/deps/icu-small/source/common/ucmndata.c +++ b/deps/icu-small/source/common/ucmndata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -207,7 +207,9 @@ pointerTOCPrefixBinarySearch(const char *s, const PointerTOCEntry *toc, int32_t return -1; } -static uint32_t offsetTOCEntryCount(const UDataMemory *pData) { +U_CDECL_BEGIN +static uint32_t U_CALLCONV +offsetTOCEntryCount(const UDataMemory *pData) { int32_t retVal=0; const UDataOffsetTOC *toc = (UDataOffsetTOC *)pData->toc; if (toc != NULL) { @@ -216,11 +218,12 @@ static uint32_t offsetTOCEntryCount(const UDataMemory *pData) { return retVal; } -static const DataHeader * +static const DataHeader * U_CALLCONV offsetTOCLookupFn(const UDataMemory *pData, const char *tocEntryName, int32_t *pLength, UErrorCode *pErrorCode) { + (void)pErrorCode; const UDataOffsetTOC *toc = (UDataOffsetTOC *)pData->toc; if(toc!=NULL) { const char *base=(const char *)toc; @@ -262,16 +265,16 @@ offsetTOCLookupFn(const UDataMemory *pData, } -static uint32_t pointerTOCEntryCount(const UDataMemory *pData) { +static uint32_t U_CALLCONV pointerTOCEntryCount(const UDataMemory *pData) { const PointerTOC *toc = (PointerTOC *)pData->toc; return (uint32_t)((toc != NULL) ? (toc->count) : 0); } - -static const DataHeader *pointerTOCLookupFn(const UDataMemory *pData, +static const DataHeader * U_CALLCONV pointerTOCLookupFn(const UDataMemory *pData, const char *name, int32_t *pLength, UErrorCode *pErrorCode) { + (void)pErrorCode; if(pData->toc!=NULL) { const PointerTOC *toc = (PointerTOC *)pData->toc; int32_t number, count=(int32_t)toc->count; @@ -300,6 +303,8 @@ static const DataHeader *pointerTOCLookupFn(const UDataMemory *pData, return pData->pHeader; } } +U_CDECL_END + static const commonDataFuncs CmnDFuncs = {offsetTOCLookupFn, offsetTOCEntryCount}; static const commonDataFuncs ToCPFuncs = {pointerTOCLookupFn, pointerTOCEntryCount}; diff --git a/deps/icu-small/source/common/ucmndata.h b/deps/icu-small/source/common/ucmndata.h index 4ff37cc20b0576..8c36897f16f200 100644 --- a/deps/icu-small/source/common/ucmndata.h +++ b/deps/icu-small/source/common/ucmndata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/ucnv.c b/deps/icu-small/source/common/ucnv.cpp similarity index 99% rename from deps/icu-small/source/common/ucnv.c rename to deps/icu-small/source/common/ucnv.cpp index 7ce05644c7ec9f..39ea5dfa6636f5 100644 --- a/deps/icu-small/source/common/ucnv.c +++ b/deps/icu-small/source/common/ucnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/ucnv2022.cpp b/deps/icu-small/source/common/ucnv2022.cpp index d1d947f93c4ac3..1b625ea06c2649 100644 --- a/deps/icu-small/source/common/ucnv2022.cpp +++ b/deps/icu-small/source/common/ucnv2022.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv2022.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucnv_bld.cpp b/deps/icu-small/source/common/ucnv_bld.cpp index bfbb45a7d1c911..482034fd0c1b03 100644 --- a/deps/icu-small/source/common/ucnv_bld.cpp +++ b/deps/icu-small/source/common/ucnv_bld.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************** diff --git a/deps/icu-small/source/common/ucnv_bld.h b/deps/icu-small/source/common/ucnv_bld.h index aeb858c9d50cba..16dd14408a7504 100644 --- a/deps/icu-small/source/common/ucnv_bld.h +++ b/deps/icu-small/source/common/ucnv_bld.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ucnv_cb.c b/deps/icu-small/source/common/ucnv_cb.cpp similarity index 99% rename from deps/icu-small/source/common/ucnv_cb.c rename to deps/icu-small/source/common/ucnv_cb.cpp index 0c9cc2459f1844..1bb001201491aa 100644 --- a/deps/icu-small/source/common/ucnv_cb.c +++ b/deps/icu-small/source/common/ucnv_cb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ucnv_cnv.c b/deps/icu-small/source/common/ucnv_cnv.cpp similarity index 96% rename from deps/icu-small/source/common/ucnv_cnv.c rename to deps/icu-small/source/common/ucnv_cnv.cpp index 01f84829dd3f7d..ea71acf92c7ae7 100644 --- a/deps/icu-small/source/common/ucnv_cnv.c +++ b/deps/icu-small/source/common/ucnv_cnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -33,6 +33,9 @@ ucnv_getCompleteUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, UErrorCode *pErrorCode) { + (void)cnv; + (void)which; + (void)pErrorCode; sa->addRange(sa->set, 0, 0x10ffff); } @@ -41,6 +44,9 @@ ucnv_getNonSurrogateUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, UErrorCode *pErrorCode) { + (void)cnv; + (void)which; + (void)pErrorCode; sa->addRange(sa->set, 0, 0xd7ff); sa->addRange(sa->set, 0xe000, 0x10ffff); } diff --git a/deps/icu-small/source/common/ucnv_cnv.h b/deps/icu-small/source/common/ucnv_cnv.h index 48978130775a36..a996e2959784cf 100644 --- a/deps/icu-small/source/common/ucnv_cnv.h +++ b/deps/icu-small/source/common/ucnv_cnv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ucnv_ct.c b/deps/icu-small/source/common/ucnv_ct.cpp similarity index 97% rename from deps/icu-small/source/common/ucnv_ct.c rename to deps/icu-small/source/common/ucnv_ct.cpp index f76919c4a54f30..51e31aa4116bd3 100644 --- a/deps/icu-small/source/common/ucnv_ct.c +++ b/deps/icu-small/source/common/ucnv_ct.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_ct.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -165,16 +165,17 @@ typedef struct{ } UConverterDataCompoundText; /*********** Compound Text Converter Protos ***********/ -static void +U_CDECL_BEGIN +static void U_CALLCONV _CompoundTextOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode); -static void +static void U_CALLCONV _CompoundTextClose(UConverter *converter); -static void +static void U_CALLCONV _CompoundTextReset(UConverter *converter, UConverterResetChoice choice); -static const char* +static const char* U_CALLCONV _CompoundTextgetName(const UConverter* cnv); @@ -257,14 +258,14 @@ static COMPOUND_TEXT_CONVERTERS findStateFromEscSeq(const char* source, const ch return state; } -static void +static void U_CALLCONV _CompoundTextOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){ cnv->extraInfo = uprv_malloc (sizeof (UConverterDataCompoundText)); if (cnv->extraInfo != NULL) { UConverterDataCompoundText *myConverterData = (UConverterDataCompoundText *) cnv->extraInfo; UConverterNamePieces stackPieces; - UConverterLoadArgs stackArgs={ (int32_t)sizeof(UConverterLoadArgs) }; + UConverterLoadArgs stackArgs=UCNV_LOAD_ARGS_INITIALIZER; myConverterData->myConverterArray[COMPOUND_TEXT_SINGLE_0] = NULL; myConverterData->myConverterArray[COMPOUND_TEXT_SINGLE_1] = ucnv_loadSharedData("icu-internal-compound-s1", &stackPieces, &stackArgs, errorCode); @@ -300,7 +301,7 @@ _CompoundTextOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorC } -static void +static void U_CALLCONV _CompoundTextClose(UConverter *converter) { UConverterDataCompoundText* myConverterData = (UConverterDataCompoundText*)(converter->extraInfo); int32_t i; @@ -314,19 +315,23 @@ _CompoundTextClose(UConverter *converter) { } uprv_free(converter->extraInfo); + converter->extraInfo = NULL; } } -static void +static void U_CALLCONV _CompoundTextReset(UConverter *converter, UConverterResetChoice choice) { + (void)converter; + (void)choice; } -static const char* +static const char* U_CALLCONV _CompoundTextgetName(const UConverter* cnv){ + (void)cnv; return "x11-compound-text"; } -static void +static void U_CALLCONV UConverter_fromUnicode_CompoundText_OFFSETS(UConverterFromUnicodeArgs* args, UErrorCode* err){ UConverter *cnv = args->converter; uint8_t *target = (uint8_t *) args->target; @@ -458,7 +463,7 @@ UConverter_fromUnicode_CompoundText_OFFSETS(UConverterFromUnicodeArgs* args, UEr } -static void +static void U_CALLCONV UConverter_toUnicode_CompoundText_OFFSETS(UConverterToUnicodeArgs *args, UErrorCode* err){ const char *mySource = (char *) args->source; @@ -515,7 +520,7 @@ UConverter_toUnicode_CompoundText_OFFSETS(UConverterToUnicodeArgs *args, currentState = tmpState; } - sourceOffset = uprv_strlen((char*)escSeqCompoundText[currentState]) - args->converter->toULength; + sourceOffset = static_cast(uprv_strlen((char*)escSeqCompoundText[currentState]) - args->converter->toULength); mySource += sourceOffset; @@ -574,7 +579,7 @@ UConverter_toUnicode_CompoundText_OFFSETS(UConverterToUnicodeArgs *args, args->source = mySource; } -static void +static void U_CALLCONV _CompoundText_GetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, @@ -591,6 +596,7 @@ _CompoundText_GetUnicodeSet(const UConverter *cnv, sa->addRange(sa->set, 0x0020, 0x007F); sa->addRange(sa->set, 0x00A0, 0x00FF); } +U_CDECL_END static const UConverterImpl _CompoundTextImpl = { @@ -613,8 +619,11 @@ static const UConverterImpl _CompoundTextImpl = { _CompoundTextgetName, NULL, NULL, - _CompoundText_GetUnicodeSet + _CompoundText_GetUnicodeSet, + NULL, + NULL }; + static const UConverterStaticData _CompoundTextStaticData = { sizeof(UConverterStaticData), "COMPOUND_TEXT", diff --git a/deps/icu-small/source/common/ucnv_err.c b/deps/icu-small/source/common/ucnv_err.cpp similarity index 97% rename from deps/icu-small/source/common/ucnv_err.c rename to deps/icu-small/source/common/ucnv_err.cpp index 449b162152e61e..18218835a2260e 100644 --- a/deps/icu-small/source/common/ucnv_err.c +++ b/deps/icu-small/source/common/ucnv_err.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** @@ -107,6 +107,10 @@ UCNV_FROM_U_CALLBACK_STOP ( UConverterCallbackReason reason, UErrorCode * err) { + (void)context; + (void)fromUArgs; + (void)codeUnits; + (void)length; if (reason == UCNV_UNASSIGNED && IS_DEFAULT_IGNORABLE_CODE_POINT(codePoint)) { /* @@ -130,6 +134,7 @@ UCNV_TO_U_CALLBACK_STOP ( UErrorCode * err) { /* the caller must have set the error code accordingly */ + (void)context; (void)toUArgs; (void)codePoints; (void)length; (void)reason; (void)err; return; } @@ -143,6 +148,9 @@ UCNV_FROM_U_CALLBACK_SKIP ( UConverterCallbackReason reason, UErrorCode * err) { + (void)fromUArgs; + (void)codeUnits; + (void)length; if (reason <= UCNV_IRREGULAR) { if (reason == UCNV_UNASSIGNED && IS_DEFAULT_IGNORABLE_CODE_POINT(codePoint)) @@ -171,6 +179,8 @@ UCNV_FROM_U_CALLBACK_SUBSTITUTE ( UConverterCallbackReason reason, UErrorCode * err) { + (void)codeUnits; + (void)length; if (reason <= UCNV_IRREGULAR) { if (reason == UCNV_UNASSIGNED && IS_DEFAULT_IGNORABLE_CODE_POINT(codePoint)) @@ -368,6 +378,9 @@ UCNV_TO_U_CALLBACK_SKIP ( UConverterCallbackReason reason, UErrorCode * err) { + (void)toArgs; + (void)codeUnits; + (void)length; if (reason <= UCNV_IRREGULAR) { if (context == NULL || (*((char*)context) == UCNV_PRV_STOP_ON_ILLEGAL && reason == UCNV_UNASSIGNED)) @@ -388,6 +401,8 @@ UCNV_TO_U_CALLBACK_SUBSTITUTE ( UConverterCallbackReason reason, UErrorCode * err) { + (void)codeUnits; + (void)length; if (reason <= UCNV_IRREGULAR) { if (context == NULL || (*((char*)context) == UCNV_PRV_STOP_ON_ILLEGAL && reason == UCNV_UNASSIGNED)) diff --git a/deps/icu-small/source/common/ucnv_ext.cpp b/deps/icu-small/source/common/ucnv_ext.cpp index f8605187240159..7dea4eef41a408 100644 --- a/deps/icu-small/source/common/ucnv_ext.cpp +++ b/deps/icu-small/source/common/ucnv_ext.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucnv_ext.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -23,6 +23,7 @@ #if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_LEGACY_CONVERSION #include "unicode/uset.h" +#include "unicode/ustring.h" #include "ucnv_bld.h" #include "ucnv_cnv.h" #include "ucnv_ext.h" diff --git a/deps/icu-small/source/common/ucnv_ext.h b/deps/icu-small/source/common/ucnv_ext.h index e2ce7fa07293c4..7b753ac217d8d5 100644 --- a/deps/icu-small/source/common/ucnv_ext.h +++ b/deps/icu-small/source/common/ucnv_ext.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucnv_ext.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucnv_imp.h b/deps/icu-small/source/common/ucnv_imp.h index 81aa80fd272409..c5e6aeb47e48d8 100644 --- a/deps/icu-small/source/common/ucnv_imp.h +++ b/deps/icu-small/source/common/ucnv_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ucnv_io.cpp b/deps/icu-small/source/common/ucnv_io.cpp index eaa08e47cd82cc..d9e91314ed5347 100644 --- a/deps/icu-small/source/common/ucnv_io.cpp +++ b/deps/icu-small/source/common/ucnv_io.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/ucnv_io.h b/deps/icu-small/source/common/ucnv_io.h index 8b3585786d3238..8f2d7b5a02bbfa 100644 --- a/deps/icu-small/source/common/ucnv_io.h +++ b/deps/icu-small/source/common/ucnv_io.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ucnv_lmb.c b/deps/icu-small/source/common/ucnv_lmb.cpp similarity index 98% rename from deps/icu-small/source/common/ucnv_lmb.c rename to deps/icu-small/source/common/ucnv_lmb.cpp index e595f931a08c09..6dd8e83428a0af 100644 --- a/deps/icu-small/source/common/ucnv_lmb.c +++ b/deps/icu-small/source/common/ucnv_lmb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_lmb.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 4 (not used) * indentation:4 * @@ -582,7 +582,9 @@ typedef struct } UConverterDataLMBCS; -static void _LMBCSClose(UConverter * _this); +U_CDECL_BEGIN +static void U_CALLCONV _LMBCSClose(UConverter * _this); +U_CDECL_END #define DECLARE_LMBCS_DATA(n) \ static const UConverterImpl _LMBCSImpl##n={\ @@ -600,7 +602,9 @@ static const UConverterImpl _LMBCSImpl##n={\ NULL,\ NULL,\ _LMBCSSafeClone,\ - ucnv_getCompleteUnicodeSet\ + ucnv_getCompleteUnicodeSet,\ + NULL,\ + NULL\ };\ static const UConverterStaticData _LMBCSStaticData##n={\ sizeof(UConverterStaticData),\ @@ -616,7 +620,7 @@ function, which will do basically the same thing except set a different optimization group. So, we put the common stuff into a worker function, and set up another macro to stamp out the 12 open functions:*/ #define DEFINE_LMBCS_OPEN(n) \ -static void \ +static void U_CALLCONV \ _LMBCSOpen##n(UConverter* _this, UConverterLoadArgs* pArgs, UErrorCode* err) \ { _LMBCSOpenWorker(_this, pArgs, err, n); } @@ -629,12 +633,12 @@ _LMBCSOpenWorker(UConverter* _this, UErrorCode* err, ulmbcs_byte_t OptGroup) { - UConverterDataLMBCS * extraInfo = _this->extraInfo = - (UConverterDataLMBCS*)uprv_malloc (sizeof (UConverterDataLMBCS)); + UConverterDataLMBCS * extraInfo = (UConverterDataLMBCS*)uprv_malloc (sizeof (UConverterDataLMBCS)); + _this->extraInfo = extraInfo; if(extraInfo != NULL) { UConverterNamePieces stackPieces; - UConverterLoadArgs stackArgs={ (int32_t)sizeof(UConverterLoadArgs) }; + UConverterLoadArgs stackArgs= UCNV_LOAD_ARGS_INITIALIZER; ulmbcs_byte_t i; uprv_memset(extraInfo, 0, sizeof(UConverterDataLMBCS)); @@ -661,7 +665,8 @@ _LMBCSOpenWorker(UConverter* _this, } } -static void +U_CDECL_BEGIN +static void U_CALLCONV _LMBCSClose(UConverter * _this) { if (_this->extraInfo != NULL) @@ -686,11 +691,12 @@ typedef struct LMBCSClone { UConverterDataLMBCS lmbcs; } LMBCSClone; -static UConverter * +static UConverter * U_CALLCONV _LMBCSSafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status) { + (void)status; LMBCSClone *newLMBCS; UConverterDataLMBCS *extraInfo; int32_t i; @@ -842,7 +848,7 @@ LMBCSConvertUni(ulmbcs_byte_t * pLMBCS, UChar uniChar) /* The main Unicode to LMBCS conversion function */ -static void +static void U_CALLCONV _LMBCSFromUnicode(UConverterFromUnicodeArgs* args, UErrorCode* err) { @@ -960,26 +966,26 @@ _LMBCSFromUnicode(UConverterFromUnicodeArgs* args, if(extraInfo->localeConverterIndex < ULMBCS_DOUBLEOPTGROUP_START) { - bytes_written = LMBCSConversionWorker (extraInfo, + bytes_written = (int32_t)LMBCSConversionWorker (extraInfo, ULMBCS_GRP_L1, pLMBCS, &uniChar, &lastConverterIndex, groups_tried); if(!bytes_written) { - bytes_written = LMBCSConversionWorker (extraInfo, + bytes_written = (int32_t)LMBCSConversionWorker (extraInfo, ULMBCS_GRP_EXCEPT, pLMBCS, &uniChar, &lastConverterIndex, groups_tried); } if(!bytes_written) { - bytes_written = LMBCSConversionWorker (extraInfo, + bytes_written = (int32_t)LMBCSConversionWorker (extraInfo, extraInfo->localeConverterIndex, pLMBCS, &uniChar, &lastConverterIndex, groups_tried); } } else { - bytes_written = LMBCSConversionWorker (extraInfo, + bytes_written = (int32_t)LMBCSConversionWorker (extraInfo, extraInfo->localeConverterIndex, pLMBCS, &uniChar, &lastConverterIndex, groups_tried); } @@ -1109,7 +1115,7 @@ GetUniFromLMBCSUni(char const ** ppLMBCSin) /* Called with LMBCS-style Unicode /* Return the Unicode representation for the current LMBCS character */ -static UChar32 +static UChar32 U_CALLCONV _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args, UErrorCode* err) { @@ -1251,7 +1257,7 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args, /* The exported function that converts lmbcs to one or more UChars - currently UTF-16 */ -static void +static void U_CALLCONV _LMBCSToUnicodeWithOffsets(UConverterToUnicodeArgs* args, UErrorCode* err) { @@ -1375,4 +1381,6 @@ DECLARE_LMBCS_DATA(17) DECLARE_LMBCS_DATA(18) DECLARE_LMBCS_DATA(19) +U_CDECL_END + #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ diff --git a/deps/icu-small/source/common/ucnv_set.c b/deps/icu-small/source/common/ucnv_set.cpp similarity index 95% rename from deps/icu-small/source/common/ucnv_set.c rename to deps/icu-small/source/common/ucnv_set.cpp index c3933ab6109cbf..926cee0de810ea 100644 --- a/deps/icu-small/source/common/ucnv_set.c +++ b/deps/icu-small/source/common/ucnv_set.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucnv_set.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucnv_u16.c b/deps/icu-small/source/common/ucnv_u16.cpp similarity index 97% rename from deps/icu-small/source/common/ucnv_u16.c rename to deps/icu-small/source/common/ucnv_u16.cpp index d8f4576f33763f..a289fd4acfac1a 100644 --- a/deps/icu-small/source/common/ucnv_u16.c +++ b/deps/icu-small/source/common/ucnv_u16.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u16.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -21,6 +21,7 @@ #if !UCONFIG_NO_CONVERSION #include "unicode/ucnv.h" +#include "unicode/uversion.h" #include "ucnv_bld.h" #include "ucnv_cnv.h" #include "cmemory.h" @@ -29,11 +30,12 @@ enum { UCNV_NEED_TO_WRITE_BOM=1 }; +U_CDECL_BEGIN /* * The UTF-16 toUnicode implementation is also used for the Java-specific * "with BOM" variants of UTF-16BE and UTF-16LE. */ -static void +static void U_CALLCONV _UTF16ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode); @@ -46,7 +48,7 @@ _UTF16ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, #endif -static void +static void U_CALLCONV _UTF16BEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -250,7 +252,7 @@ _UTF16BEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, pArgs->offsets=offsets; } -static void +static void U_CALLCONV _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -488,7 +490,7 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, pArgs->offsets=offsets; } -static UChar32 +static UChar32 U_CALLCONV _UTF16BEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { const uint8_t *s, *sourceLimit; UChar32 c; @@ -567,7 +569,7 @@ _UTF16BEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { return c; } -static void +static void U_CALLCONV _UTF16BEReset(UConverter *cnv, UConverterResetChoice choice) { if(choice<=UCNV_RESET_TO_UNICODE) { /* reset toUnicode state */ @@ -583,10 +585,11 @@ _UTF16BEReset(UConverter *cnv, UConverterResetChoice choice) { } } -static void +static void U_CALLCONV _UTF16BEOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { + (void)pArgs; if(UCNV_GET_VERSION(cnv)<=1) { _UTF16BEReset(cnv, UCNV_RESET_BOTH); } else { @@ -594,7 +597,7 @@ _UTF16BEOpen(UConverter *cnv, } } -static const char * +static const char * U_CALLCONV _UTF16BEGetName(const UConverter *cnv) { if(UCNV_GET_VERSION(cnv)==0) { return "UTF-16BE"; @@ -602,6 +605,7 @@ _UTF16BEGetName(const UConverter *cnv) { return "UTF-16BE,version=1"; } } +U_CDECL_END static const UConverterImpl _UTF16BEImpl={ UCNV_UTF16_BigEndian, @@ -644,8 +648,8 @@ const UConverterSharedData _UTF16BEData= UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_UTF16BEStaticData, &_UTF16BEImpl); /* UTF-16LE ----------------------------------------------------------------- */ - -static void +U_CDECL_BEGIN +static void U_CALLCONV _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -849,7 +853,7 @@ _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, pArgs->offsets=offsets; } -static void +static void U_CALLCONV _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -1087,7 +1091,7 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, pArgs->offsets=offsets; } -static UChar32 +static UChar32 U_CALLCONV _UTF16LEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { const uint8_t *s, *sourceLimit; UChar32 c; @@ -1166,7 +1170,7 @@ _UTF16LEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { return c; } -static void +static void U_CALLCONV _UTF16LEReset(UConverter *cnv, UConverterResetChoice choice) { if(choice<=UCNV_RESET_TO_UNICODE) { /* reset toUnicode state */ @@ -1182,10 +1186,11 @@ _UTF16LEReset(UConverter *cnv, UConverterResetChoice choice) { } } -static void +static void U_CALLCONV _UTF16LEOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { + (void)pArgs; if(UCNV_GET_VERSION(cnv)<=1) { _UTF16LEReset(cnv, UCNV_RESET_BOTH); } else { @@ -1193,7 +1198,7 @@ _UTF16LEOpen(UConverter *cnv, } } -static const char * +static const char * U_CALLCONV _UTF16LEGetName(const UConverter *cnv) { if(UCNV_GET_VERSION(cnv)==0) { return "UTF-16LE"; @@ -1201,6 +1206,7 @@ _UTF16LEGetName(const UConverter *cnv) { return "UTF-16LE,version=1"; } } +U_CDECL_END static const UConverterImpl _UTF16LEImpl={ UCNV_UTF16_LittleEndian, @@ -1268,8 +1274,8 @@ const UConverterSharedData _UTF16LEData= * - UTF-16BE,version=1 (Java "UnicodeBig" encoding) and * UTF-16LE,version=1 (Java "UnicodeLittle" encoding) treat a reverse BOM as an error. */ - -static void +U_CDECL_BEGIN +static void U_CALLCONV _UTF16Reset(UConverter *cnv, UConverterResetChoice choice) { if(choice<=UCNV_RESET_TO_UNICODE) { /* reset toUnicode: state=0 */ @@ -1280,10 +1286,10 @@ _UTF16Reset(UConverter *cnv, UConverterResetChoice choice) { cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM; } } - -static const UConverterSharedData _UTF16v2Data; - -static void +U_CDECL_END +extern const UConverterSharedData _UTF16v2Data; +U_CDECL_BEGIN +static void U_CALLCONV _UTF16Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { @@ -1304,7 +1310,7 @@ _UTF16Open(UConverter *cnv, } } -static const char * +static const char * U_CALLCONV _UTF16GetName(const UConverter *cnv) { if(UCNV_GET_VERSION(cnv)==0) { return "UTF-16"; @@ -1314,14 +1320,23 @@ _UTF16GetName(const UConverter *cnv) { return "UTF-16,version=2"; } } +U_CDECL_END +extern const UConverterSharedData _UTF16Data; -const UConverterSharedData _UTF16Data; +static inline bool IS_UTF16BE(const UConverter *cnv) { + return ((cnv)->sharedData == &_UTF16BEData); +} + +static inline bool IS_UTF16LE(const UConverter *cnv) { + return ((cnv)->sharedData == &_UTF16LEData); +} -#define IS_UTF16BE(cnv) ((cnv)->sharedData==&_UTF16BEData) -#define IS_UTF16LE(cnv) ((cnv)->sharedData==&_UTF16LEData) -#define IS_UTF16(cnv) ((cnv)->sharedData==&_UTF16Data || (cnv)->sharedData==&_UTF16v2Data) +static inline bool IS_UTF16(const UConverter *cnv) { + return ((cnv)->sharedData==&_UTF16Data) || ((cnv)->sharedData == &_UTF16v2Data); +} -static void +U_CDECL_BEGIN +static void U_CALLCONV _UTF16ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv=pArgs->converter; @@ -1461,7 +1476,7 @@ _UTF16ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, cnv->mode=state; } -static UChar32 +static UChar32 U_CALLCONV _UTF16GetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { switch(pArgs->converter->mode) { @@ -1473,6 +1488,7 @@ _UTF16GetNextUChar(UConverterToUnicodeArgs *pArgs, return UCNV_GET_NEXT_UCHAR_USE_TO_U; } } +U_CDECL_END static const UConverterImpl _UTF16Impl = { UCNV_UTF16, @@ -1557,7 +1573,7 @@ static const UConverterStaticData _UTF16v2StaticData = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */ }; -static const UConverterSharedData _UTF16v2Data = +const UConverterSharedData _UTF16v2Data = UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_UTF16v2StaticData, &_UTF16v2Impl); #endif diff --git a/deps/icu-small/source/common/ucnv_u32.c b/deps/icu-small/source/common/ucnv_u32.cpp similarity index 98% rename from deps/icu-small/source/common/ucnv_u32.c rename to deps/icu-small/source/common/ucnv_u32.cpp index fa74b85c93c3b8..3fac04b300ed34 100644 --- a/deps/icu-small/source/common/ucnv_u32.c +++ b/deps/icu-small/source/common/ucnv_u32.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u32.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -42,8 +42,8 @@ enum { }; /* UTF-32BE ----------------------------------------------------------------- */ - -static void +U_CDECL_BEGIN +static void U_CALLCONV T_UConverter_toUnicode_UTF32_BE(UConverterToUnicodeArgs * args, UErrorCode * err) { @@ -122,7 +122,7 @@ T_UConverter_toUnicode_UTF32_BE(UConverterToUnicodeArgs * args, args->source = (const char *) mySource; } -static void +static void U_CALLCONV T_UConverter_toUnicode_UTF32_BE_OFFSET_LOGIC(UConverterToUnicodeArgs * args, UErrorCode * err) { @@ -209,7 +209,7 @@ T_UConverter_toUnicode_UTF32_BE_OFFSET_LOGIC(UConverterToUnicodeArgs * args, args->offsets = myOffsets; } -static void +static void U_CALLCONV T_UConverter_fromUnicode_UTF32_BE(UConverterFromUnicodeArgs * args, UErrorCode * err) { @@ -310,7 +310,7 @@ T_UConverter_fromUnicode_UTF32_BE(UConverterFromUnicodeArgs * args, args->source = mySource; } -static void +static void U_CALLCONV T_UConverter_fromUnicode_UTF32_BE_OFFSET_LOGIC(UConverterFromUnicodeArgs * args, UErrorCode * err) { @@ -417,7 +417,7 @@ T_UConverter_fromUnicode_UTF32_BE_OFFSET_LOGIC(UConverterFromUnicodeArgs * args, args->offsets = myOffsets; } -static UChar32 +static UChar32 U_CALLCONV T_UConverter_getNextUChar_UTF32_BE(UConverterToUnicodeArgs* args, UErrorCode* err) { @@ -461,7 +461,7 @@ T_UConverter_getNextUChar_UTF32_BE(UConverterToUnicodeArgs* args, *err = U_ILLEGAL_CHAR_FOUND; return 0xffff; } - +U_CDECL_END static const UConverterImpl _UTF32BEImpl = { UCNV_UTF32_BigEndian, @@ -504,8 +504,8 @@ const UConverterSharedData _UTF32BEData = UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_UTF32BEStaticData, &_UTF32BEImpl); /* UTF-32LE ---------------------------------------------------------- */ - -static void +U_CDECL_BEGIN +static void U_CALLCONV T_UConverter_toUnicode_UTF32_LE(UConverterToUnicodeArgs * args, UErrorCode * err) { @@ -590,7 +590,7 @@ T_UConverter_toUnicode_UTF32_LE(UConverterToUnicodeArgs * args, args->source = (const char *) mySource; } -static void +static void U_CALLCONV T_UConverter_toUnicode_UTF32_LE_OFFSET_LOGIC(UConverterToUnicodeArgs * args, UErrorCode * err) { @@ -687,7 +687,7 @@ T_UConverter_toUnicode_UTF32_LE_OFFSET_LOGIC(UConverterToUnicodeArgs * args, args->offsets = myOffsets; } -static void +static void U_CALLCONV T_UConverter_fromUnicode_UTF32_LE(UConverterFromUnicodeArgs * args, UErrorCode * err) { @@ -796,7 +796,7 @@ T_UConverter_fromUnicode_UTF32_LE(UConverterFromUnicodeArgs * args, args->source = mySource; } -static void +static void U_CALLCONV T_UConverter_fromUnicode_UTF32_LE_OFFSET_LOGIC(UConverterFromUnicodeArgs * args, UErrorCode * err) { @@ -912,7 +912,7 @@ T_UConverter_fromUnicode_UTF32_LE_OFFSET_LOGIC(UConverterFromUnicodeArgs * args, args->offsets = myOffsets; } -static UChar32 +static UChar32 U_CALLCONV T_UConverter_getNextUChar_UTF32_LE(UConverterToUnicodeArgs* args, UErrorCode* err) { @@ -956,7 +956,7 @@ T_UConverter_getNextUChar_UTF32_LE(UConverterToUnicodeArgs* args, *err = U_ILLEGAL_CHAR_FOUND; return 0xffff; } - +U_CDECL_END static const UConverterImpl _UTF32LEImpl = { UCNV_UTF32_LittleEndian, @@ -1021,8 +1021,8 @@ const UConverterSharedData _UTF32LEData = * * On output, emit U+FEFF as the first code point. */ - -static void +U_CDECL_BEGIN +static void U_CALLCONV _UTF32Reset(UConverter *cnv, UConverterResetChoice choice) { if(choice<=UCNV_RESET_TO_UNICODE) { /* reset toUnicode: state=0 */ @@ -1034,16 +1034,18 @@ _UTF32Reset(UConverter *cnv, UConverterResetChoice choice) { } } -static void +static void U_CALLCONV _UTF32Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { + (void)pArgs; + (void)pErrorCode; _UTF32Reset(cnv, UCNV_RESET_BOTH); } static const char utf32BOM[8]={ 0, 0, (char)0xfe, (char)0xff, (char)0xff, (char)0xfe, 0, 0 }; -static void +static void U_CALLCONV _UTF32ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv=pArgs->converter; @@ -1184,7 +1186,7 @@ _UTF32ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, cnv->mode=state; } -static UChar32 +static UChar32 U_CALLCONV _UTF32GetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { switch(pArgs->converter->mode) { @@ -1196,7 +1198,7 @@ _UTF32GetNextUChar(UConverterToUnicodeArgs *pArgs, return UCNV_GET_NEXT_UCHAR_USE_TO_U; } } - +U_CDECL_END static const UConverterImpl _UTF32Impl = { UCNV_UTF32, diff --git a/deps/icu-small/source/common/ucnv_u7.c b/deps/icu-small/source/common/ucnv_u7.cpp similarity index 99% rename from deps/icu-small/source/common/ucnv_u7.c rename to deps/icu-small/source/common/ucnv_u7.cpp index 3c1d240ed89d6d..ec7befe9fc9a78 100644 --- a/deps/icu-small/source/common/ucnv_u7.c +++ b/deps/icu-small/source/common/ucnv_u7.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u7.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -179,7 +179,8 @@ fromBase64[128]={ * */ -static void +U_CDECL_BEGIN +static void U_CALLCONV _UTF7Reset(UConverter *cnv, UConverterResetChoice choice) { if(choice<=UCNV_RESET_TO_UNICODE) { /* reset toUnicode */ @@ -192,10 +193,11 @@ _UTF7Reset(UConverter *cnv, UConverterResetChoice choice) { } } -static void +static void U_CALLCONV _UTF7Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { + (void)pArgs; if(UCNV_GET_VERSION(cnv)<=1) { /* TODO(markus): Should just use cnv->options rather than copying the version number. */ cnv->fromUnicodeStatus=UCNV_GET_VERSION(cnv)<<28; @@ -205,7 +207,7 @@ _UTF7Open(UConverter *cnv, } } -static void +static void U_CALLCONV _UTF7ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -456,7 +458,7 @@ _UTF7ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, return; } -static void +static void U_CALLCONV _UTF7FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -732,7 +734,7 @@ _UTF7FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, return; } -static const char * +static const char * U_CALLCONV _UTF7GetName(const UConverter *cnv) { switch(cnv->fromUnicodeStatus>>28) { case 1: @@ -741,6 +743,7 @@ _UTF7GetName(const UConverter *cnv) { return "UTF-7"; } } +U_CDECL_END static const UConverterImpl _UTF7Impl={ UCNV_UTF7, @@ -887,7 +890,8 @@ const UConverterSharedData _UTF7Data= * ignore bits 31..25 */ -static void +U_CDECL_BEGIN +static void U_CALLCONV _IMAPToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -1155,7 +1159,7 @@ _IMAPToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, return; } -static void +static void U_CALLCONV _IMAPFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -1441,6 +1445,7 @@ _IMAPFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, pArgs->offsets=offsets; return; } +U_CDECL_END static const UConverterImpl _IMAPImpl={ UCNV_IMAP_MAILBOX, @@ -1462,7 +1467,9 @@ static const UConverterImpl _IMAPImpl={ NULL, NULL, /* we don't need writeSub() because we never call a callback at fromUnicode() */ NULL, - ucnv_getCompleteUnicodeSet + ucnv_getCompleteUnicodeSet, + NULL, + NULL }; static const UConverterStaticData _IMAPStaticData={ diff --git a/deps/icu-small/source/common/ucnv_u8.c b/deps/icu-small/source/common/ucnv_u8.cpp similarity index 72% rename from deps/icu-small/source/common/ucnv_u8.c rename to deps/icu-small/source/common/ucnv_u8.cpp index ff73993bd629ef..c7ef87fd500c62 100644 --- a/deps/icu-small/source/common/ucnv_u8.c +++ b/deps/icu-small/source/common/ucnv_u8.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u8.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -28,9 +28,11 @@ #include "unicode/utf.h" #include "unicode/utf8.h" #include "unicode/utf16.h" +#include "uassert.h" #include "ucnv_bld.h" #include "ucnv_cnv.h" #include "cmemory.h" +#include "ustr_imp.h" /* Prototypes --------------------------------------------------------------- */ @@ -44,51 +46,13 @@ U_CFUNC void ucnv_fromUnicode_UTF8_OFFSETS_LOGIC(UConverterFromUnicodeArgs *args /* UTF-8 -------------------------------------------------------------------- */ -/* UTF-8 Conversion DATA - * for more information see Unicode Standard 2.0, Transformation Formats Appendix A-9 - */ -/*static const uint32_t REPLACEMENT_CHARACTER = 0x0000FFFD;*/ #define MAXIMUM_UCS2 0x0000FFFF -#define MAXIMUM_UTF 0x0010FFFF -#define MAXIMUM_UCS4 0x7FFFFFFF -#define HALF_SHIFT 10 -#define HALF_BASE 0x0010000 -#define HALF_MASK 0x3FF -#define SURROGATE_HIGH_START 0xD800 -#define SURROGATE_HIGH_END 0xDBFF -#define SURROGATE_LOW_START 0xDC00 -#define SURROGATE_LOW_END 0xDFFF - -/* -SURROGATE_LOW_START + HALF_BASE */ -#define SURROGATE_LOW_BASE 9216 - -static const uint32_t offsetsFromUTF8[7] = {0, - (uint32_t) 0x00000000, (uint32_t) 0x00003080, (uint32_t) 0x000E2080, - (uint32_t) 0x03C82080, (uint32_t) 0xFA082080, (uint32_t) 0x82082080 -}; -/* END OF UTF-8 Conversion DATA */ - -static const int8_t bytesFromUTF8[256] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 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, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0 +static const uint32_t offsetsFromUTF8[5] = {0, + (uint32_t) 0x00000000, (uint32_t) 0x00003080, (uint32_t) 0x000E2080, + (uint32_t) 0x03C82080 }; -/* - * Starting with Unicode 3.0.1: - * UTF-8 byte sequences of length N _must_ encode code points of or above utf8_minChar32[N]; - * byte sequences with more than 4 bytes are illegal in UTF-8, - * which is tested with impossible values for them - */ -static const uint32_t -utf8_minChar32[7]={ 0, 0, 0x80, 0x800, 0x10000, 0xffffffff, 0xffffffff }; - static UBool hasCESU8Data(const UConverter *cnv) { #if UCONFIG_ONLY_HTML_CONVERSION @@ -97,8 +61,8 @@ static UBool hasCESU8Data(const UConverter *cnv) return (UBool)(cnv->sharedData == &_CESU8Data); #endif } - -static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, +U_CDECL_BEGIN +static void U_CALLCONV ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, UErrorCode * err) { UConverter *cnv = args->converter; @@ -127,7 +91,7 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, while (mySource < sourceLimit && myTarget < targetLimit) { ch = *(mySource++); - if (ch < 0x80) /* Simple case */ + if (U8_IS_SINGLE(ch)) /* Simple case */ { *(myTarget++) = (UChar) ch; } @@ -135,7 +99,7 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, { /* store the first char */ toUBytes[0] = (char)ch; - inBytes = bytesFromUTF8[ch]; /* lookup current sequence length */ + inBytes = U8_COUNT_BYTES_NON_ASCII(ch); /* lookup current sequence length */ i = 1; morebytes: @@ -144,7 +108,8 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, if (mySource < sourceLimit) { toUBytes[i] = (char) (ch2 = *mySource); - if (!U8_IS_TRAIL(ch2)) + if (!icu::UTF8::isValidTrail(ch, ch2, i, inBytes) && + !(isCESU8 && i == 1 && ch == 0xed && U8_IS_TRAIL(ch2))) { break; /* i < inBytes */ } @@ -162,24 +127,12 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, } } - /* Remove the accumulated high bits */ - ch -= offsetsFromUTF8[inBytes]; - - /* - * Legal UTF-8 byte sequences in Unicode 3.0.1 and up: - * - use only trail bytes after a lead byte (checked above) - * - use the right number of trail bytes for a given lead byte - * - encode a code point <= U+10ffff - * - use the fewest possible number of bytes for their code points - * - use at most 4 bytes (for i>=5 it is 0x10ffff= utf8_minChar32[i] && - (isCESU8 ? i <= 3 : !U_IS_SURROGATE(ch))) + // In CESU-8, only surrogates, not supplementary code points, are encoded directly. + if (i == inBytes && (!isCESU8 || i <= 3)) { + /* Remove the accumulated high bits */ + ch -= offsetsFromUTF8[inBytes]; + /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */ if (ch <= MAXIMUM_UCS2) { @@ -189,9 +142,8 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, else { /* write out the surrogates */ - ch -= HALF_BASE; - *(myTarget++) = (UChar) ((ch >> HALF_SHIFT) + SURROGATE_HIGH_START); - ch = (ch & HALF_MASK) + SURROGATE_LOW_START; + *(myTarget++) = U16_LEAD(ch); + ch = U16_TRAIL(ch); if (myTarget < targetLimit) { *(myTarget++) = (UChar)ch; @@ -226,7 +178,7 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, args->source = (const char *) mySource; } -static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, +static void U_CALLCONV ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, UErrorCode * err) { UConverter *cnv = args->converter; @@ -256,7 +208,7 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, while (mySource < sourceLimit && myTarget < targetLimit) { ch = *(mySource++); - if (ch < 0x80) /* Simple case */ + if (U8_IS_SINGLE(ch)) /* Simple case */ { *(myTarget++) = (UChar) ch; *(myOffsets++) = offsetNum++; @@ -264,7 +216,7 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, else { toUBytes[0] = (char)ch; - inBytes = bytesFromUTF8[ch]; + inBytes = U8_COUNT_BYTES_NON_ASCII(ch); i = 1; morebytes: @@ -273,7 +225,8 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, if (mySource < sourceLimit) { toUBytes[i] = (char) (ch2 = *mySource); - if (!U8_IS_TRAIL(ch2)) + if (!icu::UTF8::isValidTrail(ch, ch2, i, inBytes) && + !(isCESU8 && i == 1 && ch == 0xed && U8_IS_TRAIL(ch2))) { break; /* i < inBytes */ } @@ -290,24 +243,12 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, } } - /* Remove the accumulated high bits */ - ch -= offsetsFromUTF8[inBytes]; - - /* - * Legal UTF-8 byte sequences in Unicode 3.0.1 and up: - * - use only trail bytes after a lead byte (checked above) - * - use the right number of trail bytes for a given lead byte - * - encode a code point <= U+10ffff - * - use the fewest possible number of bytes for their code points - * - use at most 4 bytes (for i>=5 it is 0x10ffff= utf8_minChar32[i] && - (isCESU8 ? i <= 3 : !U_IS_SURROGATE(ch))) + // In CESU-8, only surrogates, not supplementary code points, are encoded directly. + if (i == inBytes && (!isCESU8 || i <= 3)) { + /* Remove the accumulated high bits */ + ch -= offsetsFromUTF8[inBytes]; + /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */ if (ch <= MAXIMUM_UCS2) { @@ -318,10 +259,9 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, else { /* write out the surrogates */ - ch -= HALF_BASE; - *(myTarget++) = (UChar) ((ch >> HALF_SHIFT) + SURROGATE_HIGH_START); + *(myTarget++) = U16_LEAD(ch); *(myOffsets++) = offsetNum; - ch = (ch & HALF_MASK) + SURROGATE_LOW_START; + ch = U16_TRAIL(ch); if (myTarget < targetLimit) { *(myTarget++) = (UChar)ch; @@ -355,8 +295,9 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, args->source = (const char *) mySource; args->offsets = myOffsets; } +U_CDECL_END -U_CFUNC void ucnv_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args, +U_CFUNC void U_CALLCONV ucnv_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args, UErrorCode * err) { UConverter *cnv = args->converter; @@ -470,7 +411,7 @@ U_CFUNC void ucnv_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args, args->source = mySource; } -U_CFUNC void ucnv_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args, +U_CFUNC void U_CALLCONV ucnv_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args, UErrorCode * err) { UConverter *cnv = args->converter; @@ -609,15 +550,15 @@ U_CFUNC void ucnv_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnicodeArgs * ar args->offsets = myOffsets; } -static UChar32 ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args, +U_CDECL_BEGIN +static UChar32 U_CALLCONV ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args, UErrorCode *err) { UConverter *cnv; const uint8_t *sourceInitial; const uint8_t *source; - uint16_t extraBytesToWrite; uint8_t myByte; UChar32 ch; - int8_t i, isLegalSequence; + int8_t i; /* UTF-8 only here, the framework handles CESU-8 to combine surrogate pairs */ @@ -631,14 +572,14 @@ static UChar32 ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args, } myByte = (uint8_t)*(source++); - if (myByte < 0x80) + if (U8_IS_SINGLE(myByte)) { args->source = (const char *)source; return (UChar32)myByte; } - extraBytesToWrite = (uint16_t)bytesFromUTF8[myByte]; - if (extraBytesToWrite == 0) { + uint16_t countTrailBytes = U8_COUNT_TRAIL_BYTES(myByte); + if (countTrailBytes == 0) { cnv->toUBytes[0] = myByte; cnv->toULength = 1; *err = U_ILLEGAL_CHAR_FOUND; @@ -647,15 +588,17 @@ static UChar32 ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args, } /*The byte sequence is longer than the buffer area passed*/ - if (((const char *)source + extraBytesToWrite - 1) > args->sourceLimit) + if (((const char *)source + countTrailBytes) > args->sourceLimit) { /* check if all of the remaining bytes are trail bytes */ + uint16_t extraBytesToWrite = countTrailBytes + 1; cnv->toUBytes[0] = myByte; i = 1; *err = U_TRUNCATED_CHAR_FOUND; while(source < (const uint8_t *)args->sourceLimit) { - if(U8_IS_TRAIL(myByte = *source)) { - cnv->toUBytes[i++] = myByte; + uint8_t b = *source; + if(icu::UTF8::isValidTrail(myByte, b, i, extraBytesToWrite)) { + cnv->toUBytes[i++] = b; ++source; } else { /* error even before we run out of input */ @@ -668,81 +611,28 @@ static UChar32 ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args, return 0xffff; } - isLegalSequence = 1; ch = myByte << 6; - switch(extraBytesToWrite) - { - /* note: code falls through cases! (sic)*/ - case 6: - ch += (myByte = *source); - ch <<= 6; - if (!U8_IS_TRAIL(myByte)) - { - isLegalSequence = 0; - break; + if(countTrailBytes == 2) { + uint8_t t1 = *source, t2; + if(U8_IS_VALID_LEAD3_AND_T1(myByte, t1) && U8_IS_TRAIL(t2 = *++source)) { + args->source = (const char *)(source + 1); + return (((ch + t1) << 6) + t2) - offsetsFromUTF8[3]; } - ++source; - U_FALLTHROUGH; - case 5: - ch += (myByte = *source); - ch <<= 6; - if (!U8_IS_TRAIL(myByte)) - { - isLegalSequence = 0; - break; + } else if(countTrailBytes == 1) { + uint8_t t1 = *source; + if(U8_IS_TRAIL(t1)) { + args->source = (const char *)(source + 1); + return (ch + t1) - offsetsFromUTF8[2]; } - ++source; - U_FALLTHROUGH; - case 4: - ch += (myByte = *source); - ch <<= 6; - if (!U8_IS_TRAIL(myByte)) - { - isLegalSequence = 0; - break; + } else { // countTrailBytes == 3 + uint8_t t1 = *source, t2, t3; + if(U8_IS_VALID_LEAD4_AND_T1(myByte, t1) && U8_IS_TRAIL(t2 = *++source) && + U8_IS_TRAIL(t3 = *++source)) { + args->source = (const char *)(source + 1); + return (((((ch + t1) << 6) + t2) << 6) + t3) - offsetsFromUTF8[4]; } - ++source; - U_FALLTHROUGH; - case 3: - ch += (myByte = *source); - ch <<= 6; - if (!U8_IS_TRAIL(myByte)) - { - isLegalSequence = 0; - break; - } - ++source; - U_FALLTHROUGH; - case 2: - ch += (myByte = *source); - if (!U8_IS_TRAIL(myByte)) - { - isLegalSequence = 0; - break; - } - ++source; - }; - ch -= offsetsFromUTF8[extraBytesToWrite]; - args->source = (const char *)source; - - /* - * Legal UTF-8 byte sequences in Unicode 3.0.1 and up: - * - use only trail bytes after a lead byte (checked above) - * - use the right number of trail bytes for a given lead byte - * - encode a code point <= U+10ffff - * - use the fewest possible number of bytes for their code points - * - use at most 4 bytes (for i>=5 it is 0x10ffff= utf8_minChar32[extraBytesToWrite] && - !U_IS_SURROGATE(ch) - ) { - return ch; /* return the code point */ } + args->source = (const char *)source; for(i = 0; sourceInitial < source; ++i) { cnv->toUBytes[i] = *sourceInitial++; @@ -751,19 +641,13 @@ static UChar32 ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args, *err = U_ILLEGAL_CHAR_FOUND; return 0xffff; } +U_CDECL_END /* UTF-8-from-UTF-8 conversion functions ------------------------------------ */ -/* minimum code point values for n-byte UTF-8 sequences, n=0..4 */ -static const UChar32 -utf8_minLegal[5]={ 0, 0, 0x80, 0x800, 0x10000 }; - -/* offsets for n-byte UTF-8 sequences that were calculated with ((lead<<6)+trail)<<6+trail... */ -static const UChar32 -utf8_offsets[7]={ 0, 0, 0x3080, 0xE2080, 0x3C82080 }; - +U_CDECL_BEGIN /* "Convert" UTF-8 to UTF-8: Validate and copy. Modified from ucnv_DBCSFromUTF8(). */ -static void +static void U_CALLCONV ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode) { @@ -808,39 +692,37 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, *pErrorCode=U_USING_DEFAULT_WARNING; return; } else { - /* - * Use a single counter for source and target, counting the minimum of - * the source length and the target capacity. - * As a result, the source length is checked only once per multi-byte - * character instead of twice. - * - * Make sure that the last byte sequence is complete, or else - * stop just before it. - * (The longest legal byte sequence has 3 trail bytes.) - * Count oldToULength (number of source bytes from a previous buffer) - * into the source length but reduce the source index by toULimit - * while going back over trail bytes in order to not go back into - * the bytes that will be read for finishing a partial - * sequence from the previous buffer. - * Let the standard converter handle edge cases. - */ - int32_t i; - + // Use a single counter for source and target, counting the minimum of + // the source length and the target capacity. + // Let the standard converter handle edge cases. + const uint8_t *limit=sourceLimit; if(count>targetCapacity) { + limit-=(count-targetCapacity); count=targetCapacity; } - i=0; - while(i<3 && i<(count-toULimit)) { - b=source[count-oldToULength-i-1]; - if(U8_IS_TRAIL(b)) { - ++i; - } else { - if(i0 only once per 1/2/3-byte character. + // If the buffer ends with a truncated 2- or 3-byte sequence, + // then we reduce the count to stop before that, + // and collect the remaining bytes after the conversion loop. + { + // Do not go back into the bytes that will be read for finishing a partial + // sequence from the previous buffer. + int32_t length=count-toULimit; + if(length>0) { + uint8_t b1=*(limit-1); + if(U8_IS_SINGLE(b1)) { + // common ASCII character + } else if(U8_IS_TRAIL(b1) && length>=2) { + uint8_t b2=*(limit-2); + if(0xe0<=b2 && b2<0xf0 && U8_IS_VALID_LEAD3_AND_T1(b2, b1)) { + // truncated 3-byte sequence + count-=2; + } + } else if(0xc2<=b1 && b1<0xf0) { + // truncated 2- or 3-byte sequence + --count; } - break; } } } @@ -855,17 +737,17 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, /* conversion loop */ while(count>0) { b=*source++; - if((int8_t)b>=0) { + if(U8_IS_SINGLE(b)) { /* convert ASCII */ *target++=b; --count; continue; } else { - if(b>0xe0) { - if( /* handle U+1000..U+D7FF inline */ - (t1=source[0]) >= 0x80 && ((b<0xed && (t1 <= 0xbf)) || - (b==0xed && (t1 <= 0x9f))) && - (t2=source[1]) >= 0x80 && t2 <= 0xbf + if(b>=0xe0) { + if( /* handle U+0800..U+FFFF inline */ + b<0xf0 && + U8_IS_VALID_LEAD3_AND_T1(b, t1=source[0]) && + U8_IS_TRAIL(t2=source[1]) ) { source+=2; *target++=b; @@ -874,10 +756,10 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, count-=3; continue; } - } else if(b<0xe0) { + } else { if( /* handle U+0080..U+07FF inline */ b>=0xc2 && - (t1=*source) >= 0x80 && t1 <= 0xbf + U8_IS_TRAIL(t1=*source) ) { ++source; *target++=b; @@ -885,30 +767,18 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, count-=2; continue; } - } else if(b==0xe0) { - if( /* handle U+0800..U+0FFF inline */ - (t1=source[0]) >= 0xa0 && t1 <= 0xbf && - (t2=source[1]) >= 0x80 && t2 <= 0xbf - ) { - source+=2; - *target++=b; - *target++=t1; - *target++=t2; - count-=3; - continue; - } } /* handle "complicated" and error cases, and continuing partial characters */ oldToULength=0; toULength=1; - toULimit=U8_COUNT_TRAIL_BYTES(b)+1; + toULimit=U8_COUNT_BYTES_NON_ASCII(b); c=b; moreBytes: while(toULength=utf8_minLegal[toULength] && - (c<=0xd7ff || 0xe000<=c) /* not a surrogate */ - ) { - /* legal byte sequence for BMP code point */ - } else if( - toULength==toULimit && toULength==4 && - (0x10000<=(c-=utf8_offsets[4]) && c<=0x10ffff) - ) { - /* legal byte sequence for supplementary code point */ - } else { + if(toULength!=toULimit) { /* error handling: illegal UTF-8 byte sequence */ source-=(toULength-oldToULength); while(oldToULength=toULength) { int8_t i; for(i=0; isource=(char *)source; + pFromUArgs->target=(char *)target; + *pErrorCode=U_USING_DEFAULT_WARNING; + return; } } } + U_ASSERT(count>=0); if(U_SUCCESS(*pErrorCode) && sourcetargetLimit) { *pErrorCode=U_BUFFER_OVERFLOW_ERROR; } else { b=*source; - toULimit=U8_COUNT_TRAIL_BYTES(b)+1; + toULimit=U8_COUNT_BYTES(b); if(toULimit>(sourceLimit-source)) { /* collect a truncated byte sequence */ toULength=0; @@ -1008,6 +876,8 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, pFromUArgs->target=(char *)target; } +U_CDECL_END + /* UTF-8 converter data ----------------------------------------------------- */ static const UConverterImpl _UTF8Impl={ diff --git a/deps/icu-small/source/common/ucnvbocu.cpp b/deps/icu-small/source/common/ucnvbocu.cpp index 69763ca32136af..5b66c5059a55ba 100644 --- a/deps/icu-small/source/common/ucnvbocu.cpp +++ b/deps/icu-small/source/common/ucnvbocu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucnvbocu.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucnvdisp.c b/deps/icu-small/source/common/ucnvdisp.cpp similarity index 97% rename from deps/icu-small/source/common/ucnvdisp.c rename to deps/icu-small/source/common/ucnvdisp.cpp index e30f665f4a08e3..ac86b98597066f 100644 --- a/deps/icu-small/source/common/ucnvdisp.c +++ b/deps/icu-small/source/common/ucnvdisp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/ucnvhz.c b/deps/icu-small/source/common/ucnvhz.cpp similarity index 98% rename from deps/icu-small/source/common/ucnvhz.c rename to deps/icu-small/source/common/ucnvhz.cpp index dc5785b2adc1f0..5a24575f05c28a 100644 --- a/deps/icu-small/source/common/ucnvhz.c +++ b/deps/icu-small/source/common/ucnvhz.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnvhz.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -67,8 +67,8 @@ typedef struct{ }UConverterDataHZ; - -static void +U_CDECL_BEGIN +static void U_CALLCONV _HZOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){ UConverter *gbConverter; if(pArgs->onlyTestIsLoadable) { @@ -94,7 +94,7 @@ _HZOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){ } } -static void +static void U_CALLCONV _HZClose(UConverter *cnv){ if(cnv->extraInfo != NULL) { ucnv_close (((UConverterDataHZ *) (cnv->extraInfo))->gbConverter); @@ -105,7 +105,7 @@ _HZClose(UConverter *cnv){ } } -static void +static void U_CALLCONV _HZReset(UConverter *cnv, UConverterResetChoice choice){ if(choice<=UCNV_RESET_TO_UNICODE) { cnv->toUnicodeStatus = 0; @@ -152,7 +152,7 @@ _HZReset(UConverter *cnv, UConverterResetChoice choice){ */ -static void +static void U_CALLCONV UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err){ char tempBuf[2]; @@ -332,7 +332,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, } -static void +static void U_CALLCONV UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args, UErrorCode * err){ const UChar *mySource = args->source; @@ -496,7 +496,7 @@ UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args, myConverterData->isTargetUCharDBCS = isTargetUCharDBCS; } -static void +static void U_CALLCONV _HZ_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *err) { UConverter *cnv = args->converter; UConverterDataHZ *convData=(UConverterDataHZ *) cnv->extraInfo; @@ -535,7 +535,7 @@ struct cloneHZStruct }; -static UConverter * +static UConverter * U_CALLCONV _HZ_SafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, @@ -568,7 +568,7 @@ _HZ_SafeClone(const UConverter *cnv, return &localClone->cnv; } -static void +static void U_CALLCONV _HZ_GetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, @@ -582,7 +582,7 @@ _HZ_GetUnicodeSet(const UConverter *cnv, sa, which, UCNV_SET_FILTER_HZ, pErrorCode); } - +U_CDECL_END static const UConverterImpl _HZImpl={ UCNV_HZ, @@ -604,7 +604,9 @@ static const UConverterImpl _HZImpl={ NULL, _HZ_WriteSub, _HZ_SafeClone, - _HZ_GetUnicodeSet + _HZ_GetUnicodeSet, + NULL, + NULL }; static const UConverterStaticData _HZStaticData={ diff --git a/deps/icu-small/source/common/ucnvisci.c b/deps/icu-small/source/common/ucnvisci.cpp similarity index 98% rename from deps/icu-small/source/common/ucnvisci.c rename to deps/icu-small/source/common/ucnvisci.cpp index 8b509153514eca..d0c07f2b27fae9 100644 --- a/deps/icu-small/source/common/ucnvisci.c +++ b/deps/icu-small/source/common/ucnvisci.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnvisci.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -186,8 +186,9 @@ isPNJBindiTippi(UChar32 c) { return (UBool)(pnjMap[c - 0xa00] >> 1); } } - -static void _ISCIIOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode) { +U_CDECL_BEGIN +static void U_CALLCONV +_ISCIIOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode) { if(pArgs->onlyTestIsLoadable) { return; } @@ -231,7 +232,8 @@ static void _ISCIIOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *e } } -static void _ISCIIClose(UConverter *cnv) { +static void U_CALLCONV +_ISCIIClose(UConverter *cnv) { if (cnv->extraInfo!=NULL) { if (!cnv->isExtraLocal) { uprv_free(cnv->extraInfo); @@ -240,7 +242,8 @@ static void _ISCIIClose(UConverter *cnv) { } } -static const char* _ISCIIgetName(const UConverter* cnv) { +static const char* U_CALLCONV +_ISCIIgetName(const UConverter* cnv) { if (cnv->extraInfo) { UConverterDataISCII* myData= (UConverterDataISCII*)cnv->extraInfo; return myData->name; @@ -248,7 +251,8 @@ static const char* _ISCIIgetName(const UConverter* cnv) { return NULL; } -static void _ISCIIReset(UConverter *cnv, UConverterResetChoice choice) { +static void U_CALLCONV +_ISCIIReset(UConverter *cnv, UConverterResetChoice choice) { UConverterDataISCII* data =(UConverterDataISCII *) (cnv->extraInfo); if (choice<=UCNV_RESET_TO_UNICODE) { cnv->toUnicodeStatus = missingCharMarker; @@ -888,8 +892,8 @@ static const uint16_t nuktaSpecialCases[][2]={ * Soft Halant : * + */ - -static void UConverter_fromUnicode_ISCII_OFFSETS_LOGIC( +static void U_CALLCONV +UConverter_fromUnicode_ISCII_OFFSETS_LOGIC( UConverterFromUnicodeArgs * args, UErrorCode * err) { const UChar *source = args->source; const UChar *sourceLimit = args->sourceLimit; @@ -1172,7 +1176,8 @@ static const uint16_t lookupTable[][2]={ * */ -static void UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err) { +static void U_CALLCONV +UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err) { const char *source = ( char *) args->source; UChar *target = args->target; const char *sourceLimit = args->sourceLimit; @@ -1432,7 +1437,7 @@ static void UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *ar if (*toUnicodeStatus != missingCharMarker) { /* Check to make sure that consonant clusters are handled correct for Gurmukhi script. */ if (data->currentDeltaToUnicode == PNJ_DELTA && data->prevToUnicodeStatus != 0 && isPNJConsonant(data->prevToUnicodeStatus) && - (*toUnicodeStatus + PNJ_DELTA) == PNJ_SIGN_VIRAMA && (targetUniChar + PNJ_DELTA) == data->prevToUnicodeStatus) { + (*toUnicodeStatus + PNJ_DELTA) == PNJ_SIGN_VIRAMA && ((UChar32)(targetUniChar + PNJ_DELTA) == data->prevToUnicodeStatus)) { /* Consonant clusters C + HALANT + C should be encoded as ADHAK + C */ offset = (int)(source-args->source - 3); tempTargetUniChar = PNJ_ADHAK; /* This is necessary to avoid some compiler warnings. */ @@ -1522,7 +1527,7 @@ struct cloneISCIIStruct { UConverterDataISCII mydata; }; -static UConverter * +static UConverter * U_CALLCONV _ISCII_SafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, @@ -1550,12 +1555,15 @@ _ISCII_SafeClone(const UConverter *cnv, return &localClone->cnv; } -static void +static void U_CALLCONV _ISCIIGetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, UErrorCode *pErrorCode) { + (void)cnv; + (void)which; + (void)pErrorCode; int32_t idx, script; uint8_t mask; @@ -1576,7 +1584,7 @@ _ISCIIGetUnicodeSet(const UConverter *cnv, sa->add(sa->set, ZWNJ); sa->add(sa->set, ZWJ); } - +U_CDECL_END static const UConverterImpl _ISCIIImpl={ UCNV_ISCII, @@ -1598,7 +1606,9 @@ static const UConverterImpl _ISCIIImpl={ _ISCIIgetName, NULL, _ISCII_SafeClone, - _ISCIIGetUnicodeSet + _ISCIIGetUnicodeSet, + NULL, + NULL }; static const UConverterStaticData _ISCIIStaticData={ diff --git a/deps/icu-small/source/common/ucnvlat1.c b/deps/icu-small/source/common/ucnvlat1.cpp similarity index 97% rename from deps/icu-small/source/common/ucnvlat1.c rename to deps/icu-small/source/common/ucnvlat1.cpp index fe11b1844c4613..9855ebe6e774d7 100644 --- a/deps/icu-small/source/common/ucnvlat1.c +++ b/deps/icu-small/source/common/ucnvlat1.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnvlat1.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -23,6 +23,7 @@ #include "unicode/utf8.h" #include "ucnv_bld.h" #include "ucnv_cnv.h" +#include "ustr_imp.h" /* control optimizations according to the platform */ #define LATIN1_UNROLL_FROM_UNICODE 1 @@ -30,7 +31,8 @@ /* ISO 8859-1 --------------------------------------------------------------- */ /* This is a table-less and callback-less version of ucnv_MBCSSingleToBMPWithOffsets(). */ -static void +U_CDECL_BEGIN +static void U_CALLCONV _Latin1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { const uint8_t *source; @@ -116,7 +118,7 @@ _Latin1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, } /* This is a table-less and callback-less version of ucnv_MBCSSingleGetNextUChar(). */ -static UChar32 +static UChar32 U_CALLCONV _Latin1GetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { const uint8_t *source=(const uint8_t *)pArgs->source; @@ -131,7 +133,7 @@ _Latin1GetNextUChar(UConverterToUnicodeArgs *pArgs, } /* This is a table-less version of ucnv_MBCSSingleFromBMPWithOffsets(). */ -static void +static void U_CALLCONV _Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -318,7 +320,7 @@ _Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, } /* Convert UTF-8 to Latin-1. Adapted from ucnv_SBCSFromUTF8(). */ -static void +static void U_CALLCONV ucnv_Latin1FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode) { @@ -373,7 +375,7 @@ ucnv_Latin1FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, while(source0) { b=*source++; - if((int8_t)b>=0) { + if(U8_IS_SINGLE(b)) { /* convert ASCII */ *target++=(uint8_t)b; --targetCapacity; @@ -408,7 +410,7 @@ ucnv_Latin1FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, if(U_SUCCESS(*pErrorCode) && source<(sourceLimit=(uint8_t *)pToUArgs->sourceLimit)) { utf8->toUnicodeStatus=utf8->toUBytes[0]=b=*source++; utf8->toULength=1; - utf8->mode=U8_COUNT_TRAIL_BYTES(b)+1; + utf8->mode=U8_COUNT_BYTES(b); } /* write back the updated pointers */ @@ -416,13 +418,18 @@ ucnv_Latin1FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, pFromUArgs->target=(char *)target; } -static void +static void U_CALLCONV _Latin1GetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, UErrorCode *pErrorCode) { + (void)cnv; + (void)which; + (void)pErrorCode; sa->addRange(sa->set, 0, 0xff); } +U_CDECL_END + static const UConverterImpl _Latin1Impl={ UCNV_LATIN_1, @@ -465,8 +472,9 @@ const UConverterSharedData _Latin1Data= /* US-ASCII ----------------------------------------------------------------- */ +U_CDECL_BEGIN /* This is a table-less version of ucnv_MBCSSingleToBMPWithOffsets(). */ -static void +static void U_CALLCONV _ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { const uint8_t *source, *sourceLimit; @@ -575,7 +583,7 @@ _ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, } /* This is a table-less version of ucnv_MBCSSingleGetNextUChar(). */ -static UChar32 +static UChar32 U_CALLCONV _ASCIIGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { const uint8_t *source; @@ -602,7 +610,7 @@ _ASCIIGetNextUChar(UConverterToUnicodeArgs *pArgs, } /* "Convert" UTF-8 to US-ASCII: Validate and copy. */ -static void +static void U_CALLCONV ucnv_ASCIIFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode) { @@ -690,13 +698,17 @@ ucnv_ASCIIFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, pFromUArgs->target=(char *)target; } -static void +static void U_CALLCONV _ASCIIGetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, UErrorCode *pErrorCode) { + (void)cnv; + (void)which; + (void)pErrorCode; sa->addRange(sa->set, 0, 0x7f); } +U_CDECL_END static const UConverterImpl _ASCIIImpl={ UCNV_US_ASCII, diff --git a/deps/icu-small/source/common/ucnvmbcs.cpp b/deps/icu-small/source/common/ucnvmbcs.cpp index 0b598dbc34c256..e5efa7fc1b2ad3 100644 --- a/deps/icu-small/source/common/ucnvmbcs.cpp +++ b/deps/icu-small/source/common/ucnvmbcs.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucnvmbcs.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -59,6 +59,7 @@ #include "cmemory.h" #include "cstring.h" #include "umutex.h" +#include "ustr_imp.h" /* control optimizations according to the platform */ #define MBCS_UNROLL_SINGLE_TO_BMP 1 @@ -5011,13 +5012,9 @@ ucnv_MBCSSingleFromUChar32(UConverterSharedData *sharedData, /* MBCS-from-UTF-8 conversion functions ------------------------------------- */ -/* minimum code point values for n-byte UTF-8 sequences, n=0..4 */ -static const UChar32 -utf8_minLegal[5]={ 0, 0, 0x80, 0x800, 0x10000 }; - /* offsets for n-byte UTF-8 sequences that were calculated with ((lead<<6)+trail)<<6+trail... */ static const UChar32 -utf8_offsets[7]={ 0, 0, 0x3080, 0xE2080, 0x3C82080 }; +utf8_offsets[5]={ 0, 0, 0x3080, 0xE2080, 0x3C82080 }; static void U_CALLCONV ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, @@ -5037,7 +5034,7 @@ ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, uint8_t b, t1, t2; uint32_t asciiRoundtrips; - uint16_t value, minValue; + uint16_t value, minValue = 0; UBool hasSupplementary; /* set up the local pointers */ @@ -5075,28 +5072,27 @@ ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, toULength=oldToULength=toULimit=0; } - /* - * Make sure that the last byte sequence before sourceLimit is complete - * or runs into a lead byte. - * Do not go back into the bytes that will be read for finishing a partial - * sequence from the previous buffer. - * In the conversion loop compare source with sourceLimit only once - * per multi-byte character. - */ + // The conversion loop checks source0) { + uint8_t b1=*(sourceLimit-1); + if(U8_IS_SINGLE(b1)) { + // common ASCII character + } else if(U8_IS_TRAIL(b1) && length>=2) { + uint8_t b2=*(sourceLimit-2); + if(0xe0<=b2 && b2<0xf0 && U8_IS_VALID_LEAD3_AND_T1(b2, b1)) { + // truncated 3-byte sequence + sourceLimit-=2; } - break; + } else if(0xc2<=b1 && b1<0xf0) { + // truncated 2- or 3-byte sequence + --sourceLimit; } } } @@ -5130,7 +5126,7 @@ ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, while(source0) { b=*source++; - if((int8_t)b>=0) { + if(U8_IS_SINGLE(b)) { /* convert ASCII */ if(IS_ASCII_ROUNDTRIP(b, asciiRoundtrips)) { *target++=(uint8_t)b; @@ -5185,7 +5181,7 @@ ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, /* handle "complicated" and error cases, and continuing partial characters */ oldToULength=0; toULength=1; - toULimit=U8_COUNT_TRAIL_BYTES(b)+1; + toULimit=U8_COUNT_BYTES_NON_ASCII(b); c=b; moreBytes: while(toULengthsourceLimit) { b=*source; - if(U8_IS_TRAIL(b)) { + if(icu::UTF8::isValidTrail(c, b, toULength, toULimit)) { ++source; ++toULength; c=(c<<6)+b; @@ -5220,22 +5216,18 @@ ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, } } - if( toULength==toULimit && /* consumed all trail bytes */ - (toULength==3 || toULength==2) && /* BMP */ - (c-=utf8_offsets[toULength])>=utf8_minLegal[toULength] && - (c<=0xd7ff || 0xe000<=c) /* not a surrogate */ - ) { - value=MBCS_SINGLE_RESULT_FROM_U(table, results, c); - } else if( - toULength==toULimit && toULength==4 && - (0x10000<=(c-=utf8_offsets[4]) && c<=0x10ffff) - ) { - /* supplementary code point */ - if(!hasSupplementary) { - /* BMP-only codepages are stored without stage 1 entries for supplementary code points */ - value=0; - } else { + if(toULength==toULimit) { + c-=utf8_offsets[toULength]; + if(toULength<=3) { /* BMP */ value=MBCS_SINGLE_RESULT_FROM_U(table, results, c); + } else { + /* supplementary code point */ + if(!hasSupplementary) { + /* BMP-only codepages are stored without stage 1 entries for supplementary code points */ + value=0; + } else { + value=MBCS_SINGLE_RESULT_FROM_U(table, results, c); + } } } else { /* error handling: illegal UTF-8 byte sequence */ @@ -5310,7 +5302,7 @@ ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, source<(sourceLimit=(uint8_t *)pToUArgs->sourceLimit)) { c=utf8->toUBytes[0]=b=*source++; toULength=1; - toULimit=U8_COUNT_TRAIL_BYTES(b)+1; + toULimit=U8_COUNT_BYTES(b); while(sourcetoUBytes[toULength++]=b=*source++; c=(c<<6)+b; @@ -5344,7 +5336,7 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, uint32_t stage2Entry; uint32_t asciiRoundtrips; - uint16_t value; + uint16_t value = 0; UBool hasSupplementary; /* set up the local pointers */ @@ -5375,28 +5367,27 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, toULength=oldToULength=toULimit=0; } - /* - * Make sure that the last byte sequence before sourceLimit is complete - * or runs into a lead byte. - * Do not go back into the bytes that will be read for finishing a partial - * sequence from the previous buffer. - * In the conversion loop compare source with sourceLimit only once - * per multi-byte character. - */ + // The conversion loop checks source0) { + uint8_t b1=*(sourceLimit-1); + if(U8_IS_SINGLE(b1)) { + // common ASCII character + } else if(U8_IS_TRAIL(b1) && length>=2) { + uint8_t b2=*(sourceLimit-2); + if(0xe0<=b2 && b2<0xf0 && U8_IS_VALID_LEAD3_AND_T1(b2, b1)) { + // truncated 3-byte sequence + sourceLimit-=2; } - break; + } else if(0xc2<=b1 && b1<0xf0) { + // truncated 2- or 3-byte sequence + --sourceLimit; } } } @@ -5412,7 +5403,7 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, while(source0) { b=*source++; - if((int8_t)b>=0) { + if(U8_IS_SINGLE(b)) { /* convert ASCII */ if(IS_ASCII_ROUNDTRIP(b, asciiRoundtrips)) { *target++=b; @@ -5426,13 +5417,13 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, } } } else { - if(b>0xe0) { - if( /* handle U+1000..U+D7FF inline */ - (((t1=(uint8_t)(source[0]-0x80), b<0xed) && (t1 <= 0x3f)) || - (b==0xed && (t1 <= 0x1f))) && + if(b>=0xe0) { + if( /* handle U+0800..U+D7FF inline */ + b<=0xed && // do not assume maxFastUChar>0xd7ff + U8_IS_VALID_LEAD3_AND_T1(b, t1=source[0]) && (t2=(uint8_t)(source[1]-0x80)) <= 0x3f ) { - c=((b&0xf)<<6)|t1; + c=((b&0xf)<<6)|(t1&0x3f); source+=2; value=DBCS_RESULT_FROM_UTF8(mbcsIndex, results, c, t2); if(value==0) { @@ -5442,7 +5433,7 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, } else { c=-1; } - } else if(b<0xe0) { + } else { if( /* handle U+0080..U+07FF inline */ b>=0xc2 && (t1=(uint8_t)(*source-0x80)) <= 0x3f @@ -5457,15 +5448,13 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, } else { c=-1; } - } else { - c=-1; } if(c<0) { /* handle "complicated" and error cases, and continuing partial characters */ oldToULength=0; toULength=1; - toULimit=U8_COUNT_TRAIL_BYTES(b)+1; + toULimit=U8_COUNT_BYTES_NON_ASCII(b); c=b; moreBytes: while(toULengthsourceLimit) { b=*source; - if(U8_IS_TRAIL(b)) { + if(icu::UTF8::isValidTrail(c, b, toULength, toULimit)) { ++source; ++toULength; c=(c<<6)+b; @@ -5500,22 +5489,18 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, } } - if( toULength==toULimit && /* consumed all trail bytes */ - (toULength==3 || toULength==2) && /* BMP */ - (c-=utf8_offsets[toULength])>=utf8_minLegal[toULength] && - (c<=0xd7ff || 0xe000<=c) /* not a surrogate */ - ) { - stage2Entry=MBCS_STAGE_2_FROM_U(table, c); - } else if( - toULength==toULimit && toULength==4 && - (0x10000<=(c-=utf8_offsets[4]) && c<=0x10ffff) - ) { - /* supplementary code point */ - if(!hasSupplementary) { - /* BMP-only codepages are stored without stage 1 entries for supplementary code points */ - stage2Entry=0; - } else { + if(toULength==toULimit) { + c-=utf8_offsets[toULength]; + if(toULength<=3) { /* BMP */ stage2Entry=MBCS_STAGE_2_FROM_U(table, c); + } else { + /* supplementary code point */ + if(!hasSupplementary) { + /* BMP-only codepages are stored without stage 1 entries for supplementary code points */ + stage2Entry=0; + } else { + stage2Entry=MBCS_STAGE_2_FROM_U(table, c); + } } } else { /* error handling: illegal UTF-8 byte sequence */ @@ -5620,7 +5605,7 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, source<(sourceLimit=(uint8_t *)pToUArgs->sourceLimit)) { c=utf8->toUBytes[0]=b=*source++; toULength=1; - toULimit=U8_COUNT_TRAIL_BYTES(b)+1; + toULimit=U8_COUNT_BYTES(b); while(sourcetoUBytes[toULength++]=b=*source++; c=(c<<6)+b; diff --git a/deps/icu-small/source/common/ucnvmbcs.h b/deps/icu-small/source/common/ucnvmbcs.h index 12d50b545cc67c..a750b92e499c6e 100644 --- a/deps/icu-small/source/common/ucnvmbcs.h +++ b/deps/icu-small/source/common/ucnvmbcs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucnvmbcs.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucnvscsu.c b/deps/icu-small/source/common/ucnvscsu.cpp similarity index 99% rename from deps/icu-small/source/common/ucnvscsu.c rename to deps/icu-small/source/common/ucnvscsu.cpp index 4228b44e7fb1e1..eb7b7ad5c8793e 100644 --- a/deps/icu-small/source/common/ucnvscsu.c +++ b/deps/icu-small/source/common/ucnvscsu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ucnvscsu.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -154,8 +154,8 @@ enum { }; /* SCSU setup functions ----------------------------------------------------- */ - -static void +U_CDECL_BEGIN +static void U_CALLCONV _SCSUReset(UConverter *cnv, UConverterResetChoice choice) { SCSUData *scsu=(SCSUData *)cnv->extraInfo; @@ -191,7 +191,7 @@ _SCSUReset(UConverter *cnv, UConverterResetChoice choice) { } } -static void +static void U_CALLCONV _SCSUOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { @@ -216,7 +216,7 @@ _SCSUOpen(UConverter *cnv, cnv->subCharLen=-1; } -static void +static void U_CALLCONV _SCSUClose(UConverter *cnv) { if(cnv->extraInfo!=NULL) { if(!cnv->isExtraLocal) { @@ -228,7 +228,7 @@ _SCSUClose(UConverter *cnv) { /* SCSU-to-Unicode conversion functions ------------------------------------- */ -static void +static void U_CALLCONV _SCSUToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -582,7 +582,7 @@ _SCSUToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, * re-copy the original function and remove the variables * offsets, sourceIndex, and nextSourceIndex. */ -static void +static void U_CALLCONV _SCSUToUnicode(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -866,7 +866,7 @@ _SCSUToUnicode(UConverterToUnicodeArgs *pArgs, pArgs->target=target; return; } - +U_CDECL_END /* SCSU-from-Unicode conversion functions ----------------------------------- */ /* @@ -989,7 +989,7 @@ getDynamicOffset(uint32_t c, uint32_t *pOffset) { return -1; } } - +U_CDECL_BEGIN /* * Idea for compression: * - save SCSUData and other state before really starting work @@ -1007,7 +1007,7 @@ getDynamicOffset(uint32_t c, uint32_t *pOffset) { * - Only replace the result after an SDX or SCU? */ -static void +static void U_CALLCONV _SCSUFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -1515,7 +1515,7 @@ _SCSUFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, * re-copy the original function and remove the variables * offsets, sourceIndex, and nextSourceIndex. */ -static void +static void U_CALLCONV _SCSUFromUnicode(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -1949,7 +1949,7 @@ _SCSUFromUnicode(UConverterFromUnicodeArgs *pArgs, /* miscellaneous ------------------------------------------------------------ */ -static const char * +static const char * U_CALLCONV _SCSUGetName(const UConverter *cnv) { SCSUData *scsu=(SCSUData *)cnv->extraInfo; @@ -1968,7 +1968,7 @@ struct cloneSCSUStruct SCSUData mydata; }; -static UConverter * +static UConverter * U_CALLCONV _SCSUSafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, @@ -1995,7 +1995,7 @@ _SCSUSafeClone(const UConverter *cnv, return &localClone->cnv; } - +U_CDECL_END static const UConverterImpl _SCSUImpl={ UCNV_SCSU, @@ -2017,7 +2017,9 @@ static const UConverterImpl _SCSUImpl={ _SCSUGetName, NULL, _SCSUSafeClone, - ucnv_getCompleteUnicodeSet + ucnv_getCompleteUnicodeSet, + NULL, + NULL }; static const UConverterStaticData _SCSUStaticData={ diff --git a/deps/icu-small/source/common/ucnvsel.cpp b/deps/icu-small/source/common/ucnvsel.cpp index f6384cf7497297..90c7a18b93a514 100644 --- a/deps/icu-small/source/common/ucnvsel.cpp +++ b/deps/icu-small/source/common/ucnvsel.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/ucol_data.h b/deps/icu-small/source/common/ucol_data.h index cdd328eccabed7..83f54abba133ab 100644 --- a/deps/icu-small/source/common/ucol_data.h +++ b/deps/icu-small/source/common/ucol_data.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucol_data.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucol_swp.cpp b/deps/icu-small/source/common/ucol_swp.cpp index ddec0ec1c673b1..3055abaca3ba09 100644 --- a/deps/icu-small/source/common/ucol_swp.cpp +++ b/deps/icu-small/source/common/ucol_swp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucol_swp.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucol_swp.h b/deps/icu-small/source/common/ucol_swp.h index 422436dd30717d..fd8be9aa54ff45 100644 --- a/deps/icu-small/source/common/ucol_swp.h +++ b/deps/icu-small/source/common/ucol_swp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucol_swp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ucurr.cpp b/deps/icu-small/source/common/ucurr.cpp index 41fd8aa212a174..aa9d855f5022e7 100644 --- a/deps/icu-small/source/common/ucurr.cpp +++ b/deps/icu-small/source/common/ucurr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -25,6 +25,7 @@ #include "uenumimp.h" #include "uhash.h" #include "hash.h" +#include "uinvchar.h" #include "uresimp.h" #include "ulist.h" #include "ureslocs.h" @@ -545,93 +546,97 @@ U_CAPI int32_t U_EXPORT2 ucurr_forLocale(const char* locale, UChar* buff, int32_t buffCapacity, - UErrorCode* ec) -{ - int32_t resLen = 0; - const UChar* s = NULL; - if (ec != NULL && U_SUCCESS(*ec)) { - if ((buff && buffCapacity) || !buffCapacity) { - UErrorCode localStatus = U_ZERO_ERROR; - char id[ULOC_FULLNAME_CAPACITY]; - if ((resLen = uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus))) { - // there is a currency keyword. Try to see if it's valid - if(buffCapacity > resLen) { - /* Normalize the currency keyword value to upper case. */ - T_CString_toUpperCase(id); - u_charsToUChars(id, buff, resLen); - } - } else { - // get country or country_variant in `id' - uint32_t variantType = idForLocale(locale, id, sizeof(id), ec); + UErrorCode* ec) { + if (U_FAILURE(*ec)) { return 0; } + if (buffCapacity < 0 || (buff == nullptr && buffCapacity > 0)) { + *ec = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } - if (U_FAILURE(*ec)) { - return 0; - } + char currency[4]; // ISO currency codes are alpha3 codes. + UErrorCode localStatus = U_ZERO_ERROR; + int32_t resLen = uloc_getKeywordValue(locale, "currency", + currency, UPRV_LENGTHOF(currency), &localStatus); + if (U_SUCCESS(localStatus) && resLen == 3 && uprv_isInvariantString(currency, resLen)) { + if (resLen < buffCapacity) { + T_CString_toUpperCase(currency); + u_charsToUChars(currency, buff, resLen); + } + return u_terminateUChars(buff, buffCapacity, resLen, ec); + } + + // get country or country_variant in `id' + char id[ULOC_FULLNAME_CAPACITY]; + uint32_t variantType = idForLocale(locale, id, UPRV_LENGTHOF(id), ec); + if (U_FAILURE(*ec)) { + return 0; + } #if !UCONFIG_NO_SERVICE - const UChar* result = CReg::get(id); - if (result) { - if(buffCapacity > u_strlen(result)) { - u_strcpy(buff, result); - } - return u_strlen(result); - } + const UChar* result = CReg::get(id); + if (result) { + if(buffCapacity > u_strlen(result)) { + u_strcpy(buff, result); + } + resLen = u_strlen(result); + return u_terminateUChars(buff, buffCapacity, resLen, ec); + } #endif - // Remove variants, which is only needed for registration. - char *idDelim = strchr(id, VAR_DELIM); - if (idDelim) { - idDelim[0] = 0; - } + // Remove variants, which is only needed for registration. + char *idDelim = uprv_strchr(id, VAR_DELIM); + if (idDelim) { + idDelim[0] = 0; + } - // Look up the CurrencyMap element in the root bundle. - UResourceBundle *rb = ures_openDirect(U_ICUDATA_CURR, CURRENCY_DATA, &localStatus); - UResourceBundle *cm = ures_getByKey(rb, CURRENCY_MAP, rb, &localStatus); - UResourceBundle *countryArray = ures_getByKey(rb, id, cm, &localStatus); - UResourceBundle *currencyReq = ures_getByIndex(countryArray, 0, NULL, &localStatus); + const UChar* s = NULL; // 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. + localStatus = U_MISSING_RESOURCE_ERROR; + } else { + // Look up the CurrencyMap element in the root bundle. + localStatus = U_ZERO_ERROR; + UResourceBundle *rb = ures_openDirect(U_ICUDATA_CURR, CURRENCY_DATA, &localStatus); + UResourceBundle *cm = ures_getByKey(rb, CURRENCY_MAP, rb, &localStatus); + UResourceBundle *countryArray = ures_getByKey(rb, id, cm, &localStatus); + UResourceBundle *currencyReq = ures_getByIndex(countryArray, 0, NULL, &localStatus); + s = ures_getStringByKey(currencyReq, "id", &resLen, &localStatus); + + // Get the second item when PREEURO is requested, and this is a known Euro country. + // If the requested variant is PREEURO, and this isn't a Euro country, + // assume that the country changed over to the Euro in the future. + // This is probably an old version of ICU that hasn't been updated yet. + // The latest currency is probably correct. + if (U_SUCCESS(localStatus)) { + if ((variantType & VARIANT_IS_PREEURO) && u_strcmp(s, EUR_STR) == 0) { + currencyReq = ures_getByIndex(countryArray, 1, currencyReq, &localStatus); s = ures_getStringByKey(currencyReq, "id", &resLen, &localStatus); - - /* - Get the second item when PREEURO is requested, and this is a known Euro country. - If the requested variant is PREEURO, and this isn't a Euro country, assume - that the country changed over to the Euro in the future. This is probably - an old version of ICU that hasn't been updated yet. The latest currency is - probably correct. - */ - if (U_SUCCESS(localStatus)) { - if ((variantType & VARIANT_IS_PREEURO) && u_strcmp(s, EUR_STR) == 0) { - currencyReq = ures_getByIndex(countryArray, 1, currencyReq, &localStatus); - s = ures_getStringByKey(currencyReq, "id", &resLen, &localStatus); - } - else if ((variantType & VARIANT_IS_EURO)) { - s = EUR_STR; - } - } - ures_close(countryArray); - ures_close(currencyReq); - - if ((U_FAILURE(localStatus)) && strchr(id, '_') != 0) - { - // We don't know about it. Check to see if we support the variant. - uloc_getParent(locale, id, sizeof(id), ec); - *ec = U_USING_FALLBACK_WARNING; - return ucurr_forLocale(id, buff, buffCapacity, ec); - } - else if (*ec == U_ZERO_ERROR || localStatus != U_ZERO_ERROR) { - // There is nothing to fallback to. Report the failure/warning if possible. - *ec = localStatus; - } - if (U_SUCCESS(*ec)) { - if(buffCapacity > resLen) { - u_strcpy(buff, s); - } - } + } else if ((variantType & VARIANT_IS_EURO)) { + s = EUR_STR; } - return u_terminateUChars(buff, buffCapacity, resLen, ec); - } else { - *ec = U_ILLEGAL_ARGUMENT_ERROR; } + ures_close(currencyReq); + ures_close(countryArray); } - return resLen; + + if ((U_FAILURE(localStatus)) && strchr(id, '_') != 0) { + // We don't know about it. Check to see if we support the variant. + uloc_getParent(locale, id, UPRV_LENGTHOF(id), ec); + *ec = U_USING_FALLBACK_WARNING; + // TODO: Loop over the shortened id rather than recursing and + // looking again for a currency keyword. + return ucurr_forLocale(id, buff, buffCapacity, ec); + } + if (*ec == U_ZERO_ERROR || localStatus != U_ZERO_ERROR) { + // There is nothing to fallback to. Report the failure/warning if possible. + *ec = localStatus; + } + if (U_SUCCESS(*ec)) { + if(buffCapacity > resLen) { + u_strcpy(buff, s); + } + } + return u_terminateUChars(buff, buffCapacity, resLen, ec); } // end registration @@ -648,7 +653,16 @@ static UBool fallback(char *loc) { return FALSE; } UErrorCode status = U_ZERO_ERROR; - uloc_getParent(loc, loc, (int32_t)uprv_strlen(loc), &status); + if (uprv_strcmp(loc, "en_GB") == 0) { + // HACK: See #13368. We need "en_GB" to fall back to "en_001" instead of "en" + // in order to consume the correct data strings. This hack will be removed + // when proper data sink loading is implemented here. + // NOTE: "001" adds 1 char over "GB". However, both call sites allocate + // arrays with length ULOC_FULLNAME_CAPACITY (plenty of room for en_001). + uprv_strcpy(loc + 3, "001"); + } else { + uloc_getParent(loc, loc, (int32_t)uprv_strlen(loc), &status); + } /* char *i = uprv_strrchr(loc, '_'); if (i == NULL) { @@ -1030,7 +1044,8 @@ collectCurrencyNames(const char* locale, const UnicodeString *symbol; while ((symbol = iter.next()) != NULL) { (*currencySymbols)[*total_currency_symbol_count].IsoCode = iso; - (*currencySymbols)[*total_currency_symbol_count].currencyName = (UChar*) symbol->getBuffer(); + (*currencySymbols)[*total_currency_symbol_count].currencyName = + const_cast(symbol->getBuffer()); (*currencySymbols)[*total_currency_symbol_count].flag = 0; (*currencySymbols)[(*total_currency_symbol_count)++].currencyNameLen = symbol->length(); } @@ -2215,6 +2230,7 @@ ucurr_countCurrencies(const char* locale, UErrorCode localStatus = U_ZERO_ERROR; char id[ULOC_FULLNAME_CAPACITY]; uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus); + // get country or country_variant in `id' /*uint32_t variantType =*/ idForLocale(locale, id, sizeof(id), ec); diff --git a/deps/icu-small/source/common/ucurrimp.h b/deps/icu-small/source/common/ucurrimp.h index b35d6f47c62583..6e468fd4c94299 100644 --- a/deps/icu-small/source/common/ucurrimp.h +++ b/deps/icu-small/source/common/ucurrimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/udata.cpp b/deps/icu-small/source/common/udata.cpp index 7585855171673b..c15cb78a74ad7a 100644 --- a/deps/icu-small/source/common/udata.cpp +++ b/deps/icu-small/source/common/udata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: udata.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -110,8 +110,12 @@ static u_atomic_int32_t gHaveTriedToLoadCommonData = ATOMIC_INT32_T_INITIALIZER( static UHashtable *gCommonDataCache = NULL; /* Global hash table of opened ICU data files. */ static icu::UInitOnce gCommonDataCacheInitOnce = U_INITONCE_INITIALIZER; +#if U_PLATFORM_HAS_WINUWP_API == 0 static UDataFileAccess gDataFileAccess = UDATA_DEFAULT_ACCESS; // Access not synchronized. // Modifying is documented as thread-unsafe. +#else +static UDataFileAccess gDataFileAccess = UDATA_NO_FILES; // Windows UWP looks in one spot explicitly +#endif static UBool U_CALLCONV udata_cleanup(void) @@ -202,6 +206,8 @@ setCommonICUData(UDataMemory *pData, /* The new common data. Belongs to ca return didUpdate; } +#if U_PLATFORM_HAS_WINUWP_API == 0 + static UBool setCommonICUDataPointer(const void *pData, UBool /*warn*/, UErrorCode *pErrorCode) { UDataMemory tData; @@ -211,6 +217,8 @@ setCommonICUDataPointer(const void *pData, UBool /*warn*/, UErrorCode *pErrorCod return setCommonICUData(&tData, FALSE, pErrorCode); } +#endif + static const char * findBasename(const char *path) { const char *basename=uprv_strrchr(path, U_FILE_SEP_CHAR); @@ -619,12 +627,14 @@ U_NAMESPACE_END /*----------------------------------------------------------------------* * * - * Add a static reference to the common data library * + * Add a static reference to the common data library * * Unless overridden by an explicit udata_setCommonData, this will be * * our common data. * * * *----------------------------------------------------------------------*/ +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT; +#endif /* * This would be a good place for weak-linkage declarations of @@ -672,6 +682,7 @@ openCommonData(const char *path, /* Path from OpenChoice? */ if(gCommonICUDataArray[commonDataIndex] != NULL) { return gCommonICUDataArray[commonDataIndex]; } +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time int32_t i; for(i = 0; i < commonDataIndex; ++i) { if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) { @@ -679,6 +690,7 @@ openCommonData(const char *path, /* Path from OpenChoice? */ return NULL; } } +#endif } /* Add the linked-in data to the list. */ @@ -694,11 +706,13 @@ openCommonData(const char *path, /* Path from OpenChoice? */ setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pErrorCode); } */ +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode); { Mutex lock; return gCommonICUDataArray[commonDataIndex]; } +#endif } @@ -972,7 +986,7 @@ static UDataMemory *doLoadFromIndividualFiles(const char *pkgName, /* init path iterator for individual files */ UDataPathIterator iter(dataPath, pkgName, path, tocEntryPathSuffix, FALSE, pErrorCode); - while((pathBuffer = iter.next(pErrorCode))) + while((pathBuffer = iter.next(pErrorCode)) != NULL) { #ifdef UDATA_DEBUG fprintf(stderr, "UDATA: trying individual file %s\n", pathBuffer); @@ -1155,7 +1169,7 @@ doOpenChoice(const char *path, const char *type, const char *name, if(uprv_strchr(path,U_FILE_ALT_SEP_CHAR) != NULL) { altSepPath.append(path, *pErrorCode); char *p; - while((p=uprv_strchr(altSepPath.data(), U_FILE_ALT_SEP_CHAR))) { + while ((p = uprv_strchr(altSepPath.data(), U_FILE_ALT_SEP_CHAR)) != NULL) { *p = U_FILE_SEP_CHAR; } #if defined (UDATA_DEBUG) @@ -1245,9 +1259,14 @@ doOpenChoice(const char *path, const char *type, const char *name, fprintf(stderr, " tocEntryPath = %s\n", tocEntryName.data()); #endif +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time if(path == NULL) { path = COMMON_DATA_NAME; /* "icudt26e" */ } +#else + // Windows UWP expects only a single data file. + path = COMMON_DATA_NAME; /* "icudt26e" */ +#endif /************************ Begin loop looking for ind. files ***************/ #ifdef UDATA_DEBUG diff --git a/deps/icu-small/source/common/udatamem.c b/deps/icu-small/source/common/udatamem.cpp similarity index 97% rename from deps/icu-small/source/common/udatamem.c rename to deps/icu-small/source/common/udatamem.cpp index daa919373b71bb..6bf7c01235c5e0 100644 --- a/deps/icu-small/source/common/udatamem.c +++ b/deps/icu-small/source/common/udatamem.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -44,7 +44,7 @@ U_CFUNC UDataMemory *UDataMemory_createNewInstance(UErrorCode *pErr) { if (U_FAILURE(*pErr)) { return NULL; } - This = uprv_malloc(sizeof(UDataMemory)); + This = (UDataMemory *)uprv_malloc(sizeof(UDataMemory)); if (This == NULL) { *pErr = U_MEMORY_ALLOCATION_ERROR; } else { diff --git a/deps/icu-small/source/common/udatamem.h b/deps/icu-small/source/common/udatamem.h index 385a77722cc87f..a05dd69756825e 100644 --- a/deps/icu-small/source/common/udatamem.h +++ b/deps/icu-small/source/common/udatamem.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/udataswp.c b/deps/icu-small/source/common/udataswp.cpp similarity index 98% rename from deps/icu-small/source/common/udataswp.c rename to deps/icu-small/source/common/udataswp.cpp index f47ac1f5e06f35..86f302bd9c3ab9 100644 --- a/deps/icu-small/source/common/udataswp.c +++ b/deps/icu-small/source/common/udataswp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: udataswp.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -374,7 +374,7 @@ udata_openSwapper(UBool inIsBigEndian, uint8_t inCharset, } /* allocate the swapper */ - swapper=uprv_malloc(sizeof(UDataSwapper)); + swapper=(UDataSwapper *)uprv_malloc(sizeof(UDataSwapper)); if(swapper==NULL) { *pErrorCode=U_MEMORY_ALLOCATION_ERROR; return NULL; @@ -435,7 +435,7 @@ udata_openSwapperForInputData(const void *data, int32_t length, } pHeader=(const DataHeader *)data; - if( (length>=0 && length=0 && length<(int32_t)sizeof(DataHeader)) || pHeader->dataHeader.magic1!=0xda || pHeader->dataHeader.magic2!=0x27 || pHeader->info.sizeofUChar!=2 diff --git a/deps/icu-small/source/common/udataswp.h b/deps/icu-small/source/common/udataswp.h index 07e06c221a7075..5303870b1d3046 100644 --- a/deps/icu-small/source/common/udataswp.h +++ b/deps/icu-small/source/common/udataswp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: udataswp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uelement.h b/deps/icu-small/source/common/uelement.h index 9231f40ba1e8f2..9d45f09fb87f65 100644 --- a/deps/icu-small/source/common/uelement.h +++ b/deps/icu-small/source/common/uelement.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: uelement.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uenum.c b/deps/icu-small/source/common/uenum.cpp similarity index 98% rename from deps/icu-small/source/common/uenum.c rename to deps/icu-small/source/common/uenum.cpp index 4854b377c90872..f75cfb7ac3ff6a 100644 --- a/deps/icu-small/source/common/uenum.c +++ b/deps/icu-small/source/common/uenum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uenum.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * diff --git a/deps/icu-small/source/common/uenumimp.h b/deps/icu-small/source/common/uenumimp.h index 04baac5dd13a34..93854406403b39 100644 --- a/deps/icu-small/source/common/uenumimp.h +++ b/deps/icu-small/source/common/uenumimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uenumimp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * diff --git a/deps/icu-small/source/common/uhash.c b/deps/icu-small/source/common/uhash.cpp similarity index 97% rename from deps/icu-small/source/common/uhash.c rename to deps/icu-small/source/common/uhash.cpp index 02572c80ea9f3b..a80e7b8ff27b42 100644 --- a/deps/icu-small/source/common/uhash.c +++ b/deps/icu-small/source/common/uhash.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -79,14 +79,14 @@ * prime number while being less than a power of two. */ static const int32_t PRIMES[] = { - 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, + 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647 /*, 4294967291 */ }; #define PRIMES_LENGTH UPRV_LENGTHOF(PRIMES) -#define DEFAULT_PRIME_INDEX 3 +#define DEFAULT_PRIME_INDEX 4 /* These ratios are tuned to the PRIMES array such that a resize * places the table back into the zone of non-resizing. That is, @@ -570,6 +570,22 @@ uhash_init(UHashtable *fillinResult, return _uhash_init(fillinResult, keyHash, keyComp, valueComp, DEFAULT_PRIME_INDEX, status); } +U_CAPI UHashtable* U_EXPORT2 +uhash_initSize(UHashtable *fillinResult, + UHashFunction *keyHash, + UKeyComparator *keyComp, + UValueComparator *valueComp, + int32_t size, + UErrorCode *status) { + + // Find the smallest index i for which PRIMES[i] >= size. + int32_t i = 0; + while (i<(PRIMES_LENGTH-1) && PRIMES[i](ustr_hashCharsN(s, uprv_strlen(s))); } U_CAPI int32_t U_EXPORT2 diff --git a/deps/icu-small/source/common/uhash.h b/deps/icu-small/source/common/uhash.h index 4aa50e40853c81..b59d2711bb29d0 100644 --- a/deps/icu-small/source/common/uhash.h +++ b/deps/icu-small/source/common/uhash.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -231,6 +231,25 @@ uhash_init(UHashtable *hash, UValueComparator *valueComp, UErrorCode *status); +/** + * Initialize an existing UHashtable. + * @param keyHash A pointer to the key hashing function. Must not be + * NULL. + * @param keyComp A pointer to the function that compares keys. Must + * not be NULL. + * @param size The initial capacity of this hash table. + * @param status A pointer to an UErrorCode to receive any errors. + * @return A pointer to a UHashtable, or 0 if an error occurred. + * @see uhash_openSize + */ +U_CAPI UHashtable* U_EXPORT2 +uhash_initSize(UHashtable *hash, + UHashFunction *keyHash, + UKeyComparator *keyComp, + UValueComparator *valueComp, + int32_t size, + UErrorCode *status); + /** * Close a UHashtable, releasing the memory used. * @param hash The UHashtable to close. If hash is NULL no operation is performed. diff --git a/deps/icu-small/source/common/uhash_us.cpp b/deps/icu-small/source/common/uhash_us.cpp index ac76c1b97821f6..ef482c27463322 100644 --- a/deps/icu-small/source/common/uhash_us.cpp +++ b/deps/icu-small/source/common/uhash_us.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/uidna.cpp b/deps/icu-small/source/common/uidna.cpp index 2f133198491a9a..6d56fcb8f517af 100644 --- a/deps/icu-small/source/common/uidna.cpp +++ b/deps/icu-small/source/common/uidna.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uidna.cpp - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uinit.cpp b/deps/icu-small/source/common/uinit.cpp index 34e82a3db41752..624431be02c713 100644 --- a/deps/icu-small/source/common/uinit.cpp +++ b/deps/icu-small/source/common/uinit.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: uinit.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uinvchar.c b/deps/icu-small/source/common/uinvchar.cpp similarity index 98% rename from deps/icu-small/source/common/uinvchar.c rename to deps/icu-small/source/common/uinvchar.cpp index f1dbe4fe33e8f9..eafb951e38a67c 100644 --- a/deps/icu-small/source/common/uinvchar.c +++ b/deps/icu-small/source/common/uinvchar.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uinvchar.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * @@ -451,6 +451,7 @@ U_CFUNC int32_t uprv_compareInvAscii(const UDataSwapper *ds, const char *outString, int32_t outLength, const UChar *localString, int32_t localLength) { + (void)ds; int32_t minLength; UChar32 c1, c2; uint8_t c; @@ -496,6 +497,7 @@ U_CFUNC int32_t uprv_compareInvEbcdic(const UDataSwapper *ds, const char *outString, int32_t outLength, const UChar *localString, int32_t localLength) { + (void)ds; int32_t minLength; UChar32 c1, c2; uint8_t c; @@ -571,7 +573,7 @@ uprv_aestrncpy(uint8_t *dst, const uint8_t *src, int32_t n) uint8_t *orig_dst = dst; if(n==-1) { - n = uprv_strlen((const char*)src)+1; /* copy NUL */ + n = static_cast(uprv_strlen((const char*)src)+1); /* copy NUL */ } /* copy non-null */ while(*src && n>0) { @@ -592,7 +594,7 @@ uprv_eastrncpy(uint8_t *dst, const uint8_t *src, int32_t n) uint8_t *orig_dst = dst; if(n==-1) { - n = uprv_strlen((const char*)src)+1; /* copy NUL */ + n = static_cast(uprv_strlen((const char*)src)+1); /* copy NUL */ } /* copy non-null */ while(*src && n>0) { diff --git a/deps/icu-small/source/common/uinvchar.h b/deps/icu-small/source/common/uinvchar.h index 19a3b2696e758b..c4f9f88b9ad32f 100644 --- a/deps/icu-small/source/common/uinvchar.h +++ b/deps/icu-small/source/common/uinvchar.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uinvchar.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * @@ -64,7 +64,7 @@ uprv_isInvariantUString(const UChar *s, int32_t length); */ U_INTERNAL inline UBool U_EXPORT2 uprv_isInvariantUnicodeString(const icu::UnicodeString &s) { - return uprv_isInvariantUString(s.getBuffer(), s.length()); + return uprv_isInvariantUString(icu::toUCharPtr(s.getBuffer()), s.length()); } #endif /* __cplusplus */ diff --git a/deps/icu-small/source/common/uiter.cpp b/deps/icu-small/source/common/uiter.cpp index 26ca877814d0e8..b9252d81c2db5c 100644 --- a/deps/icu-small/source/common/uiter.cpp +++ b/deps/icu-small/source/common/uiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uiter.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ulist.c b/deps/icu-small/source/common/ulist.cpp similarity index 94% rename from deps/icu-small/source/common/ulist.c rename to deps/icu-small/source/common/ulist.cpp index 3b8e6c53ed583a..07cbcc8303ac91 100644 --- a/deps/icu-small/source/common/ulist.c +++ b/deps/icu-small/source/common/ulist.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -29,7 +29,6 @@ struct UList { UListNode *tail; int32_t size; - int32_t currentIndex; }; static void ulist_addFirstItem(UList *list, UListNode *newItem); @@ -51,7 +50,6 @@ U_CAPI UList *U_EXPORT2 ulist_createEmptyList(UErrorCode *status) { newList->head = NULL; newList->tail = NULL; newList->size = 0; - newList->currentIndex = -1; return newList; } @@ -80,8 +78,9 @@ static void ulist_removeItem(UList *list, UListNode *p) { } else { p->next->previous = p->previous; } - list->curr = NULL; - list->currentIndex = 0; + if (p == list->curr) { + list->curr = p->next; + } --list->size; if (p->forceDelete) { uprv_free(p->data); @@ -150,7 +149,6 @@ U_CAPI void U_EXPORT2 ulist_addItemBeginList(UList *list, const void *data, UBoo newItem->next = list->head; list->head->previous = newItem; list->head = newItem; - list->currentIndex++; } list->size++; @@ -160,7 +158,7 @@ U_CAPI UBool U_EXPORT2 ulist_containsString(const UList *list, const char *data, if (list != NULL) { const UListNode *pointer; for (pointer = list->head; pointer != NULL; pointer = pointer->next) { - if (length == uprv_strlen(pointer->data)) { + if (length == (int32_t)uprv_strlen((const char *)pointer->data)) { if (uprv_memcmp(data, pointer->data, length) == 0) { return TRUE; } @@ -174,7 +172,7 @@ U_CAPI UBool U_EXPORT2 ulist_removeString(UList *list, const char *data) { if (list != NULL) { UListNode *pointer; for (pointer = list->head; pointer != NULL; pointer = pointer->next) { - if (uprv_strcmp(data, pointer->data) == 0) { + if (uprv_strcmp(data, (const char *)pointer->data) == 0) { ulist_removeItem(list, pointer); // Remove only the first occurrence, like Java LinkedList.remove(Object). return TRUE; @@ -193,7 +191,6 @@ U_CAPI void *U_EXPORT2 ulist_getNext(UList *list) { curr = list->curr; list->curr = curr->next; - list->currentIndex++; return curr->data; } @@ -209,7 +206,6 @@ U_CAPI int32_t U_EXPORT2 ulist_getListSize(const UList *list) { U_CAPI void U_EXPORT2 ulist_resetList(UList *list) { if (list != NULL) { list->curr = list->head; - list->currentIndex = 0; } } @@ -256,7 +252,7 @@ U_CAPI const char * U_EXPORT2 ulist_next_keyword_value(UEnumeration *en, int32_t s = (const char *)ulist_getNext((UList *)(en->context)); if (s != NULL && resultLength != NULL) { - *resultLength = uprv_strlen(s); + *resultLength = static_cast(uprv_strlen(s)); } return s; } diff --git a/deps/icu-small/source/common/ulist.h b/deps/icu-small/source/common/ulist.h index 6f292bf9dcaff1..de58a4ad02c178 100644 --- a/deps/icu-small/source/common/ulist.h +++ b/deps/icu-small/source/common/ulist.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/ulistformatter.cpp b/deps/icu-small/source/common/ulistformatter.cpp index 98aa50e25fb604..c140c784b520cd 100644 --- a/deps/icu-small/source/common/ulistformatter.cpp +++ b/deps/icu-small/source/common/ulistformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/common/uloc.cpp b/deps/icu-small/source/common/uloc.cpp index 2a02b27c5ba1f7..7a1dc723cff619 100644 --- a/deps/icu-small/source/common/uloc.cpp +++ b/deps/icu-small/source/common/uloc.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -44,10 +44,11 @@ #include "uarrsort.h" #include "uenumimp.h" #include "uassert.h" +#include "charstr.h" #include /* for sprintf */ -using namespace icu; +U_NAMESPACE_USE /* ### Declarations **************************************************/ @@ -97,18 +98,19 @@ locale_getKeywords(const char *localeID, */ /* Generated using org.unicode.cldr.icu.GenerateISO639LanguageTables */ /* ISO639 table version is 20150505 */ +/* Subsequent hand addition of selected languages */ static const char * const LANGUAGES[] = { "aa", "ab", "ace", "ach", "ada", "ady", "ae", "aeb", "af", "afh", "agq", "ain", "ak", "akk", "akz", "ale", "aln", "alt", "am", "an", "ang", "anp", "ar", "arc", - "arn", "aro", "arp", "arq", "arw", "ary", "arz", "as", + "arn", "aro", "arp", "arq", "ars", "arw", "ary", "arz", "as", "asa", "ase", "ast", "av", "avk", "awa", "ay", "az", "ba", "bal", "ban", "bar", "bas", "bax", "bbc", "bbj", "be", "bej", "bem", "bew", "bez", "bfd", "bfq", "bg", "bgn", "bho", "bi", "bik", "bin", "bjn", "bkm", "bla", "bm", "bn", "bo", "bpy", "bqi", "br", "bra", "brh", "brx", "bs", "bss", "bua", "bug", "bum", "byn", "byv", - "ca", "cad", "car", "cay", "cch", "ce", "ceb", "cgg", + "ca", "cad", "car", "cay", "cch", "ccp", "ce", "ceb", "cgg", "ch", "chb", "chg", "chk", "chm", "chn", "cho", "chp", "chr", "chy", "ckb", "co", "cop", "cps", "cr", "crh", "cs", "csb", "cu", "cv", "cy", @@ -212,18 +214,19 @@ static const char* const REPLACEMENT_LANGUAGES[]={ */ /* Generated using org.unicode.cldr.icu.GenerateISO639LanguageTables */ /* ISO639 table version is 20150505 */ +/* Subsequent hand addition of selected languages */ static const char * const LANGUAGES_3[] = { "aar", "abk", "ace", "ach", "ada", "ady", "ave", "aeb", "afr", "afh", "agq", "ain", "aka", "akk", "akz", "ale", "aln", "alt", "amh", "arg", "ang", "anp", "ara", "arc", - "arn", "aro", "arp", "arq", "arw", "ary", "arz", "asm", + "arn", "aro", "arp", "arq", "ars", "arw", "ary", "arz", "asm", "asa", "ase", "ast", "ava", "avk", "awa", "aym", "aze", "bak", "bal", "ban", "bar", "bas", "bax", "bbc", "bbj", "bel", "bej", "bem", "bew", "bez", "bfd", "bfq", "bul", "bgn", "bho", "bis", "bik", "bin", "bjn", "bkm", "bla", "bam", "ben", "bod", "bpy", "bqi", "bre", "bra", "brh", "brx", "bos", "bss", "bua", "bug", "bum", "byn", "byv", - "cat", "cad", "car", "cay", "cch", "che", "ceb", "cgg", + "cat", "cad", "car", "cay", "cch", "ccp", "che", "ceb", "cgg", "cha", "chb", "chg", "chk", "chm", "chn", "cho", "chp", "chr", "chy", "ckb", "cos", "cop", "cps", "cre", "crh", "ces", "csb", "chu", "chv", "cym", @@ -528,14 +531,16 @@ static const VariantMap VARIANT_MAP[] = { #define _hasBCP47Extension(id) (id && uprv_strstr(id, "@") == NULL && getShortestSubtagLength(localeID) == 1) /* Converts the BCP47 id to Unicode id. Does nothing to id if conversion fails */ #define _ConvertBCP47(finalID, id, buffer, length,err) \ - if (uloc_forLanguageTag(id, buffer, length, NULL, err) <= 0 || U_FAILURE(*err)) { \ + if (uloc_forLanguageTag(id, buffer, length, NULL, err) <= 0 || \ + U_FAILURE(*err) || *err == U_STRING_NOT_TERMINATED_WARNING) { \ finalID=id; \ + if (*err == U_STRING_NOT_TERMINATED_WARNING) { *err = U_BUFFER_OVERFLOW_ERROR; } \ } else { \ finalID=buffer; \ } /* Gets the size of the shortest subtag in the given localeID. */ static int32_t getShortestSubtagLength(const char *localeID) { - int32_t localeIDLength = uprv_strlen(localeID); + int32_t localeIDLength = static_cast(uprv_strlen(localeID)); int32_t length = localeIDLength; int32_t tmpLength = 0; int32_t i; @@ -560,6 +565,10 @@ static int32_t getShortestSubtagLength(const char *localeID) { } /* ### Keywords **************************************************/ +#define UPRV_ISDIGIT(c) (((c) >= '0') && ((c) <= '9')) +#define UPRV_ISALPHANUM(c) (uprv_isASCIILetter(c) || UPRV_ISDIGIT(c) ) +/* Punctuation/symbols allowed in legacy key values */ +#define UPRV_OK_VALUE_PUNCTUATION(c) ((c) == '_' || (c) == '-' || (c) == '+' || (c) == '/') #define ULOC_KEYWORD_BUFFER_LEN 25 #define ULOC_MAX_NO_KEYWORDS 25 @@ -596,20 +605,26 @@ locale_getKeywordsStart(const char *localeID) { */ static int32_t locale_canonKeywordName(char *buf, const char *keywordName, UErrorCode *status) { - int32_t i; - int32_t keywordNameLen = (int32_t)uprv_strlen(keywordName); + int32_t keywordNameLen = 0; - if(keywordNameLen >= ULOC_KEYWORD_BUFFER_LEN) { - /* keyword name too long for internal buffer */ - *status = U_INTERNAL_PROGRAM_ERROR; - return 0; + for (; *keywordName != 0; keywordName++) { + if (!UPRV_ISALPHANUM(*keywordName)) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* malformed keyword name */ + return 0; + } + if (keywordNameLen < ULOC_KEYWORD_BUFFER_LEN - 1) { + buf[keywordNameLen++] = uprv_tolower(*keywordName); + } else { + /* keyword name too long for internal buffer */ + *status = U_INTERNAL_PROGRAM_ERROR; + return 0; + } } - - /* normalize the keyword name */ - for(i = 0; i < keywordNameLen; i++) { - buf[i] = uprv_tolower(keywordName[i]); + if (keywordNameLen == 0) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* empty keyword name */ + return 0; } - buf[i] = 0; + buf[keywordNameLen] = 0; /* terminate */ return keywordNameLen; } @@ -837,87 +852,108 @@ uloc_getKeywordValue(const char* localeID, const char* nextSeparator = NULL; char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN]; char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN]; - int32_t i = 0; int32_t result = 0; if(status && U_SUCCESS(*status) && localeID) { char tempBuffer[ULOC_FULLNAME_CAPACITY]; const char* tmpLocaleID; + if (keywordName == NULL || keywordName[0] == 0) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + + locale_canonKeywordName(keywordNameBuffer, keywordName, status); + if(U_FAILURE(*status)) { + return 0; + } + if (_hasBCP47Extension(localeID)) { _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), status); } else { tmpLocaleID=localeID; } - startSearchHere = uprv_strchr(tmpLocaleID, '@'); /* TODO: REVISIT: shouldn't this be locale_getKeywordsStart ? */ + startSearchHere = locale_getKeywordsStart(tmpLocaleID); if(startSearchHere == NULL) { /* no keywords, return at once */ return 0; } - locale_canonKeywordName(keywordNameBuffer, keywordName, status); - if(U_FAILURE(*status)) { - return 0; - } - /* find the first keyword */ while(startSearchHere) { - startSearchHere++; - /* skip leading spaces (allowed?) */ + const char* keyValueTail; + int32_t keyValueLen; + + startSearchHere++; /* skip @ or ; */ + nextSeparator = uprv_strchr(startSearchHere, '='); + if(!nextSeparator) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* key must have =value */ + return 0; + } + /* strip leading & trailing spaces (TC decided to tolerate these) */ while(*startSearchHere == ' ') { startSearchHere++; } - nextSeparator = uprv_strchr(startSearchHere, '='); - /* need to normalize both keyword and keyword name */ - if(!nextSeparator) { - break; + keyValueTail = nextSeparator; + while (keyValueTail > startSearchHere && *(keyValueTail-1) == ' ') { + keyValueTail--; + } + /* now keyValueTail points to first char after the keyName */ + /* copy & normalize keyName from locale */ + if (startSearchHere == keyValueTail) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* empty keyword name in passed-in locale */ + return 0; } - if(nextSeparator - startSearchHere >= ULOC_KEYWORD_BUFFER_LEN) { + keyValueLen = 0; + while (startSearchHere < keyValueTail) { + if (!UPRV_ISALPHANUM(*startSearchHere)) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* malformed keyword name */ + return 0; + } + if (keyValueLen < ULOC_KEYWORD_BUFFER_LEN - 1) { + localeKeywordNameBuffer[keyValueLen++] = uprv_tolower(*startSearchHere++); + } else { /* keyword name too long for internal buffer */ *status = U_INTERNAL_PROGRAM_ERROR; return 0; + } } - for(i = 0; i < nextSeparator - startSearchHere; i++) { - localeKeywordNameBuffer[i] = uprv_tolower(startSearchHere[i]); - } - /* trim trailing spaces */ - while(startSearchHere[i-1] == ' ') { - i--; - U_ASSERT(i>=0); - } - localeKeywordNameBuffer[i] = 0; + localeKeywordNameBuffer[keyValueLen] = 0; /* terminate */ startSearchHere = uprv_strchr(nextSeparator, ';'); if(uprv_strcmp(keywordNameBuffer, localeKeywordNameBuffer) == 0) { - nextSeparator++; + /* current entry matches the keyword. */ + nextSeparator++; /* skip '=' */ + /* First strip leading & trailing spaces (TC decided to tolerate these) */ while(*nextSeparator == ' ') { - nextSeparator++; + nextSeparator++; + } + keyValueTail = (startSearchHere)? startSearchHere: nextSeparator + uprv_strlen(nextSeparator); + while(keyValueTail > nextSeparator && *(keyValueTail-1) == ' ') { + keyValueTail--; + } + /* Now copy the value, but check well-formedness */ + if (nextSeparator == keyValueTail) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* empty key value name in passed-in locale */ + return 0; } - /* we actually found the keyword. Copy the value */ - if(startSearchHere && startSearchHere - nextSeparator < bufferCapacity) { - while(*(startSearchHere-1) == ' ') { - startSearchHere--; - } - uprv_strncpy(buffer, nextSeparator, startSearchHere - nextSeparator); - result = u_terminateChars(buffer, bufferCapacity, (int32_t)(startSearchHere - nextSeparator), status); - } else if(!startSearchHere && (int32_t)uprv_strlen(nextSeparator) < bufferCapacity) { /* last item in string */ - i = (int32_t)uprv_strlen(nextSeparator); - while(nextSeparator[i - 1] == ' ') { - i--; - } - uprv_strncpy(buffer, nextSeparator, i); - result = u_terminateChars(buffer, bufferCapacity, i, status); - } else { - /* give a bigger buffer, please */ - *status = U_BUFFER_OVERFLOW_ERROR; - if(startSearchHere) { - result = (int32_t)(startSearchHere - nextSeparator); - } else { - result = (int32_t)uprv_strlen(nextSeparator); - } + keyValueLen = 0; + while (nextSeparator < keyValueTail) { + if (!UPRV_ISALPHANUM(*nextSeparator) && !UPRV_OK_VALUE_PUNCTUATION(*nextSeparator)) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* malformed key value */ + return 0; + } + if (keyValueLen < bufferCapacity) { + /* Should we lowercase value to return here? Tests expect as-is. */ + buffer[keyValueLen++] = *nextSeparator++; + } else { /* keep advancing so we return correct length in case of overflow */ + keyValueLen++; + nextSeparator++; + } } + result = u_terminateChars(buffer, bufferCapacity, keyValueLen, status); return result; } } @@ -936,46 +972,59 @@ uloc_setKeywordValue(const char* keywordName, int32_t keywordValueLen; int32_t bufLen; int32_t needLen = 0; - int32_t foundValueLen; - int32_t keywordAtEnd = 0; /* is the keyword at the end of the string? */ char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN]; + char keywordValueBuffer[ULOC_KEYWORDS_CAPACITY+1]; char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN]; - int32_t i = 0; int32_t rc; char* nextSeparator = NULL; char* nextEqualsign = NULL; char* startSearchHere = NULL; char* keywordStart = NULL; - char *insertHere = NULL; + CharString updatedKeysAndValues; + int32_t updatedKeysAndValuesLen; + UBool handledInputKeyAndValue = FALSE; + char keyValuePrefix = '@'; + if(U_FAILURE(*status)) { return -1; } - if(bufferCapacity>1) { - bufLen = (int32_t)uprv_strlen(buffer); - } else { + if (keywordName == NULL || keywordName[0] == 0 || bufferCapacity <= 1) { *status = U_ILLEGAL_ARGUMENT_ERROR; return 0; } + bufLen = (int32_t)uprv_strlen(buffer); if(bufferCapacity= ULOC_KEYWORD_BUFFER_LEN) { - /* keyword name too long for internal buffer */ - *status = U_INTERNAL_PROGRAM_ERROR; + /* now keyValueTail points to first char after the keyName */ + /* copy & normalize keyName from locale */ + if (keywordStart == keyValueTail) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* empty keyword name in passed-in locale */ return 0; } - for(i = 0; i < nextEqualsign - keywordStart; i++) { - localeKeywordNameBuffer[i] = uprv_tolower(keywordStart[i]); - } - /* trim trailing spaces */ - while(keywordStart[i-1] == ' ') { - i--; + keyValueLen = 0; + while (keywordStart < keyValueTail) { + if (!UPRV_ISALPHANUM(*keywordStart)) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* malformed keyword name */ + return 0; + } + if (keyValueLen < ULOC_KEYWORD_BUFFER_LEN - 1) { + localeKeywordNameBuffer[keyValueLen++] = uprv_tolower(*keywordStart++); + } else { + /* keyword name too long for internal buffer */ + *status = U_INTERNAL_PROGRAM_ERROR; + return 0; + } } - U_ASSERT(i>=0 && i nextEqualsign && *(keyValueTail-1) == ' ') { + keyValueTail--; + } + if (nextEqualsign == keyValueTail) { + *status = U_ILLEGAL_ARGUMENT_ERROR; /* empty key value in passed-in locale */ + return 0; + } + rc = uprv_strcmp(keywordNameBuffer, localeKeywordNameBuffer); if(rc == 0) { - nextEqualsign++; - while(*nextEqualsign == ' ') { - nextEqualsign++; - } - /* we actually found the keyword. Change the value */ - if (nextSeparator) { - keywordAtEnd = 0; - foundValueLen = (int32_t)(nextSeparator - nextEqualsign); - } else { - keywordAtEnd = 1; - foundValueLen = (int32_t)uprv_strlen(nextEqualsign); - } - if(keywordValue) { /* adding a value - not removing */ - if(foundValueLen == keywordValueLen) { - uprv_strncpy(nextEqualsign, keywordValue, keywordValueLen); - return bufLen; /* no change in size */ - } else if(foundValueLen > keywordValueLen) { - int32_t delta = foundValueLen - keywordValueLen; - if(nextSeparator) { /* RH side */ - uprv_memmove(nextSeparator - delta, nextSeparator, bufLen-(nextSeparator-buffer)); - } - uprv_strncpy(nextEqualsign, keywordValue, keywordValueLen); - bufLen -= delta; - buffer[bufLen]=0; - return bufLen; - } else { /* FVL < KVL */ - int32_t delta = keywordValueLen - foundValueLen; - if((bufLen+delta) >= bufferCapacity) { - *status = U_BUFFER_OVERFLOW_ERROR; - return bufLen+delta; - } - if(nextSeparator) { /* RH side */ - uprv_memmove(nextSeparator+delta,nextSeparator, bufLen-(nextSeparator-buffer)); - } - uprv_strncpy(nextEqualsign, keywordValue, keywordValueLen); - bufLen += delta; - buffer[bufLen]=0; - return bufLen; - } - } else { /* removing a keyword */ - if(keywordAtEnd) { - /* zero out the ';' or '@' just before startSearchhere */ - keywordStart[-1] = 0; - return (int32_t)((keywordStart-buffer)-1); /* (string length without keyword) minus separator */ - } else { - uprv_memmove(keywordStart, nextSeparator+1, bufLen-((nextSeparator+1)-buffer)); - keywordStart[bufLen-((nextSeparator+1)-buffer)]=0; - return (int32_t)(bufLen-((nextSeparator+1)-keywordStart)); - } + /* Current entry matches the input keyword. Update the entry */ + if(keywordValueLen > 0) { /* updating a value */ + updatedKeysAndValues.append(keyValuePrefix, *status); + keyValuePrefix = ';'; /* for any subsequent key-value pair */ + updatedKeysAndValues.append(keywordNameBuffer, keywordNameLen, *status); + updatedKeysAndValues.append('=', *status); + updatedKeysAndValues.append(keywordValueBuffer, keywordValueLen, *status); + } /* else removing this entry, don't emit anything */ + handledInputKeyAndValue = TRUE; + } else { + /* input keyword sorts earlier than current entry, add before current entry */ + if (rc < 0 && keywordValueLen > 0 && !handledInputKeyAndValue) { + /* insert new entry at this location */ + updatedKeysAndValues.append(keyValuePrefix, *status); + keyValuePrefix = ';'; /* for any subsequent key-value pair */ + updatedKeysAndValues.append(keywordNameBuffer, keywordNameLen, *status); + updatedKeysAndValues.append('=', *status); + updatedKeysAndValues.append(keywordValueBuffer, keywordValueLen, *status); + handledInputKeyAndValue = TRUE; } - } else if(rc<0){ /* end match keyword */ - /* could insert at this location. */ - insertHere = keywordStart; + /* copy the current entry */ + updatedKeysAndValues.append(keyValuePrefix, *status); + keyValuePrefix = ';'; /* for any subsequent key-value pair */ + updatedKeysAndValues.append(localeKeywordNameBuffer, keyValueLen, *status); + updatedKeysAndValues.append('=', *status); + updatedKeysAndValues.append(nextEqualsign, keyValueTail-nextEqualsign, *status); + } + if (!nextSeparator && keywordValueLen > 0 && !handledInputKeyAndValue) { + /* append new entry at the end, it sorts later than existing entries */ + updatedKeysAndValues.append(keyValuePrefix, *status); + /* skip keyValuePrefix update, no subsequent key-value pair */ + updatedKeysAndValues.append(keywordNameBuffer, keywordNameLen, *status); + updatedKeysAndValues.append('=', *status); + updatedKeysAndValues.append(keywordValueBuffer, keywordValueLen, *status); + handledInputKeyAndValue = TRUE; } keywordStart = nextSeparator; } /* end loop searching */ - if(!keywordValue) { - return bufLen; /* removal of non-extant keyword - no change */ - } - - /* we know there is at least one keyword. */ - needLen = bufLen+1+keywordNameLen+1+keywordValueLen; + /* Any error from updatedKeysAndValues.append above would be internal and not due to + * problems with the passed-in locale. So if we did encounter problems with the + * passed-in locale above, those errors took precedence and overrode any error + * status from updatedKeysAndValues.append, and also caused a return of 0. If there + * are errors here they are from updatedKeysAndValues.append; they do cause an + * error return but the passed-in locale is unmodified and the original bufLen is + * returned. + */ + if (!handledInputKeyAndValue || U_FAILURE(*status)) { + /* if input key/value specified removal of a keyword not present in locale, or + * there was an error in CharString.append, leave original locale alone. */ + return bufLen; + } + + updatedKeysAndValuesLen = updatedKeysAndValues.length(); + /* needLen = length of the part before '@' + length of updated key-value part including '@' */ + needLen = (int32_t)(startSearchHere - buffer) + updatedKeysAndValuesLen; if(needLen >= bufferCapacity) { *status = U_BUFFER_OVERFLOW_ERROR; return needLen; /* no change */ } - - if(insertHere) { - uprv_memmove(insertHere+(1+keywordNameLen+1+keywordValueLen), insertHere, bufLen-(insertHere-buffer)); - keywordStart = insertHere; - } else { - keywordStart = buffer+bufLen; - *keywordStart = ';'; - keywordStart++; - } - uprv_strncpy(keywordStart, keywordNameBuffer, keywordNameLen); - keywordStart += keywordNameLen; - *keywordStart = '='; - keywordStart++; - uprv_strncpy(keywordStart, keywordValue, keywordValueLen); /* terminates. */ - keywordStart+=keywordValueLen; - if(insertHere) { - *keywordStart = ';'; - keywordStart++; + if (updatedKeysAndValuesLen > 0) { + uprv_strncpy(startSearchHere, updatedKeysAndValues.data(), updatedKeysAndValuesLen); } buffer[needLen]=0; return needLen; @@ -2119,6 +2172,20 @@ uloc_getLCID(const char* localeID) { UErrorCode status = U_ZERO_ERROR; char langID[ULOC_FULLNAME_CAPACITY]; + uint32_t lcid = 0; + + /* Check for incomplete id. */ + if (!localeID || uprv_strlen(localeID) < 2) { + return 0; + } + + // Attempt platform lookup if available + lcid = uprv_convertToLCIDPlatform(localeID); + if (lcid > 0) + { + // Windows found an LCID, return that + return lcid; + } uloc_getLanguage(localeID, langID, sizeof(langID), &status); if (U_FAILURE(status)) { @@ -2423,7 +2490,7 @@ uloc_acceptLanguage(char *result, int32_t resultAvailable, #if defined(ULOC_DEBUG) fprintf(stderr,"%02d: %s\n", i, acceptList[i]); #endif - while((l=uenum_next(availableLocales, NULL, status))) { + while((l=uenum_next(availableLocales, NULL, status)) != NULL) { #if defined(ULOC_DEBUG) fprintf(stderr," %s\n", l); #endif @@ -2463,7 +2530,7 @@ uloc_acceptLanguage(char *result, int32_t resultAvailable, #if defined(ULOC_DEBUG) fprintf(stderr,"Try: [%s]", fallbackList[i]); #endif - while((l=uenum_next(availableLocales, NULL, status))) { + while((l=uenum_next(availableLocales, NULL, status)) != NULL) { #if defined(ULOC_DEBUG) fprintf(stderr," %s\n", l); #endif @@ -2529,9 +2596,6 @@ uloc_toUnicodeLocaleType(const char* keyword, const char* value) return bcpType; } -#define UPRV_ISDIGIT(c) (((c) >= '0') && ((c) <= '9')) -#define UPRV_ISALPHANUM(c) (uprv_isASCIILetter(c) || UPRV_ISDIGIT(c) ) - static UBool isWellFormedLegacyKey(const char* legacyKey) { @@ -2574,11 +2638,10 @@ uloc_toLegacyKey(const char* keyword) // Checks if the specified locale key is well-formed with the legacy locale syntax. // // Note: - // Neither ICU nor LDML/CLDR provides the definition of keyword syntax. - // However, a key should not contain '=' obviously. For now, all existing - // keys are using ASCII alphabetic letters only. We won't add any new key - // that is not compatible with the BCP 47 syntax. Therefore, we assume - // a valid key consist from [0-9a-zA-Z], no symbols. + // LDML/CLDR provides some definition of keyword syntax in + // * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier and + // * http://www.unicode.org/reports/tr35/#Old_Locale_Extension_Syntax + // Keys can only consist of [0-9a-zA-Z]. if (isWellFormedLegacyKey(keyword)) { return keyword; } @@ -2594,12 +2657,11 @@ uloc_toLegacyType(const char* keyword, const char* value) // Checks if the specified locale type is well-formed with the legacy locale syntax. // // Note: - // Neither ICU nor LDML/CLDR provides the definition of keyword syntax. - // However, a type should not contain '=' obviously. For now, all existing - // types are using ASCII alphabetic letters with a few symbol letters. We won't - // add any new type that is not compatible with the BCP 47 syntax except timezone - // IDs. For now, we assume a valid type start with [0-9a-zA-Z], but may contain - // '-' '_' '/' in the middle. + // LDML/CLDR provides some definition of keyword syntax in + // * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier and + // * http://www.unicode.org/reports/tr35/#Old_Locale_Extension_Syntax + // Values (types) can only consist of [0-9a-zA-Z], plus for legacy values + // we allow [/_-+] in the middle (e.g. "Etc/GMT+1", "Asia/Tel_Aviv") if (isWellFormedLegacyType(value)) { return value; } diff --git a/deps/icu-small/source/common/uloc_keytype.cpp b/deps/icu-small/source/common/uloc_keytype.cpp index 0bb337b1ff6ace..04b566a5d68b40 100644 --- a/deps/icu-small/source/common/uloc_keytype.cpp +++ b/deps/icu-small/source/common/uloc_keytype.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uloc_tag.c b/deps/icu-small/source/common/uloc_tag.cpp similarity index 99% rename from deps/icu-small/source/common/uloc_tag.c rename to deps/icu-small/source/common/uloc_tag.cpp index 168b71256f7429..f8337ec02476c4 100644 --- a/deps/icu-small/source/common/uloc_tag.c +++ b/deps/icu-small/source/common/uloc_tag.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -823,7 +823,7 @@ _appendVariantsToLanguageTag(const char* localeID, char* appendAt, int32_t capac /* validate */ if (_isVariantSubtag(pVar, -1)) { - if (uprv_strcmp(pVar,POSIX_VALUE) || len != uprv_strlen(POSIX_VALUE)) { + if (uprv_strcmp(pVar,POSIX_VALUE) || len != (int32_t)uprv_strlen(POSIX_VALUE)) { /* emit the variant to the list */ var = (VariantListEntry*)uprv_malloc(sizeof(VariantListEntry)); if (var == NULL) { @@ -923,7 +923,7 @@ _appendKeywordsToLanguageTag(const char* localeID, char* appendAt, int32_t capac char extBuf[ULOC_KEYWORD_AND_VALUES_CAPACITY]; char *pExtBuf = extBuf; int32_t extBufCapacity = sizeof(extBuf); - const char *bcpKey, *bcpValue; + const char *bcpKey=nullptr, *bcpValue=nullptr; UErrorCode tmpStatus = U_ZERO_ERROR; int32_t keylen; UBool isBcpUExt; @@ -1022,7 +1022,7 @@ _appendKeywordsToLanguageTag(const char* localeID, char* appendAt, int32_t capac no known mapping. This implementation normalizes the the value to lower case */ - int32_t bcpValueLen = uprv_strlen(bcpValue); + int32_t bcpValueLen = static_cast(uprv_strlen(bcpValue)); if (bcpValueLen < extBufCapacity) { uprv_strcpy(pExtBuf, bcpValue); T_CString_toLowerCase(pExtBuf); @@ -1288,7 +1288,7 @@ _appendLDMLExtensionAsKeywords(const char* ldmlext, ExtensionListEntry** appendT bufIdx++; } - len = uprv_strlen(attr->attribute); + len = static_cast(uprv_strlen(attr->attribute)); uprv_memcpy(buf + bufIdx, attr->attribute, len); bufIdx += len; @@ -1371,7 +1371,7 @@ _appendLDMLExtensionAsKeywords(const char* ldmlext, ExtensionListEntry** appendT U_ASSERT(pBcpKey != NULL); - if (bcpKeyLen >= sizeof(bcpKeyBuf)) { + if (bcpKeyLen >= (int32_t)sizeof(bcpKeyBuf)) { /* the BCP key is invalid */ *status = U_ILLEGAL_ARGUMENT_ERROR; goto cleanup; @@ -1406,7 +1406,7 @@ _appendLDMLExtensionAsKeywords(const char* ldmlext, ExtensionListEntry** appendT if (pBcpType) { char bcpTypeBuf[128]; /* practically long enough even considering multiple subtag type */ - if (bcpTypeLen >= sizeof(bcpTypeBuf)) { + if (bcpTypeLen >= (int32_t)sizeof(bcpTypeBuf)) { /* the BCP type is too long */ *status = U_ILLEGAL_ARGUMENT_ERROR; goto cleanup; @@ -1642,6 +1642,7 @@ _appendKeywords(ULanguageTag* langtag, char* appendAt, int32_t capacity, UErrorC static int32_t _appendPrivateuseToLanguageTag(const char* localeID, char* appendAt, int32_t capacity, UBool strict, UBool hadPosix, UErrorCode* status) { + (void)hadPosix; char buf[ULOC_FULLNAME_CAPACITY]; char tmpAppend[ULOC_FULLNAME_CAPACITY]; UErrorCode tmpStatus = U_ZERO_ERROR; @@ -1840,7 +1841,7 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta int32_t newTagLength; grandfatheredLen = tagLen; /* back up for output parsedLen */ - newTagLength = uprv_strlen(GRANDFATHERED[i+1]); + newTagLength = static_cast(uprv_strlen(GRANDFATHERED[i+1])); if (tagLen < newTagLength) { uprv_free(tagBuf); tagBuf = (char*)uprv_malloc(newTagLength + 1); diff --git a/deps/icu-small/source/common/ulocimp.h b/deps/icu-small/source/common/ulocimp.h index 26d5c7963e0862..855f9235dc636f 100644 --- a/deps/icu-small/source/common/ulocimp.h +++ b/deps/icu-small/source/common/ulocimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/umapfile.c b/deps/icu-small/source/common/umapfile.cpp similarity index 93% rename from deps/icu-small/source/common/umapfile.c rename to deps/icu-small/source/common/umapfile.cpp index 377b14d30f2df8..5084913cbf742a 100644 --- a/deps/icu-small/source/common/umapfile.c +++ b/deps/icu-small/source/common/umapfile.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -28,7 +28,9 @@ /* memory-mapping base definitions ------------------------------------------ */ #if MAP_IMPLEMENTATION==MAP_WIN32 +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -100,24 +102,51 @@ { HANDLE map; HANDLE file; - SECURITY_ATTRIBUTES mappingAttributes; - SECURITY_ATTRIBUTES *mappingAttributesPtr = NULL; - SECURITY_DESCRIPTOR securityDesc; UDataMemory_init(pData); /* Clear the output struct. */ /* open the input file */ +#if U_PLATFORM_HAS_WINUWP_API == 0 file=CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_RANDOM_ACCESS, NULL); +#else + // First we need to go from char to UTF-16 + // u_UCharsToChars could work but it requires length. + WCHAR utf16Path[MAX_PATH]; + int32_t i; + for (i = 0; i < UPRV_LENGTHOF(utf16Path); i++) + { + utf16Path[i] = path[i]; + if (path[i] == '\0') + { + break; + } + } + if (i >= UPRV_LENGTHOF(utf16Path)) + { + // Ran out of room, unlikely but be safe + utf16Path[UPRV_LENGTHOF(utf16Path) - 1] = '\0'; + } + + // TODO: Is it worth setting extended parameters to specify random access? + file = CreateFile2(utf16Path, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, NULL); +#endif if(file==INVALID_HANDLE_VALUE) { return FALSE; } /* Declare and initialize a security descriptor. This is required for multiuser systems on Windows 2000 SP4 and beyond */ + // TODO: UWP does not have this function and I do not think it is required? +#if U_PLATFORM_HAS_WINUWP_API == 0 + + SECURITY_ATTRIBUTES mappingAttributes; + SECURITY_ATTRIBUTES *mappingAttributesPtr = NULL; + SECURITY_DESCRIPTOR securityDesc; + if (InitializeSecurityDescriptor(&securityDesc, SECURITY_DESCRIPTOR_REVISION)) { - /* give the security descriptor a Null Dacl done using the "TRUE, (PACL)NULL" here */ + /* give the security descriptor a Null Dacl done using the "TRUE, (PACL)NULL" here */ if (SetSecurityDescriptorDacl(&securityDesc, TRUE, (PACL)NULL, FALSE)) { /* Make the security attributes point to the security descriptor */ uprv_memset(&mappingAttributes, 0, sizeof(mappingAttributes)); @@ -132,6 +161,9 @@ /* create an unnamed Windows file-mapping object for the specified file */ map=CreateFileMapping(file, mappingAttributesPtr, PAGE_READONLY, 0, 0, NULL); +#else + map = CreateFileMappingFromApp(file, NULL, PAGE_READONLY, 0, NULL); +#endif CloseHandle(file); if(map==NULL) { return FALSE; diff --git a/deps/icu-small/source/common/umapfile.h b/deps/icu-small/source/common/umapfile.h index 70a6cc5f861784..24e476b11e93d0 100644 --- a/deps/icu-small/source/common/umapfile.h +++ b/deps/icu-small/source/common/umapfile.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/umath.c b/deps/icu-small/source/common/umath.cpp similarity index 90% rename from deps/icu-small/source/common/umath.c rename to deps/icu-small/source/common/umath.cpp index 86f58819e067ac..3ab72ab482386c 100644 --- a/deps/icu-small/source/common/umath.c +++ b/deps/icu-small/source/common/umath.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/umutex.cpp b/deps/icu-small/source/common/umutex.cpp index 13569cb075fa58..cbbd66cb5a8a65 100644 --- a/deps/icu-small/source/common/umutex.cpp +++ b/deps/icu-small/source/common/umutex.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -132,7 +132,7 @@ umtx_condBroadcast(UConditionVar *condition) { } U_CAPI void U_EXPORT2 -umtx_condSignal(UConditionVar *condition) { +umtx_condSignal(UConditionVar * /* condition */) { // Function not implemented. There is no immediate requirement from ICU to have it. // Once ICU drops support for Windows XP and Server 2003, ICU Condition Variables will be // changed to be thin wrappers on native Windows CONDITION_VARIABLEs, and this function diff --git a/deps/icu-small/source/common/umutex.h b/deps/icu-small/source/common/umutex.h index d6618ed76621fb..8f2f6123541f79 100644 --- a/deps/icu-small/source/common/umutex.h +++ b/deps/icu-small/source/common/umutex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -86,7 +86,9 @@ U_NAMESPACE_END // Original plan was to use gcc atomics for MinGW, but they // aren't supported, so we fold MinGW into this path. +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -331,7 +333,9 @@ U_NAMESPACE_END * win32 APIs for Critical Sections. */ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE diff --git a/deps/icu-small/source/common/unames.cpp b/deps/icu-small/source/common/unames.cpp index b8c4151f42ccc7..13a4572e1c38a1 100644 --- a/deps/icu-small/source/common/unames.cpp +++ b/deps/icu-small/source/common/unames.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: unames.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/appendable.h b/deps/icu-small/source/common/unicode/appendable.h index 2ae334505ef1f5..8512c2f30311b8 100644 --- a/deps/icu-small/source/common/unicode/appendable.h +++ b/deps/icu-small/source/common/unicode/appendable.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: appendable.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -19,7 +19,7 @@ /** * \file - * \brief C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (UChars). + * \brief C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (char16_ts). */ #include "unicode/utypes.h" @@ -34,10 +34,10 @@ class UnicodeString; * Combines elements of Java Appendable and ICU4C ByteSink. * * This class can be used in APIs where it does not matter whether the actual destination is - * a UnicodeString, a UChar[] array, a UnicodeSet, or any other object + * a UnicodeString, a char16_t[] array, a UnicodeSet, or any other object * that receives and processes characters and/or strings. * - * Implementation classes must implement at least appendCodeUnit(UChar). + * Implementation classes must implement at least appendCodeUnit(char16_t). * The base class provides default implementations for the other methods. * * The methods do not take UErrorCode parameters. @@ -62,11 +62,11 @@ class U_COMMON_API Appendable : public UObject { * @return TRUE if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendCodeUnit(UChar c) = 0; + virtual UBool appendCodeUnit(char16_t c) = 0; /** * Appends a code point. - * The default implementation calls appendCodeUnit(UChar) once or twice. + * The default implementation calls appendCodeUnit(char16_t) once or twice. * @param c code point 0..0x10ffff * @return TRUE if the operation succeeded * @stable ICU 4.8 @@ -75,20 +75,20 @@ class U_COMMON_API Appendable : public UObject { /** * Appends a string. - * The default implementation calls appendCodeUnit(UChar) for each code unit. + * The default implementation calls appendCodeUnit(char16_t) for each code unit. * @param s string, must not be NULL if length!=0 * @param length string length, or -1 if NUL-terminated * @return TRUE if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendString(const UChar *s, int32_t length); + virtual UBool appendString(const char16_t *s, int32_t length); /** * Tells the object that the caller is going to append roughly - * appendCapacity UChars. A subclass might use this to pre-allocate + * appendCapacity char16_ts. A subclass might use this to pre-allocate * a larger buffer if necessary. * The default implementation does nothing. (It always returns TRUE.) - * @param appendCapacity estimated number of UChars that will be appended + * @param appendCapacity estimated number of char16_ts that will be appended * @return TRUE if the operation succeeded * @stable ICU 4.8 */ @@ -102,19 +102,19 @@ class U_COMMON_API Appendable : public UObject { * The returned buffer is only valid until the next operation * on this Appendable. * - * After writing at most *resultCapacity UChars, call appendString() with the - * pointer returned from this function and the number of UChars written. - * Many appendString() implementations will avoid copying UChars if this function + * After writing at most *resultCapacity char16_ts, call appendString() with the + * pointer returned from this function and the number of char16_ts written. + * Many appendString() implementations will avoid copying char16_ts if this function * returned an internal buffer. * * Partial usage example: * \code * int32_t capacity; - * UChar* buffer = app.getAppendBuffer(..., &capacity); - * ... Write n UChars into buffer, with n <= capacity. + * char16_t* buffer = app.getAppendBuffer(..., &capacity); + * ... Write n char16_ts into buffer, with n <= capacity. * app.appendString(buffer, n); * \endcode - * In many implementations, that call to append will avoid copying UChars. + * In many implementations, that call to append will avoid copying char16_ts. * * If the Appendable allocates or reallocates an internal buffer, it should use * the desiredCapacityHint if appropriate. @@ -138,9 +138,9 @@ class U_COMMON_API Appendable : public UObject { * @return a buffer with *resultCapacity>=minCapacity * @stable ICU 4.8 */ - virtual UChar *getAppendBuffer(int32_t minCapacity, + virtual char16_t *getAppendBuffer(int32_t minCapacity, int32_t desiredCapacityHint, - UChar *scratch, int32_t scratchCapacity, + char16_t *scratch, int32_t scratchCapacity, int32_t *resultCapacity); }; @@ -171,7 +171,7 @@ class U_COMMON_API UnicodeStringAppendable : public Appendable { * @return TRUE if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendCodeUnit(UChar c); + virtual UBool appendCodeUnit(char16_t c); /** * Appends a code point to the string. @@ -188,12 +188,12 @@ class U_COMMON_API UnicodeStringAppendable : public Appendable { * @return TRUE if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendString(const UChar *s, int32_t length); + virtual UBool appendString(const char16_t *s, int32_t length); /** * Tells the UnicodeString that the caller is going to append roughly - * appendCapacity UChars. - * @param appendCapacity estimated number of UChars that will be appended + * appendCapacity char16_ts. + * @param appendCapacity estimated number of char16_ts that will be appended * @return TRUE if the operation succeeded * @stable ICU 4.8 */ @@ -220,9 +220,9 @@ class U_COMMON_API UnicodeStringAppendable : public Appendable { * @return a buffer with *resultCapacity>=minCapacity * @stable ICU 4.8 */ - virtual UChar *getAppendBuffer(int32_t minCapacity, + virtual char16_t *getAppendBuffer(int32_t minCapacity, int32_t desiredCapacityHint, - UChar *scratch, int32_t scratchCapacity, + char16_t *scratch, int32_t scratchCapacity, int32_t *resultCapacity); private: diff --git a/deps/icu-small/source/common/unicode/brkiter.h b/deps/icu-small/source/common/unicode/brkiter.h index 88b39c6699b2f6..c64bb712222c63 100644 --- a/deps/icu-small/source/common/unicode/brkiter.h +++ b/deps/icu-small/source/common/unicode/brkiter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -250,7 +250,7 @@ class U_COMMON_API BreakIterator : public UObject { virtual int32_t next(void) = 0; /** - * Return character index of the current interator position within the text. + * Return character index of the current iterator position within the text. * @return The boundary most recently returned. * @stable ICU 2.0 */ @@ -277,7 +277,7 @@ class U_COMMON_API BreakIterator : public UObject { virtual int32_t preceding(int32_t offset) = 0; /** - * Return true if the specfied position is a boundary position. + * Return true if the specified position is a boundary position. * As a side effect, the current position of the iterator is set * to the first boundary position at or following the specified offset. * @param offset the offset to check. @@ -292,7 +292,7 @@ class U_COMMON_API BreakIterator : public UObject { * does nothing. Negative values move to previous boundaries * and positive values move to later boundaries. * @return The new iterator position, or - * DONE if there are fewer than |n| boundaries in the specfied direction. + * DONE if there are fewer than |n| boundaries in the specified direction. * @stable ICU 2.0 */ virtual int32_t next(int32_t n) = 0; @@ -331,7 +331,7 @@ class U_COMMON_API BreakIterator : public UObject { * @param fillInVec an array to be filled in with the status values. * @param capacity the length of the supplied vector. A length of zero causes * the function to return the number of status values, in the - * normal way, without attemtping to store any values. + * normal way, without attempting to store any values. * @param status receives error codes. * @return The number of rule status values from rules that determined * the most recent boundary returned by the break iterator. @@ -469,7 +469,7 @@ class U_COMMON_API BreakIterator : public UObject { static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count); /** - * Get name of the object for the desired Locale, in the desired langauge. + * Get name of the object for the desired Locale, in the desired language. * @param objectLocale must be from getAvailableLocales. * @param displayLocale specifies the desired locale for output. * @param name the fill-in parameter of the return value @@ -482,7 +482,7 @@ class U_COMMON_API BreakIterator : public UObject { UnicodeString& name); /** - * Get name of the object for the desired Locale, in the langauge of the + * Get name of the object for the desired Locale, in the language of the * default locale. * @param objectLocale must be from getMatchingLocales * @param name the fill-in parameter of the return value @@ -629,10 +629,12 @@ class U_COMMON_API BreakIterator : public UObject { /** @internal */ BreakIterator(); /** @internal */ - BreakIterator (const BreakIterator &other) : UObject(other) {} + BreakIterator (const BreakIterator &other); #ifndef U_HIDE_INTERNAL_API /** @internal */ - BreakIterator (const Locale& valid, const Locale& actual); + BreakIterator (const Locale& valid, const Locale &actual); + /** @internal. Assignment Operator, used by RuleBasedBreakIterator. */ + BreakIterator &operator = (const BreakIterator &other); #endif /* U_HIDE_INTERNAL_API */ private: @@ -640,12 +642,6 @@ class U_COMMON_API BreakIterator : public UObject { /** @internal */ char actualLocale[ULOC_FULLNAME_CAPACITY]; char validLocale[ULOC_FULLNAME_CAPACITY]; - - /** - * The assignment operator has no real implementation. - * It's provided to make the compiler happy. Do not call. - */ - BreakIterator& operator=(const BreakIterator&); }; #ifndef U_HIDE_DEPRECATED_API @@ -661,5 +657,5 @@ U_NAMESPACE_END #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ -#endif // _BRKITER +#endif // BRKITER_H //eof diff --git a/deps/icu-small/source/common/unicode/bytestream.h b/deps/icu-small/source/common/unicode/bytestream.h index 4e404a6edc737b..9df23f79c54c0c 100644 --- a/deps/icu-small/source/common/unicode/bytestream.h +++ b/deps/icu-small/source/common/unicode/bytestream.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // Copyright (C) 2009-2012, International Business Machines // Corporation and others. All Rights Reserved. @@ -126,8 +126,8 @@ class U_COMMON_API ByteSink : public UMemory { virtual void Flush(); private: - ByteSink(const ByteSink &); // copy constructor not implemented - ByteSink &operator=(const ByteSink &); // assignment operator not implemented + ByteSink(const ByteSink &) = delete; + ByteSink &operator=(const ByteSink &) = delete; }; // ------------------------------------------------------------- @@ -217,12 +217,11 @@ class U_COMMON_API CheckedArrayByteSink : public ByteSink { int32_t size_; int32_t appended_; UBool overflowed_; - CheckedArrayByteSink(); ///< default constructor not implemented - CheckedArrayByteSink(const CheckedArrayByteSink &); ///< copy constructor not implemented - CheckedArrayByteSink &operator=(const CheckedArrayByteSink &); ///< assignment operator not implemented -}; -#if U_HAVE_STD_STRING + CheckedArrayByteSink() = delete; + CheckedArrayByteSink(const CheckedArrayByteSink &) = delete; + CheckedArrayByteSink &operator=(const CheckedArrayByteSink &) = delete; +}; /** * Implementation of ByteSink that writes to a "string". @@ -238,6 +237,21 @@ class StringByteSink : public ByteSink { * @stable ICU 4.2 */ StringByteSink(StringClass* dest) : dest_(dest) { } +#ifndef U_HIDE_DRAFT_API + /** + * Constructs a ByteSink that reserves append capacity and will append bytes to the dest string. + * + * @param dest pointer to string object to append to + * @param initialAppendCapacity capacity beyond dest->length() to be reserve()d + * @draft ICU 60 + */ + StringByteSink(StringClass* dest, int32_t initialAppendCapacity) : dest_(dest) { + if (initialAppendCapacity > 0 && + (uint32_t)initialAppendCapacity > (dest->capacity() - dest->length())) { + dest->reserve(dest->length() + initialAppendCapacity); + } + } +#endif // U_HIDE_DRAFT_API /** * Append "bytes[0,n-1]" to this. * @param data the pointer to the bytes @@ -247,12 +261,11 @@ class StringByteSink : public ByteSink { virtual void Append(const char* data, int32_t n) { dest_->append(data, n); } private: StringClass* dest_; - StringByteSink(); ///< default constructor not implemented - StringByteSink(const StringByteSink &); ///< copy constructor not implemented - StringByteSink &operator=(const StringByteSink &); ///< assignment operator not implemented -}; -#endif + StringByteSink() = delete; + StringByteSink(const StringByteSink &) = delete; + StringByteSink &operator=(const StringByteSink &) = delete; +}; U_NAMESPACE_END diff --git a/deps/icu-small/source/common/unicode/bytestrie.h b/deps/icu-small/source/common/unicode/bytestrie.h index 4a30ce1c0428b5..c57b8ccfeb5960 100644 --- a/deps/icu-small/source/common/unicode/bytestrie.h +++ b/deps/icu-small/source/common/unicode/bytestrie.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bytestrie.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/bytestriebuilder.h b/deps/icu-small/source/common/unicode/bytestriebuilder.h index 3ad800975b778c..0f9f5e2c060f13 100644 --- a/deps/icu-small/source/common/unicode/bytestriebuilder.h +++ b/deps/icu-small/source/common/unicode/bytestriebuilder.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bytestriebuilder.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -127,14 +127,14 @@ class U_COMMON_API BytesTrieBuilder : public StringTrieBuilder { void buildBytes(UStringTrieBuildOption buildOption, UErrorCode &errorCode); virtual int32_t getElementStringLength(int32_t i) const; - virtual UChar getElementUnit(int32_t i, int32_t byteIndex) const; + virtual char16_t getElementUnit(int32_t i, int32_t byteIndex) const; virtual int32_t getElementValue(int32_t i) const; virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t byteIndex) const; virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t byteIndex) const; virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t byteIndex, int32_t count) const; - virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, UChar byte) const; + virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, char16_t byte) const; virtual UBool matchNodesCanHaveValues() const { return FALSE; } diff --git a/deps/icu-small/source/common/unicode/caniter.h b/deps/icu-small/source/common/unicode/caniter.h index b988b2003d73a8..543341f42c5fe2 100644 --- a/deps/icu-small/source/common/unicode/caniter.h +++ b/deps/icu-small/source/common/unicode/caniter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -187,7 +187,7 @@ class U_COMMON_API CanonicalIterator U_FINAL : public UObject { UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status); //private String[] getEquivalents(String segment) //Set getEquivalents2(String segment); - Hashtable *getEquivalents2(Hashtable *fillinResult, const UChar *segment, int32_t segLen, UErrorCode &status); + Hashtable *getEquivalents2(Hashtable *fillinResult, const char16_t *segment, int32_t segLen, UErrorCode &status); //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status); /** @@ -196,7 +196,7 @@ class U_COMMON_API CanonicalIterator U_FINAL : public UObject { * If so, take the remainder, and return the equivalents */ //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer); - Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); + Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const char16_t *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status); void cleanPieces(); diff --git a/deps/icu-small/source/common/unicode/casemap.h b/deps/icu-small/source/common/unicode/casemap.h new file mode 100644 index 00000000000000..4a4917bdcaf1b7 --- /dev/null +++ b/deps/icu-small/source/common/unicode/casemap.h @@ -0,0 +1,496 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// casemap.h +// created: 2017jan12 Markus W. Scherer + +#ifndef __CASEMAP_H__ +#define __CASEMAP_H__ + +#include "unicode/utypes.h" +#include "unicode/stringpiece.h" +#include "unicode/uobject.h" + +/** + * \file + * \brief C++ API: Low-level C++ case mapping functions. + */ + +U_NAMESPACE_BEGIN + +#ifndef U_HIDE_DRAFT_API + +class BreakIterator; +class ByteSink; +class Edits; + +/** + * Low-level C++ case mapping functions. + * + * @draft ICU 59 + */ +class U_COMMON_API CaseMap U_FINAL : public UMemory { +public: + /** + * Lowercases a UTF-16 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see u_strToLower + * @draft ICU 59 + */ + static int32_t toLower( + const char *locale, uint32_t options, + const char16_t *src, int32_t srcLength, + char16_t *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + + /** + * Uppercases a UTF-16 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see u_strToUpper + * @draft ICU 59 + */ + static int32_t toUpper( + const char *locale, uint32_t options, + const char16_t *src, int32_t srcLength, + char16_t *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + +#if !UCONFIG_NO_BREAK_ITERATION + + /** + * Titlecases a UTF-16 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * Titlecasing uses a break iterator to find the first characters of words + * that are to be titlecased. It titlecases those characters and lowercases + * all others. (This can be modified with options bits.) + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, + * U_TITLECASE_NO_LOWERCASE, + * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, + * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. + * @param iter A break iterator to find the first characters of words that are to be titlecased. + * It is set to the source string (setText()) + * and used one or more times for iteration (first() and next()). + * If NULL, then a word break iterator for the locale is used + * (or something equivalent). + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see u_strToTitle + * @see ucasemap_toTitle + * @draft ICU 59 + */ + static int32_t toTitle( + const char *locale, uint32_t options, BreakIterator *iter, + const char16_t *src, int32_t srcLength, + char16_t *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + +#endif // UCONFIG_NO_BREAK_ITERATION + + /** + * Case-folds a UTF-16 string and optionally records edits. + * + * Case folding is locale-independent and not context-sensitive, + * but there is an option for whether to include or exclude mappings for dotted I + * and dotless i that are marked with 'T' in CaseFolding.txt. + * + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, + * U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I. + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see u_strFoldCase + * @draft ICU 59 + */ + static int32_t fold( + uint32_t options, + const char16_t *src, int32_t srcLength, + char16_t *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + + /** + * Lowercases a UTF-8 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param sink A ByteSink to which the result string is written. + * sink.Flush() is called at the end. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * + * @see ucasemap_utf8ToLower + * @draft ICU 60 + */ + static void utf8ToLower( + const char *locale, uint32_t options, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode); + + /** + * Uppercases a UTF-8 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param sink A ByteSink to which the result string is written. + * sink.Flush() is called at the end. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * + * @see ucasemap_utf8ToUpper + * @draft ICU 60 + */ + static void utf8ToUpper( + const char *locale, uint32_t options, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode); + +#if !UCONFIG_NO_BREAK_ITERATION + + /** + * Titlecases a UTF-8 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * + * Titlecasing uses a break iterator to find the first characters of words + * that are to be titlecased. It titlecases those characters and lowercases + * all others. (This can be modified with options bits.) + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, + * U_TITLECASE_NO_LOWERCASE, + * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, + * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. + * @param iter A break iterator to find the first characters of words that are to be titlecased. + * It is set to the source string (setUText()) + * and used one or more times for iteration (first() and next()). + * If NULL, then a word break iterator for the locale is used + * (or something equivalent). + * @param src The original string. + * @param sink A ByteSink to which the result string is written. + * sink.Flush() is called at the end. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * + * @see ucasemap_utf8ToTitle + * @draft ICU 60 + */ + static void utf8ToTitle( + const char *locale, uint32_t options, BreakIterator *iter, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode); + +#endif // UCONFIG_NO_BREAK_ITERATION + + /** + * Case-folds a UTF-8 string and optionally records edits. + * + * Case folding is locale-independent and not context-sensitive, + * but there is an option for whether to include or exclude mappings for dotted I + * and dotless i that are marked with 'T' in CaseFolding.txt. + * + * The result may be longer or shorter than the original. + * + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param sink A ByteSink to which the result string is written. + * sink.Flush() is called at the end. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * + * @see ucasemap_utf8FoldCase + * @draft ICU 60 + */ + static void utf8Fold( + uint32_t options, + StringPiece src, ByteSink &sink, Edits *edits, + UErrorCode &errorCode); + + /** + * Lowercases a UTF-8 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of bytes). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see ucasemap_utf8ToLower + * @draft ICU 59 + */ + static int32_t utf8ToLower( + const char *locale, uint32_t options, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + + /** + * Uppercases a UTF-8 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of bytes). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see ucasemap_utf8ToUpper + * @draft ICU 59 + */ + static int32_t utf8ToUpper( + const char *locale, uint32_t options, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + +#if !UCONFIG_NO_BREAK_ITERATION + + /** + * Titlecases a UTF-8 string and optionally records edits. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * Titlecasing uses a break iterator to find the first characters of words + * that are to be titlecased. It titlecases those characters and lowercases + * all others. (This can be modified with options bits.) + * + * @param locale The locale ID. ("" = root locale, NULL = default locale.) + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, + * U_TITLECASE_NO_LOWERCASE, + * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, + * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. + * @param iter A break iterator to find the first characters of words that are to be titlecased. + * It is set to the source string (setUText()) + * and used one or more times for iteration (first() and next()). + * If NULL, then a word break iterator for the locale is used + * (or something equivalent). + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of bytes). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see ucasemap_utf8ToTitle + * @draft ICU 59 + */ + static int32_t utf8ToTitle( + const char *locale, uint32_t options, BreakIterator *iter, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + +#endif // UCONFIG_NO_BREAK_ITERATION + + /** + * Case-folds a UTF-8 string and optionally records edits. + * + * Case folding is locale-independent and not context-sensitive, + * but there is an option for whether to include or exclude mappings for dotted I + * and dotless i that are marked with 'T' in CaseFolding.txt. + * + * The result may be longer or shorter than the original. + * The source string and the destination buffer must not overlap. + * + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, + * U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I. + * @param src The original string. + * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. + * @param dest A buffer for the result string. The result will be NUL-terminated if + * the buffer is large enough. + * The contents is undefined in case of failure. + * @param destCapacity The size of the buffer (number of bytes). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be NULL. + * @param errorCode Reference to an in/out error code value + * which must not indicate a failure before the function call. + * @return The length of the result string, if successful. + * When the result would be longer than destCapacity, + * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. + * + * @see ucasemap_utf8FoldCase + * @draft ICU 59 + */ + static int32_t utf8Fold( + uint32_t options, + const char *src, int32_t srcLength, + char *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode); + +private: + CaseMap() = delete; + CaseMap(const CaseMap &other) = delete; + CaseMap &operator=(const CaseMap &other) = delete; +}; + +#endif // U_HIDE_DRAFT_API + +U_NAMESPACE_END + +#endif // __CASEMAP_H__ diff --git a/deps/icu-small/source/common/unicode/char16ptr.h b/deps/icu-small/source/common/unicode/char16ptr.h new file mode 100644 index 00000000000000..5e694a14588ca0 --- /dev/null +++ b/deps/icu-small/source/common/unicode/char16ptr.h @@ -0,0 +1,311 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// char16ptr.h +// created: 2017feb28 Markus W. Scherer + +#ifndef __CHAR16PTR_H__ +#define __CHAR16PTR_H__ + +#include +#include "unicode/utypes.h" + +#if __cplusplus > 201000 +namespace std { + typedef decltype(nullptr) nullptr_t; +} +#endif +/** + * \file + * \brief C++ API: char16_t pointer wrappers with + * implicit conversion from bit-compatible raw pointer types. + * Also conversion functions from char16_t * to UChar * and OldUChar *. + */ + +U_NAMESPACE_BEGIN + +/** + * \def U_ALIASING_BARRIER + * Barrier for pointer anti-aliasing optimizations even across function boundaries. + * @internal + */ +#ifdef U_ALIASING_BARRIER + // Use the predefined value. +#elif (defined(__clang__) || defined(__GNUC__)) && U_PLATFORM != U_PF_BROWSER_NATIVE_CLIENT +# define U_ALIASING_BARRIER(ptr) asm volatile("" : : "rm"(ptr) : "memory") +#endif + +// Do not use #ifndef U_HIDE_DRAFT_API for the following class, it +// is now used in place of UChar* in several stable C++ methods +/** + * char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types. + * @draft ICU 59 + */ +class U_COMMON_API Char16Ptr U_FINAL { +public: + /** + * Copies the pointer. + * @param p pointer + * @draft ICU 59 + */ + inline Char16Ptr(char16_t *p); +#if !U_CHAR16_IS_TYPEDEF + /** + * Converts the pointer to char16_t *. + * @param p pointer to be converted + * @draft ICU 59 + */ + inline Char16Ptr(uint16_t *p); +#endif +#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN) + /** + * Converts the pointer to char16_t *. + * (Only defined if U_SIZEOF_WCHAR_T==2.) + * @param p pointer to be converted + * @draft ICU 59 + */ + inline Char16Ptr(wchar_t *p); +#endif + /** + * nullptr constructor. + * @param p nullptr + * @draft ICU 59 + */ + inline Char16Ptr(std::nullptr_t p); + /** + * Destructor. + * @draft ICU 59 + */ + inline ~Char16Ptr(); + + /** + * Pointer access. + * @return the wrapped pointer + * @draft ICU 59 + */ + inline char16_t *get() const; + /** + * char16_t pointer access via type conversion (e.g., static_cast). + * @return the wrapped pointer + * @draft ICU 59 + */ + inline operator char16_t *() const { return get(); } + +private: + Char16Ptr() = delete; + +#ifdef U_ALIASING_BARRIER + template static char16_t *cast(T *t) { + U_ALIASING_BARRIER(t); + return reinterpret_cast(t); + } + + char16_t *p_; +#else + union { + char16_t *cp; + uint16_t *up; + wchar_t *wp; + } u_; +#endif +}; + +#ifdef U_ALIASING_BARRIER + +Char16Ptr::Char16Ptr(char16_t *p) : p_(p) {} +#if !U_CHAR16_IS_TYPEDEF +Char16Ptr::Char16Ptr(uint16_t *p) : p_(cast(p)) {} +#endif +#if U_SIZEOF_WCHAR_T==2 +Char16Ptr::Char16Ptr(wchar_t *p) : p_(cast(p)) {} +#endif +Char16Ptr::Char16Ptr(std::nullptr_t p) : p_(p) {} +Char16Ptr::~Char16Ptr() { + U_ALIASING_BARRIER(p_); +} + +char16_t *Char16Ptr::get() const { return p_; } + +#else + +Char16Ptr::Char16Ptr(char16_t *p) { u_.cp = p; } +#if !U_CHAR16_IS_TYPEDEF +Char16Ptr::Char16Ptr(uint16_t *p) { u_.up = p; } +#endif +#if U_SIZEOF_WCHAR_T==2 +Char16Ptr::Char16Ptr(wchar_t *p) { u_.wp = p; } +#endif +Char16Ptr::Char16Ptr(std::nullptr_t p) { u_.cp = p; } +Char16Ptr::~Char16Ptr() {} + +char16_t *Char16Ptr::get() const { return u_.cp; } + +#endif + +// Do not use #ifndef U_HIDE_DRAFT_API for the following class, it is +// now used in place of const UChar* in several stable C++ methods +/** + * const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types. + * @draft ICU 59 + */ +class U_COMMON_API ConstChar16Ptr U_FINAL { +public: + /** + * Copies the pointer. + * @param p pointer + * @draft ICU 59 + */ + inline ConstChar16Ptr(const char16_t *p); +#if !U_CHAR16_IS_TYPEDEF + /** + * Converts the pointer to char16_t *. + * @param p pointer to be converted + * @draft ICU 59 + */ + inline ConstChar16Ptr(const uint16_t *p); +#endif +#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN) + /** + * Converts the pointer to char16_t *. + * (Only defined if U_SIZEOF_WCHAR_T==2.) + * @param p pointer to be converted + * @draft ICU 59 + */ + inline ConstChar16Ptr(const wchar_t *p); +#endif + /** + * nullptr constructor. + * @param p nullptr + * @draft ICU 59 + */ + inline ConstChar16Ptr(const std::nullptr_t p); + + /** + * Destructor. + * @draft ICU 59 + */ + inline ~ConstChar16Ptr(); + + /** + * Pointer access. + * @return the wrapped pointer + * @draft ICU 59 + */ + inline const char16_t *get() const; + /** + * char16_t pointer access via type conversion (e.g., static_cast). + * @return the wrapped pointer + * @draft ICU 59 + */ + inline operator const char16_t *() const { return get(); } + +private: + ConstChar16Ptr() = delete; + +#ifdef U_ALIASING_BARRIER + template static const char16_t *cast(const T *t) { + U_ALIASING_BARRIER(t); + return reinterpret_cast(t); + } + + const char16_t *p_; +#else + union { + const char16_t *cp; + const uint16_t *up; + const wchar_t *wp; + } u_; +#endif +}; + +#ifdef U_ALIASING_BARRIER + +ConstChar16Ptr::ConstChar16Ptr(const char16_t *p) : p_(p) {} +#if !U_CHAR16_IS_TYPEDEF +ConstChar16Ptr::ConstChar16Ptr(const uint16_t *p) : p_(cast(p)) {} +#endif +#if U_SIZEOF_WCHAR_T==2 +ConstChar16Ptr::ConstChar16Ptr(const wchar_t *p) : p_(cast(p)) {} +#endif +ConstChar16Ptr::ConstChar16Ptr(const std::nullptr_t p) : p_(p) {} +ConstChar16Ptr::~ConstChar16Ptr() { + U_ALIASING_BARRIER(p_); +} + +const char16_t *ConstChar16Ptr::get() const { return p_; } + +#else + +ConstChar16Ptr::ConstChar16Ptr(const char16_t *p) { u_.cp = p; } +#if !U_CHAR16_IS_TYPEDEF +ConstChar16Ptr::ConstChar16Ptr(const uint16_t *p) { u_.up = p; } +#endif +#if U_SIZEOF_WCHAR_T==2 +ConstChar16Ptr::ConstChar16Ptr(const wchar_t *p) { u_.wp = p; } +#endif +ConstChar16Ptr::ConstChar16Ptr(const std::nullptr_t p) { u_.cp = p; } +ConstChar16Ptr::~ConstChar16Ptr() {} + +const char16_t *ConstChar16Ptr::get() const { return u_.cp; } + +#endif + +/** + * Converts from const char16_t * to const UChar *. + * Includes an aliasing barrier if available. + * @param p pointer + * @return p as const UChar * + * @draft ICU 59 + */ +inline const UChar *toUCharPtr(const char16_t *p) { +#ifdef U_ALIASING_BARRIER + U_ALIASING_BARRIER(p); +#endif + return reinterpret_cast(p); +} + +/** + * Converts from char16_t * to UChar *. + * Includes an aliasing barrier if available. + * @param p pointer + * @return p as UChar * + * @draft ICU 59 + */ +inline UChar *toUCharPtr(char16_t *p) { +#ifdef U_ALIASING_BARRIER + U_ALIASING_BARRIER(p); +#endif + return reinterpret_cast(p); +} + +/** + * Converts from const char16_t * to const OldUChar *. + * Includes an aliasing barrier if available. + * @param p pointer + * @return p as const OldUChar * + * @draft ICU 59 + */ +inline const OldUChar *toOldUCharPtr(const char16_t *p) { +#ifdef U_ALIASING_BARRIER + U_ALIASING_BARRIER(p); +#endif + return reinterpret_cast(p); +} + +/** + * Converts from char16_t * to OldUChar *. + * Includes an aliasing barrier if available. + * @param p pointer + * @return p as OldUChar * + * @draft ICU 59 + */ +inline OldUChar *toOldUCharPtr(char16_t *p) { +#ifdef U_ALIASING_BARRIER + U_ALIASING_BARRIER(p); +#endif + return reinterpret_cast(p); +} + +U_NAMESPACE_END + +#endif // __CHAR16PTR_H__ diff --git a/deps/icu-small/source/common/unicode/chariter.h b/deps/icu-small/source/common/unicode/chariter.h index 7c6f98f640eada..dbed89dbe61e0b 100644 --- a/deps/icu-small/source/common/unicode/chariter.h +++ b/deps/icu-small/source/common/unicode/chariter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************** @@ -78,7 +78,7 @@ U_NAMESPACE_BEGIN * } * * void function1(ForwardCharacterIterator &it) { - * UChar c; + * char16_t c; * while((c=it.nextPostInc())!=ForwardCharacterIterator::DONE) { * // use c * } @@ -149,7 +149,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * @return the current code unit. * @stable ICU 2.0 */ - virtual UChar nextPostInc(void) = 0; + virtual char16_t nextPostInc(void) = 0; /** * Gets the current code point for returning and advances to the next code point @@ -230,7 +230,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * showing a way to convert simple for() loops: * \code * void forward2(CharacterIterator &it) { - * UChar c; + * char16_t c; * for(c=it.firstPostInc(); c!=CharacterIterator::DONE; c=it.nextPostInc()) { * // use c * } @@ -249,7 +249,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * Backward iteration with a more traditional for() loop: * \code * void backward2(CharacterIterator &it) { - * UChar c; + * char16_t c; * for(c=it.last(); c!=CharacterIterator::DONE; c=it.previous()) { * // use c * } @@ -266,7 +266,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * // get the position * int32_t pos=it.getIndex(); * // get the previous code unit - * UChar u=it.previous(); + * char16_t u=it.previous(); * // move back one more code unit * it.move(-1, CharacterIterator::kCurrent); * // set the position back to where it was @@ -283,7 +283,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject { * Function processing characters, in this example simple output *

  * \code
- *  void processChar( UChar c )
+ *  void processChar( char16_t c )
  *  {
  *      cout << " " << c;
  *  }
@@ -294,7 +294,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject {
  * \code
  *  void traverseForward(CharacterIterator& iter)
  *  {
- *      for(UChar c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
+ *      for(char16_t c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
  *          processChar(c);
  *      }
  *  }
@@ -305,7 +305,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject {
  * \code
  *  void traverseBackward(CharacterIterator& iter)
  *  {
- *      for(UChar c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
+ *      for(char16_t c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
  *          processChar(c);
  *      }
  *  }
@@ -317,7 +317,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject {
  * \code
  * void traverseOut(CharacterIterator& iter, int32_t pos)
  * {
- *      UChar c;
+ *      char16_t c;
  *      for (c = iter.setIndex(pos);
  *      c != CharacterIterator.DONE && (Unicode::isLetter(c) || Unicode::isDigit(c));
  *          c = iter.next()) {}
@@ -386,7 +386,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the first code unit in its iteration range.
      * @stable ICU 2.0
      */
-    virtual UChar         first(void) = 0;
+    virtual char16_t         first(void) = 0;
 
     /**
      * Sets the iterator to refer to the first code unit in its
@@ -396,7 +396,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the first code unit in its iteration range.
      * @stable ICU 2.0
      */
-    virtual UChar         firstPostInc(void);
+    virtual char16_t         firstPostInc(void);
 
     /**
      * Sets the iterator to refer to the first code point in its
@@ -435,7 +435,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the last code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         last(void) = 0;
+    virtual char16_t         last(void) = 0;
 
     /**
      * Sets the iterator to refer to the last code point in its
@@ -463,7 +463,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the "position"-th code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         setIndex(int32_t position) = 0;
+    virtual char16_t         setIndex(int32_t position) = 0;
 
     /**
      * Sets the iterator to refer to the beginning of the code point
@@ -483,7 +483,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the current code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         current(void) const = 0;
+    virtual char16_t         current(void) const = 0;
 
     /**
      * Returns the code point the iterator currently refers to.
@@ -499,7 +499,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the next code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         next(void) = 0;
+    virtual char16_t         next(void) = 0;
 
     /**
      * Advances to the next code point in the iteration range
@@ -520,7 +520,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the previous code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         previous(void) = 0;
+    virtual char16_t         previous(void) = 0;
 
     /**
      * Advances to the previous code point in the iteration range
@@ -607,6 +607,10 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
      * @return the new position
      * @stable ICU 2.0
      */
+#ifdef move32
+     // One of the system headers right now is sometimes defining a conflicting macro we don't use
+#undef move32
+#endif
     virtual int32_t      move32(int32_t delta, EOrigin origin) = 0;
 
     /**
diff --git a/deps/icu-small/source/common/unicode/dbbi.h b/deps/icu-small/source/common/unicode/dbbi.h
index be9618c551c7dc..62509c5227b9da 100644
--- a/deps/icu-small/source/common/unicode/dbbi.h
+++ b/deps/icu-small/source/common/unicode/dbbi.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 /*
 **********************************************************************
diff --git a/deps/icu-small/source/common/unicode/docmain.h b/deps/icu-small/source/common/unicode/docmain.h
index 7b053b04640df2..3e645aee4a87fb 100644
--- a/deps/icu-small/source/common/unicode/docmain.h
+++ b/deps/icu-small/source/common/unicode/docmain.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 /********************************************************************
  * COPYRIGHT:
@@ -98,6 +98,11 @@
  *     C API
  *   
  *   
+ *     Codepage Detection
+ *     ucsdet.h
+ *     C API
+ *   
+ *   
  *     Unicode Text Compression
  *     ucnv.h
(encoding name "SCSU" or "BOCU-1") * C API @@ -135,7 +140,7 @@ * * Number Formatting * unum.h - * icu::NumberFormat + * icu::number::NumberFormatter (ICU 60+) or icu::NumberFormat (older versions) * * * Number Spellout
(Rule Based Number Formatting) diff --git a/deps/icu-small/source/common/unicode/dtintrv.h b/deps/icu-small/source/common/unicode/dtintrv.h index c16ee63d9632e6..2221b36c9b293f 100644 --- a/deps/icu-small/source/common/unicode/dtintrv.h +++ b/deps/icu-small/source/common/unicode/dtintrv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/unicode/edits.h b/deps/icu-small/source/common/unicode/edits.h new file mode 100644 index 00000000000000..082c3733a88bda --- /dev/null +++ b/deps/icu-small/source/common/unicode/edits.h @@ -0,0 +1,422 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// edits.h +// created: 2016dec30 Markus W. Scherer + +#ifndef __EDITS_H__ +#define __EDITS_H__ + +#include "unicode/utypes.h" +#include "unicode/uobject.h" + +/** + * \file + * \brief C++ API: C++ class Edits for low-level string transformations on styled text. + */ + +U_NAMESPACE_BEGIN + +#ifndef U_HIDE_DRAFT_API + +/** + * Records lengths of string edits but not replacement text. + * Supports replacements, insertions, deletions in linear progression. + * Does not support moving/reordering of text. + * + * An Edits object tracks a separate UErrorCode, but ICU string transformation functions + * (e.g., case mapping functions) merge any such errors into their API's UErrorCode. + * + * @draft ICU 59 + */ +class U_COMMON_API Edits U_FINAL : public UMemory { +public: + /** + * Constructs an empty object. + * @draft ICU 59 + */ + Edits() : + array(stackArray), capacity(STACK_CAPACITY), length(0), delta(0), numChanges(0), + errorCode_(U_ZERO_ERROR) {} + /** + * Copy constructor. + * @param other source edits + * @draft ICU 60 + */ + Edits(const Edits &other) : + array(stackArray), capacity(STACK_CAPACITY), length(other.length), + delta(other.delta), numChanges(other.numChanges), + errorCode_(other.errorCode_) { + copyArray(other); + } + /** + * Move constructor, might leave src empty. + * This object will have the same contents that the source object had. + * @param src source edits + * @draft ICU 60 + */ + Edits(Edits &&src) U_NOEXCEPT : + array(stackArray), capacity(STACK_CAPACITY), length(src.length), + delta(src.delta), numChanges(src.numChanges), + errorCode_(src.errorCode_) { + moveArray(src); + } + + /** + * Destructor. + * @draft ICU 59 + */ + ~Edits(); + + /** + * Assignment operator. + * @param other source edits + * @return *this + * @draft ICU 60 + */ + Edits &operator=(const Edits &other); + + /** + * Move assignment operator, might leave src empty. + * This object will have the same contents that the source object had. + * The behavior is undefined if *this and src are the same object. + * @param src source edits + * @return *this + * @draft ICU 60 + */ + Edits &operator=(Edits &&src) U_NOEXCEPT; + + /** + * Resets the data but may not release memory. + * @draft ICU 59 + */ + void reset() U_NOEXCEPT; + + /** + * Adds a record for an unchanged segment of text. + * Normally called from inside ICU string transformation functions, not user code. + * @draft ICU 59 + */ + void addUnchanged(int32_t unchangedLength); + /** + * Adds a record for a text replacement/insertion/deletion. + * Normally called from inside ICU string transformation functions, not user code. + * @draft ICU 59 + */ + void addReplace(int32_t oldLength, int32_t newLength); + /** + * Sets the UErrorCode if an error occurred while recording edits. + * Preserves older error codes in the outErrorCode. + * Normally called from inside ICU string transformation functions, not user code. + * @param outErrorCode Set to an error code if it does not contain one already + * and an error occurred while recording edits. + * Otherwise unchanged. + * @return TRUE if U_FAILURE(outErrorCode) + * @draft ICU 59 + */ + UBool copyErrorTo(UErrorCode &outErrorCode); + + /** + * How much longer is the new text compared with the old text? + * @return new length minus old length + * @draft ICU 59 + */ + int32_t lengthDelta() const { return delta; } + /** + * @return TRUE if there are any change edits + * @draft ICU 59 + */ + UBool hasChanges() const { return numChanges != 0; } + + /** + * @return the number of change edits + * @draft ICU 60 + */ + int32_t numberOfChanges() const { return numChanges; } + + /** + * Access to the list of edits. + * @see getCoarseIterator + * @see getFineIterator + * @draft ICU 59 + */ + struct U_COMMON_API Iterator U_FINAL : public UMemory { + /** + * Default constructor, empty iterator. + * @draft ICU 60 + */ + Iterator() : + array(nullptr), index(0), length(0), + remaining(0), onlyChanges_(FALSE), coarse(FALSE), + dir(0), changed(FALSE), oldLength_(0), newLength_(0), + srcIndex(0), replIndex(0), destIndex(0) {} + /** + * Copy constructor. + * @draft ICU 59 + */ + Iterator(const Iterator &other) = default; + /** + * Assignment operator. + * @draft ICU 59 + */ + Iterator &operator=(const Iterator &other) = default; + + /** + * Advances to the next edit. + * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test, + * or else the function returns immediately. Check for U_FAILURE() + * on output or use with function chaining. (See User Guide for details.) + * @return TRUE if there is another edit + * @draft ICU 59 + */ + UBool next(UErrorCode &errorCode) { return next(onlyChanges_, errorCode); } + + /** + * Finds the edit that contains the source index. + * The source index may be found in a non-change + * even if normal iteration would skip non-changes. + * Normal iteration can continue from a found edit. + * + * The iterator state before this search logically does not matter. + * (It may affect the performance of the search.) + * + * The iterator state after this search is undefined + * if the source index is out of bounds for the source string. + * + * @param i source index + * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test, + * or else the function returns immediately. Check for U_FAILURE() + * on output or use with function chaining. (See User Guide for details.) + * @return TRUE if the edit for the source index was found + * @draft ICU 59 + */ + UBool findSourceIndex(int32_t i, UErrorCode &errorCode) { + return findIndex(i, TRUE, errorCode) == 0; + } + + /** + * Finds the edit that contains the destination index. + * The destination index may be found in a non-change + * even if normal iteration would skip non-changes. + * Normal iteration can continue from a found edit. + * + * The iterator state before this search logically does not matter. + * (It may affect the performance of the search.) + * + * The iterator state after this search is undefined + * if the source index is out of bounds for the source string. + * + * @param i destination index + * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test, + * or else the function returns immediately. Check for U_FAILURE() + * on output or use with function chaining. (See User Guide for details.) + * @return TRUE if the edit for the destination index was found + * @draft ICU 60 + */ + UBool findDestinationIndex(int32_t i, UErrorCode &errorCode) { + return findIndex(i, FALSE, errorCode) == 0; + } + + /** + * Returns the destination index corresponding to the given source index. + * If the source index is inside a change edit (not at its start), + * then the destination index at the end of that edit is returned, + * since there is no information about index mapping inside a change edit. + * + * (This means that indexes to the start and middle of an edit, + * for example around a grapheme cluster, are mapped to indexes + * encompassing the entire edit. + * The alternative, mapping an interior index to the start, + * would map such an interval to an empty one.) + * + * This operation will usually but not always modify this object. + * The iterator state after this search is undefined. + * + * @param i source index + * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test, + * or else the function returns immediately. Check for U_FAILURE() + * on output or use with function chaining. (See User Guide for details.) + * @return destination index; undefined if i is not 0..string length + * @draft ICU 60 + */ + int32_t destinationIndexFromSourceIndex(int32_t i, UErrorCode &errorCode); + + /** + * Returns the source index corresponding to the given destination index. + * If the destination index is inside a change edit (not at its start), + * then the source index at the end of that edit is returned, + * since there is no information about index mapping inside a change edit. + * + * (This means that indexes to the start and middle of an edit, + * for example around a grapheme cluster, are mapped to indexes + * encompassing the entire edit. + * The alternative, mapping an interior index to the start, + * would map such an interval to an empty one.) + * + * This operation will usually but not always modify this object. + * The iterator state after this search is undefined. + * + * @param i destination index + * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test, + * or else the function returns immediately. Check for U_FAILURE() + * on output or use with function chaining. (See User Guide for details.) + * @return source index; undefined if i is not 0..string length + * @draft ICU 60 + */ + int32_t sourceIndexFromDestinationIndex(int32_t i, UErrorCode &errorCode); + + /** + * @return TRUE if this edit replaces oldLength() units with newLength() different ones. + * FALSE if oldLength units remain unchanged. + * @draft ICU 59 + */ + UBool hasChange() const { return changed; } + /** + * @return the number of units in the original string which are replaced or remain unchanged. + * @draft ICU 59 + */ + int32_t oldLength() const { return oldLength_; } + /** + * @return the number of units in the modified string, if hasChange() is TRUE. + * Same as oldLength if hasChange() is FALSE. + * @draft ICU 59 + */ + int32_t newLength() const { return newLength_; } + + /** + * @return the current index into the source string + * @draft ICU 59 + */ + int32_t sourceIndex() const { return srcIndex; } + /** + * @return the current index into the replacement-characters-only string, + * not counting unchanged spans + * @draft ICU 59 + */ + int32_t replacementIndex() const { return replIndex; } + /** + * @return the current index into the full destination string + * @draft ICU 59 + */ + int32_t destinationIndex() const { return destIndex; } + + private: + friend class Edits; + + Iterator(const uint16_t *a, int32_t len, UBool oc, UBool crs); + + int32_t readLength(int32_t head); + void updateNextIndexes(); + void updatePreviousIndexes(); + UBool noNext(); + UBool next(UBool onlyChanges, UErrorCode &errorCode); + UBool previous(UErrorCode &errorCode); + /** @return -1: error or i<0; 0: found; 1: i>=string length */ + int32_t findIndex(int32_t i, UBool findSource, UErrorCode &errorCode); + + const uint16_t *array; + int32_t index, length; + // 0 if we are not within compressed equal-length changes. + // Otherwise the number of remaining changes, including the current one. + int32_t remaining; + UBool onlyChanges_, coarse; + + int8_t dir; // iteration direction: back(<0), initial(0), forward(>0) + UBool changed; + int32_t oldLength_, newLength_; + int32_t srcIndex, replIndex, destIndex; + }; + + /** + * Returns an Iterator for coarse-grained changes for simple string updates. + * Skips non-changes. + * @return an Iterator that merges adjacent changes. + * @draft ICU 59 + */ + Iterator getCoarseChangesIterator() const { + return Iterator(array, length, TRUE, TRUE); + } + + /** + * Returns an Iterator for coarse-grained changes and non-changes for simple string updates. + * @return an Iterator that merges adjacent changes. + * @draft ICU 59 + */ + Iterator getCoarseIterator() const { + return Iterator(array, length, FALSE, TRUE); + } + + /** + * Returns an Iterator for fine-grained changes for modifying styled text. + * Skips non-changes. + * @return an Iterator that separates adjacent changes. + * @draft ICU 59 + */ + Iterator getFineChangesIterator() const { + return Iterator(array, length, TRUE, FALSE); + } + + /** + * Returns an Iterator for fine-grained changes and non-changes for modifying styled text. + * @return an Iterator that separates adjacent changes. + * @draft ICU 59 + */ + Iterator getFineIterator() const { + return Iterator(array, length, FALSE, FALSE); + } + + /** + * Merges the two input Edits and appends the result to this object. + * + * Consider two string transformations (for example, normalization and case mapping) + * where each records Edits in addition to writing an output string.
+ * Edits ab reflect how substrings of input string a + * map to substrings of intermediate string b.
+ * Edits bc reflect how substrings of intermediate string b + * map to substrings of output string c.
+ * This function merges ab and bc such that the additional edits + * recorded in this object reflect how substrings of input string a + * map to substrings of output string c. + * + * If unrelated Edits are passed in where the output string of the first + * has a different length than the input string of the second, + * then a U_ILLEGAL_ARGUMENT_ERROR is reported. + * + * @param ab reflects how substrings of input string a + * map to substrings of intermediate string b. + * @param bc reflects how substrings of intermediate string b + * map to substrings of output string c. + * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test, + * or else the function returns immediately. Check for U_FAILURE() + * on output or use with function chaining. (See User Guide for details.) + * @return *this, with the merged edits appended + * @draft ICU 60 + */ + Edits &mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &errorCode); + +private: + void releaseArray() U_NOEXCEPT; + Edits ©Array(const Edits &other); + Edits &moveArray(Edits &src) U_NOEXCEPT; + + void setLastUnit(int32_t last) { array[length - 1] = (uint16_t)last; } + int32_t lastUnit() const { return length > 0 ? array[length - 1] : 0xffff; } + + void append(int32_t r); + UBool growArray(); + + static const int32_t STACK_CAPACITY = 100; + uint16_t *array; + int32_t capacity; + int32_t length; + int32_t delta; + int32_t numChanges; + UErrorCode errorCode_; + uint16_t stackArray[STACK_CAPACITY]; +}; + +#endif // U_HIDE_DRAFT_API + +U_NAMESPACE_END + +#endif // __EDITS_H__ diff --git a/deps/icu-small/source/common/unicode/enumset.h b/deps/icu-small/source/common/unicode/enumset.h index e7c39c40dd2586..82b2074ec35875 100644 --- a/deps/icu-small/source/common/unicode/enumset.h +++ b/deps/icu-small/source/common/unicode/enumset.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unicode/errorcode.h b/deps/icu-small/source/common/unicode/errorcode.h index 92feb2b1b6b87e..1e5df8f03e88fe 100644 --- a/deps/icu-small/source/common/unicode/errorcode.h +++ b/deps/icu-small/source/common/unicode/errorcode.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: errorcode.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/filteredbrk.h b/deps/icu-small/source/common/unicode/filteredbrk.h index 261151138cdc8f..a0319bf0a76af5 100644 --- a/deps/icu-small/source/common/unicode/filteredbrk.h +++ b/deps/icu-small/source/common/unicode/filteredbrk.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -55,14 +55,30 @@ class U_COMMON_API FilteredBreakIteratorBuilder : public UObject { */ static FilteredBreakIteratorBuilder *createInstance(const Locale& where, UErrorCode& status); +#ifndef U_HIDE_DEPRECATED_API + /** + * This function has been deprecated in favor of createEmptyInstance, which has + * identical behavior. + * @param status The error code. + * @return the new builder + * @deprecated ICU 60 use createEmptyInstance instead + * @see createEmptyInstance() + */ + static inline FilteredBreakIteratorBuilder *createInstance(UErrorCode &status) { + return createEmptyInstance(status); + } +#endif /* U_HIDE_DEPRECATED_API */ + +#ifndef U_HIDE_DRAFT_API /** * Construct an empty FilteredBreakIteratorBuilder. * In this state, it will not suppress any segment boundaries. * @param status The error code. * @return the new builder - * @stable ICU 56 + * @draft ICU 60 */ - static FilteredBreakIteratorBuilder *createInstance(UErrorCode &status); + static FilteredBreakIteratorBuilder *createEmptyInstance(UErrorCode &status); +#endif /* U_HIDE_DRAFT_API */ /** * Suppress a certain string from being the end of a segment. @@ -89,6 +105,20 @@ class U_COMMON_API FilteredBreakIteratorBuilder : public UObject { */ virtual UBool unsuppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0; +#ifndef U_HIDE_DEPRECATED_API + /** + * This function has been deprecated in favor of wrapIteratorWithFilter() + * The behavior is identical. + * @param adoptBreakIterator the break iterator to adopt + * @param status error code + * @return the new BreakIterator, owned by the caller. + * @deprecated ICU 60 use wrapIteratorWithFilter() instead + * @see wrapBreakIteratorWithFilter() + */ + virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status) = 0; +#endif /* U_HIDE_DEPRECATED_API */ + +#ifndef U_HIDE_DRAFT_API /** * Wrap (adopt) an existing break iterator in a new filtered instance. * The resulting BreakIterator is owned by the caller. @@ -96,12 +126,16 @@ class U_COMMON_API FilteredBreakIteratorBuilder : public UObject { * Note that the adoptBreakIterator is adopted by the new BreakIterator * and should no longer be used by the caller. * The FilteredBreakIteratorBuilder may be reused. + * This function is an alias for build() * @param adoptBreakIterator the break iterator to adopt * @param status error code * @return the new BreakIterator, owned by the caller. - * @stable ICU 56 + * @draft ICU 60 */ - virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status) = 0; + inline BreakIterator *wrapIteratorWithFilter(BreakIterator* adoptBreakIterator, UErrorCode& status) { + return build(adoptBreakIterator, status); + } +#endif /* U_HIDE_DRAFT_API */ protected: /** diff --git a/deps/icu-small/source/common/unicode/icudataver.h b/deps/icu-small/source/common/unicode/icudataver.h index c5c44fc0754f15..d5c728da880f8f 100644 --- a/deps/icu-small/source/common/unicode/icudataver.h +++ b/deps/icu-small/source/common/unicode/icudataver.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unicode/icuplug.h b/deps/icu-small/source/common/unicode/icuplug.h index ff5e054d38e24b..2a11b96be69c53 100644 --- a/deps/icu-small/source/common/unicode/icuplug.h +++ b/deps/icu-small/source/common/unicode/icuplug.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unicode/idna.h b/deps/icu-small/source/common/unicode/idna.h index 23a1d7ca0e8441..f08658e502e200 100644 --- a/deps/icu-small/source/common/unicode/idna.h +++ b/deps/icu-small/source/common/unicode/idna.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: idna.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/listformatter.h b/deps/icu-small/source/common/unicode/listformatter.h index f2c898881a7939..180fbcb5cde5b7 100644 --- a/deps/icu-small/source/common/unicode/listformatter.h +++ b/deps/icu-small/source/common/unicode/listformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: listformatter.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -157,6 +157,8 @@ class U_COMMON_API ListFormatter : public UObject{ private: static void initializeHash(UErrorCode& errorCode); static const ListFormatInternal* getListFormatInternal(const Locale& locale, const char *style, UErrorCode& errorCode); + struct ListPatternsSink; + static ListFormatInternal* loadListFormatInternal(const Locale& locale, const char* style, UErrorCode& errorCode); ListFormatter(); diff --git a/deps/icu-small/source/common/unicode/localpointer.h b/deps/icu-small/source/common/unicode/localpointer.h index 9ac5de5f06d751..e17ee3d886ef34 100644 --- a/deps/icu-small/source/common/unicode/localpointer.h +++ b/deps/icu-small/source/common/unicode/localpointer.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: localpointer.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -174,9 +174,9 @@ class LocalPointerBase { * \code * LocalPointer s(new UnicodeString((UChar32)0x50005)); * int32_t length=s->length(); // 2 - * UChar lead=s->charAt(0); // 0xd900 + * char16_t lead=s->charAt(0); // 0xd900 * if(some condition) { return; } // no need to explicitly delete the pointer - * s.adoptInstead(new UnicodeString((UChar)0xfffc)); + * s.adoptInstead(new UnicodeString((char16_t)0xfffc)); * length=s->length(); // 1 * // no need to explicitly delete the pointer * \endcode @@ -213,7 +213,6 @@ class LocalPointer : public LocalPointerBase { errorCode=U_MEMORY_ALLOCATION_ERROR; } } -#if U_HAVE_RVALUE_REFERENCES /** * Move constructor, leaves src with isNull(). * @param src source smart pointer @@ -222,7 +221,6 @@ class LocalPointer : public LocalPointerBase { LocalPointer(LocalPointer &&src) U_NOEXCEPT : LocalPointerBase(src.ptr) { src.ptr=NULL; } -#endif /** * Destructor deletes the object it owns. * @stable ICU 4.4 @@ -230,7 +228,6 @@ class LocalPointer : public LocalPointerBase { ~LocalPointer() { delete LocalPointerBase::ptr; } -#if U_HAVE_RVALUE_REFERENCES /** * Move assignment operator, leaves src with isNull(). * The behavior is undefined if *this and src are the same object. @@ -241,7 +238,6 @@ class LocalPointer : public LocalPointerBase { LocalPointer &operator=(LocalPointer &&src) U_NOEXCEPT { return moveFrom(src); } -#endif // do not use #ifndef U_HIDE_DRAFT_API for moveFrom, needed by non-draft API /** * Move assignment, leaves src with isNull(). @@ -323,10 +319,10 @@ class LocalPointer : public LocalPointerBase { * Usage example: * \code * LocalArray a(new UnicodeString[2]); - * a[0].append((UChar)0x61); + * a[0].append((char16_t)0x61); * if(some condition) { return; } // no need to explicitly delete the array * 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(); * // no need to explicitly delete the array * \endcode * @@ -362,7 +358,6 @@ class LocalArray : public LocalPointerBase { errorCode=U_MEMORY_ALLOCATION_ERROR; } } -#if U_HAVE_RVALUE_REFERENCES /** * Move constructor, leaves src with isNull(). * @param src source smart pointer @@ -371,7 +366,6 @@ class LocalArray : public LocalPointerBase { LocalArray(LocalArray &&src) U_NOEXCEPT : LocalPointerBase(src.ptr) { src.ptr=NULL; } -#endif /** * Destructor deletes the array it owns. * @stable ICU 4.4 @@ -379,7 +373,6 @@ class LocalArray : public LocalPointerBase { ~LocalArray() { delete[] LocalPointerBase::ptr; } -#if U_HAVE_RVALUE_REFERENCES /** * Move assignment operator, leaves src with isNull(). * The behavior is undefined if *this and src are the same object. @@ -390,7 +383,6 @@ class LocalArray : public LocalPointerBase { LocalArray &operator=(LocalArray &&src) U_NOEXCEPT { return moveFrom(src); } -#endif // do not use #ifndef U_HIDE_DRAFT_API for moveFrom, needed by non-draft API /** * Move assignment, leaves src with isNull(). @@ -492,7 +484,6 @@ class LocalArray : public LocalPointerBase { * @see LocalPointer * @stable ICU 4.4 */ -#if U_HAVE_RVALUE_REFERENCES #define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \ class LocalPointerClassName : public LocalPointerBase { \ public: \ @@ -526,34 +517,6 @@ class LocalArray : public LocalPointerBase { ptr=p; \ } \ } -#else -#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \ - class LocalPointerClassName : public LocalPointerBase { \ - public: \ - using LocalPointerBase::operator*; \ - using LocalPointerBase::operator->; \ - explicit LocalPointerClassName(Type *p=NULL) : LocalPointerBase(p) {} \ - ~LocalPointerClassName() { closeFunction(ptr); } \ - LocalPointerClassName &moveFrom(LocalPointerClassName &src) U_NOEXCEPT { \ - if (ptr != NULL) { closeFunction(ptr); } \ - LocalPointerBase::ptr=src.ptr; \ - src.ptr=NULL; \ - return *this; \ - } \ - void swap(LocalPointerClassName &other) U_NOEXCEPT { \ - Type *temp=LocalPointerBase::ptr; \ - LocalPointerBase::ptr=other.ptr; \ - other.ptr=temp; \ - } \ - friend inline void swap(LocalPointerClassName &p1, LocalPointerClassName &p2) U_NOEXCEPT { \ - p1.swap(p2); \ - } \ - void adoptInstead(Type *p) { \ - if (ptr != NULL) { closeFunction(ptr); } \ - ptr=p; \ - } \ - } -#endif U_NAMESPACE_END diff --git a/deps/icu-small/source/common/unicode/locdspnm.h b/deps/icu-small/source/common/unicode/locdspnm.h index b8c7a0ccae9281..7f227829b4cc00 100644 --- a/deps/icu-small/source/common/unicode/locdspnm.h +++ b/deps/icu-small/source/common/unicode/locdspnm.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -20,6 +20,7 @@ #if !UCONFIG_NO_FORMATTING #include "unicode/locid.h" +#include "unicode/strenum.h" #include "unicode/uscript.h" #include "unicode/uldnames.h" #include "unicode/udisplaycontext.h" diff --git a/deps/icu-small/source/common/unicode/locid.h b/deps/icu-small/source/common/unicode/locid.h index f797c25e8b6069..c752344f339db1 100644 --- a/deps/icu-small/source/common/unicode/locid.h +++ b/deps/icu-small/source/common/unicode/locid.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -33,10 +33,8 @@ #include "unicode/utypes.h" #include "unicode/uobject.h" -#include "unicode/unistr.h" #include "unicode/putil.h" #include "unicode/uloc.h" -#include "unicode/strenum.h" /** * \file @@ -48,6 +46,9 @@ U_NAMESPACE_BEGIN // Forward Declarations void U_CALLCONV locale_available_init(); /**< @internal */ +class StringEnumeration; +class UnicodeString; + /** * A Locale object represents a specific geographical, political, * or cultural region. An operation that requires a Locale to perform @@ -87,7 +88,7 @@ void U_CALLCONV locale_available_init(); /**< @internal */ *

* The third constructor requires a third argument--the Variant. * The Variant codes are vendor and browser-specific. - * For example, use REVISED for a langauge's revised script orthography, and POSIX for POSIX. + * For example, use REVISED for a language's revised script orthography, and POSIX for POSIX. * Where there are two variants, separate them with an underscore, and * put the most important one first. For * example, a Traditional Spanish collation might be referenced, with diff --git a/deps/icu-small/source/common/unicode/messagepattern.h b/deps/icu-small/source/common/unicode/messagepattern.h index 8c1115e04dc1db..f28adafee0d2ac 100644 --- a/deps/icu-small/source/common/unicode/messagepattern.h +++ b/deps/icu-small/source/common/unicode/messagepattern.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: messagepattern.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/normalizer2.h b/deps/icu-small/source/common/unicode/normalizer2.h index 6a7668bfd5ff3e..8a6d7138021b56 100644 --- a/deps/icu-small/source/common/unicode/normalizer2.h +++ b/deps/icu-small/source/common/unicode/normalizer2.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: normalizer2.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -28,12 +28,15 @@ #if !UCONFIG_NO_NORMALIZATION +#include "unicode/stringpiece.h" #include "unicode/uniset.h" #include "unicode/unistr.h" #include "unicode/unorm2.h" U_NAMESPACE_BEGIN +class ByteSink; + /** * Unicode normalization functionality for standard Unicode normalization or * for using custom mapping tables. @@ -215,6 +218,35 @@ class U_COMMON_API Normalizer2 : public UObject { normalize(const UnicodeString &src, UnicodeString &dest, UErrorCode &errorCode) const = 0; + + /** + * Normalizes a UTF-8 string and optionally records how source substrings + * relate to changed and unchanged result substrings. + * + * Currently implemented completely only for "compose" modes, + * such as for NFC, NFKC, and NFKC_Casefold + * (UNORM2_COMPOSE and UNORM2_COMPOSE_CONTIGUOUS). + * Otherwise currently converts to & from UTF-16 and does not support edits. + * + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src Source UTF-8 string. + * @param sink A ByteSink to which the normalized UTF-8 result string is written. + * sink.Flush() is called at the end. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be nullptr. + * @param errorCode Standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @draft ICU 60 + */ + virtual void + normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink, + Edits *edits, UErrorCode &errorCode) const; + /** * Appends the normalized form of the second string to the first string * (merging them at the boundary) and returns the first string. @@ -282,7 +314,7 @@ class U_COMMON_API Normalizer2 : public UObject { * * When used on a standard NFC Normalizer2 instance, * it returns the Decomposition_Mapping only if the Decomposition_Type (dt) is Canonical (Can); - * in this case, the result contains either one or two code points (=1..4 UChars). + * in this case, the result contains either one or two code points (=1..4 char16_ts). * * This function is independent of the mode of the Normalizer2. * The default implementation returns FALSE. @@ -340,6 +372,30 @@ class U_COMMON_API Normalizer2 : public UObject { */ virtual UBool isNormalized(const UnicodeString &s, UErrorCode &errorCode) const = 0; + /** + * Tests if the UTF-8 string is normalized. + * Internally, in cases where the quickCheck() method would return "maybe" + * (which is only possible for the two COMPOSE modes) this method + * resolves to "yes" or "no" to provide a definitive result, + * at the cost of doing more work in those cases. + * + * This works for all normalization modes, + * but it is currently optimized for UTF-8 only for "compose" modes, + * such as for NFC, NFKC, and NFKC_Casefold + * (UNORM2_COMPOSE and UNORM2_COMPOSE_CONTIGUOUS). + * For other modes it currently converts to UTF-16 and calls isNormalized(). + * + * @param s UTF-8 input string + * @param errorCode Standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @return TRUE if s is normalized + * @draft ICU 60 + */ + virtual UBool + isNormalizedUTF8(StringPiece s, UErrorCode &errorCode) const; + /** * Tests if the string is normalized. @@ -479,7 +535,36 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { virtual UnicodeString & normalize(const UnicodeString &src, UnicodeString &dest, - UErrorCode &errorCode) const; + UErrorCode &errorCode) const U_OVERRIDE; + + /** + * Normalizes a UTF-8 string and optionally records how source substrings + * relate to changed and unchanged result substrings. + * + * Currently implemented completely only for "compose" modes, + * such as for NFC, NFKC, and NFKC_Casefold + * (UNORM2_COMPOSE and UNORM2_COMPOSE_CONTIGUOUS). + * Otherwise currently converts to & from UTF-16 and does not support edits. + * + * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. + * @param src Source UTF-8 string. + * @param sink A ByteSink to which the normalized UTF-8 result string is written. + * sink.Flush() is called at the end. + * @param edits Records edits for index mapping, working with styled text, + * and getting only changes (if any). + * The Edits contents is undefined if any error occurs. + * This function calls edits->reset() first unless + * options includes U_EDITS_NO_RESET. edits can be nullptr. + * @param errorCode Standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @draft ICU 60 + */ + virtual void + normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink, + Edits *edits, UErrorCode &errorCode) const U_OVERRIDE; + /** * Appends the normalized form of the second string to the first string * (merging them at the boundary) and returns the first string. @@ -497,7 +582,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { virtual UnicodeString & normalizeSecondAndAppend(UnicodeString &first, const UnicodeString &second, - UErrorCode &errorCode) const; + UErrorCode &errorCode) const U_OVERRIDE; /** * Appends the second string to the first string * (merging them at the boundary) and returns the first string. @@ -515,7 +600,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { virtual UnicodeString & append(UnicodeString &first, const UnicodeString &second, - UErrorCode &errorCode) const; + UErrorCode &errorCode) const U_OVERRIDE; /** * Gets the decomposition mapping of c. @@ -529,7 +614,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 4.6 */ virtual UBool - getDecomposition(UChar32 c, UnicodeString &decomposition) const; + getDecomposition(UChar32 c, UnicodeString &decomposition) const U_OVERRIDE; /** * Gets the raw decomposition mapping of c. @@ -543,7 +628,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 49 */ virtual UBool - getRawDecomposition(UChar32 c, UnicodeString &decomposition) const; + getRawDecomposition(UChar32 c, UnicodeString &decomposition) const U_OVERRIDE; /** * Performs pairwise composition of a & b and returns the composite if there is one. @@ -556,7 +641,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 49 */ virtual UChar32 - composePair(UChar32 a, UChar32 b) const; + composePair(UChar32 a, UChar32 b) const U_OVERRIDE; /** * Gets the combining class of c. @@ -567,7 +652,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 49 */ virtual uint8_t - getCombiningClass(UChar32 c) const; + getCombiningClass(UChar32 c) const U_OVERRIDE; /** * Tests if the string is normalized. @@ -581,7 +666,30 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 4.4 */ virtual UBool - isNormalized(const UnicodeString &s, UErrorCode &errorCode) const; + isNormalized(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE; + /** + * Tests if the UTF-8 string is normalized. + * Internally, in cases where the quickCheck() method would return "maybe" + * (which is only possible for the two COMPOSE modes) this method + * resolves to "yes" or "no" to provide a definitive result, + * at the cost of doing more work in those cases. + * + * This works for all normalization modes, + * but it is currently optimized for UTF-8 only for "compose" modes, + * such as for NFC, NFKC, and NFKC_Casefold + * (UNORM2_COMPOSE and UNORM2_COMPOSE_CONTIGUOUS). + * For other modes it currently converts to UTF-16 and calls isNormalized(). + * + * @param s UTF-8 input string + * @param errorCode Standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @return TRUE if s is normalized + * @draft ICU 60 + */ + virtual UBool + isNormalizedUTF8(StringPiece s, UErrorCode &errorCode) const U_OVERRIDE; /** * Tests if the string is normalized. * For details see the Normalizer2 base class documentation. @@ -594,7 +702,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 4.4 */ virtual UNormalizationCheckResult - quickCheck(const UnicodeString &s, UErrorCode &errorCode) const; + quickCheck(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE; /** * Returns the end of the normalized substring of the input string. * For details see the Normalizer2 base class documentation. @@ -607,7 +715,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @stable ICU 4.4 */ virtual int32_t - spanQuickCheckYes(const UnicodeString &s, UErrorCode &errorCode) const; + spanQuickCheckYes(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE; /** * Tests if the character always has a normalization boundary before it, @@ -617,7 +725,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @return TRUE if c has a normalization boundary before it * @stable ICU 4.4 */ - virtual UBool hasBoundaryBefore(UChar32 c) const; + virtual UBool hasBoundaryBefore(UChar32 c) const U_OVERRIDE; /** * Tests if the character always has a normalization boundary after it, @@ -627,7 +735,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @return TRUE if c has a normalization boundary after it * @stable ICU 4.4 */ - virtual UBool hasBoundaryAfter(UChar32 c) const; + virtual UBool hasBoundaryAfter(UChar32 c) const U_OVERRIDE; /** * Tests if the character is normalization-inert. @@ -636,7 +744,7 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { * @return TRUE if c is normalization-inert * @stable ICU 4.4 */ - virtual UBool isInert(UChar32 c) const; + virtual UBool isInert(UChar32 c) const U_OVERRIDE; private: UnicodeString & normalize(const UnicodeString &src, @@ -644,6 +752,12 @@ class U_COMMON_API FilteredNormalizer2 : public Normalizer2 { USetSpanCondition spanCondition, UErrorCode &errorCode) const; + void + normalizeUTF8(uint32_t options, const char *src, int32_t length, + ByteSink &sink, Edits *edits, + USetSpanCondition spanCondition, + UErrorCode &errorCode) const; + UnicodeString & normalizeSecondAndAppend(UnicodeString &first, const UnicodeString &second, diff --git a/deps/icu-small/source/common/unicode/normlzr.h b/deps/icu-small/source/common/unicode/normlzr.h index b9b67bc434df9d..82335ae6d7d19b 100644 --- a/deps/icu-small/source/common/unicode/normlzr.h +++ b/deps/icu-small/source/common/unicode/normlzr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************** @@ -168,7 +168,7 @@ class U_COMMON_API Normalizer : public UObject { * @param mode The normalization mode. * @deprecated ICU 56 Use Normalizer2 instead. */ - Normalizer(const UChar* str, int32_t length, UNormalizationMode mode); + Normalizer(ConstChar16Ptr str, int32_t length, UNormalizationMode mode); /** * Creates a new Normalizer object for iterating over the @@ -704,7 +704,7 @@ class U_COMMON_API Normalizer : public UObject { * @param status a UErrorCode * @deprecated ICU 56 Use Normalizer2 instead. */ - void setText(const UChar* newText, + void setText(ConstChar16Ptr newText, int32_t length, UErrorCode &status); /** @@ -796,8 +796,8 @@ Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2, uint32_t options, UErrorCode &errorCode) { // all argument checking is done in unorm_compare - return unorm_compare(s1.getBuffer(), s1.length(), - s2.getBuffer(), s2.length(), + return unorm_compare(toUCharPtr(s1.getBuffer()), s1.length(), + toUCharPtr(s2.getBuffer()), s2.length(), options, &errorCode); } diff --git a/deps/icu-small/source/common/unicode/parseerr.h b/deps/icu-small/source/common/unicode/parseerr.h index f1976581a1ea63..c8283bfcc9daa0 100644 --- a/deps/icu-small/source/common/unicode/parseerr.h +++ b/deps/icu-small/source/common/unicode/parseerr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/parsepos.h b/deps/icu-small/source/common/unicode/parsepos.h index 7bc2627773ef01..50cc56db590cf8 100644 --- a/deps/icu-small/source/common/unicode/parsepos.h +++ b/deps/icu-small/source/common/unicode/parsepos.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 1997-2005, International Business Machines Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/common/unicode/platform.h b/deps/icu-small/source/common/unicode/platform.h index bf31af5d1331cc..12e2929d240d45 100644 --- a/deps/icu-small/source/common/unicode/platform.h +++ b/deps/icu-small/source/common/unicode/platform.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -132,6 +132,8 @@ #define U_PF_BROWSER_NATIVE_CLIENT 4020 /** Android is based on Linux. @internal */ #define U_PF_ANDROID 4050 +/** Fuchsia is a POSIX-ish platform. @internal */ +#define U_PF_FUCHSIA 4100 /* Maximum value for Linux-based platform is 4499 */ /** z/OS is the successor to OS/390 which was the successor to MVS. @internal */ #define U_PF_OS390 9000 @@ -150,8 +152,10 @@ # define U_PLATFORM U_PF_ANDROID /* Android wchar_t support depends on the API level. */ # include -#elif defined(__native_client__) +#elif defined(__pnacl__) || defined(__native_client__) # define U_PLATFORM U_PF_BROWSER_NATIVE_CLIENT +#elif defined(__Fuchsia__) +# define U_PLATFORM U_PF_FUCHSIA #elif defined(linux) || defined(__linux__) || defined(__linux) # define U_PLATFORM U_PF_LINUX #elif defined(__APPLE__) && defined(__MACH__) @@ -192,6 +196,20 @@ # define U_PLATFORM U_PF_UNKNOWN #endif +/** + * \def UPRV_INCOMPLETE_CPP11_SUPPORT + * This switch turns off ICU 60 NumberFormatter code. + * By default, this switch is enabled on AIX and z/OS, + * which have poor C++11 support. + * + * NOTE: This switch is intended to be temporary; see #13393. + * + * @internal + */ +#ifndef UPRV_INCOMPLETE_CPP11_SUPPORT +# define UPRV_INCOMPLETE_CPP11_SUPPORT (U_PLATFORM == U_PF_AIX || U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_SOLARIS ) +#endif + /** * \def CYGWINMSVC * Defined if this is Windows with Cygwin, but using MSVC rather than gcc. @@ -233,6 +251,18 @@ # define U_PLATFORM_HAS_WIN32_API 0 #endif +/** + * \def U_PLATFORM_HAS_WINUWP_API + * Defines whether target is intended for Universal Windows Platform API + * Set to 1 for Windows10 Release Solution Configuration + * @internal + */ +#ifdef U_PLATFORM_HAS_WINUWP_API + /* Use the predefined value. */ +#else +# define U_PLATFORM_HAS_WINUWP_API 0 +#endif + /** * \def U_PLATFORM_IMPLEMENTS_POSIX * Defines whether the platform implements (most of) the POSIX API. @@ -318,42 +348,6 @@ # define U_HAVE_INTTYPES_H U_HAVE_STDINT_H #endif -/** - * \def U_IOSTREAM_SOURCE - * Defines what support for C++ streams is available. - * - * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available - * (the ISO/IEC C++ FDIS was published in November 1997), and then - * one should qualify streams using the std namespace in ICU header - * files. - * Starting with ICU 49, this is the only supported version. - * - * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is - * available instead (in June 1985 Stroustrup published - * "An Extensible I/O Facility for C++" at the summer USENIX conference). - * Starting with ICU 49, this version is not supported any more. - * - * If U_IOSTREAM_SOURCE is 0 (or any value less than 199711), - * then C++ streams are not available and - * support for them will be silently suppressed in ICU. - * - * @internal - */ -#ifndef U_IOSTREAM_SOURCE -#define U_IOSTREAM_SOURCE 199711 -#endif - -/** - * \def U_HAVE_STD_STRING - * Defines whether the standard C++ (STL) <string> header is available. - * @internal - */ -#ifdef U_HAVE_STD_STRING - /* Use the predefined value. */ -#else -# define U_HAVE_STD_STRING 1 -#endif - /*===========================================================================*/ /** @{ Compiler and environment features */ /*===========================================================================*/ @@ -430,7 +424,7 @@ # define U_HAVE_DEBUG_LOCATION_NEW 0 #endif -/* Compatibility with non clang compilers: http://clang.llvm.org/docs/LanguageExtensions.html */ +/* Compatibility with compilers other than clang: http://clang.llvm.org/docs/LanguageExtensions.html */ #ifndef __has_attribute # define __has_attribute(x) 0 #endif @@ -497,20 +491,11 @@ # define U_CPLUSPLUS_VERSION 1 #endif -/** - * \def U_HAVE_RVALUE_REFERENCES - * Set to 1 if the compiler supports rvalue references. - * C++11 feature, necessary for move constructor & move assignment. - * @internal - */ -#ifdef U_HAVE_RVALUE_REFERENCES - /* Use the predefined value. */ -#elif U_CPLUSPLUS_VERSION >= 11 || __has_feature(cxx_rvalue_references) \ - || defined(__GXX_EXPERIMENTAL_CXX0X__) \ - || (defined(_MSC_VER) && _MSC_VER >= 1600) /* Visual Studio 2010 */ -# define U_HAVE_RVALUE_REFERENCES 1 -#else -# define U_HAVE_RVALUE_REFERENCES 0 +#if (U_PLATFORM == U_PF_AIX || U_PLATFORM == U_PF_OS390) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11) +// add in std::nullptr_t +namespace std { + typedef decltype(nullptr) nullptr_t; +}; #endif /** @@ -537,17 +522,22 @@ * http://clang.llvm.org/docs/AttributeReference.html#fallthrough-clang-fallthrough * @internal */ -#ifdef __cplusplus +#ifndef __cplusplus + // Not for C. +#elif defined(U_FALLTHROUGH) + // Use the predefined value. +#elif defined(__clang__) + // Test for compiler vs. feature separately. + // Other compilers might choke on the feature test. # if __has_cpp_attribute(clang::fallthrough) || \ (__has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")) # define U_FALLTHROUGH [[clang::fallthrough]] -# else -# define U_FALLTHROUGH # endif -#else -# define U_FALLTHROUGH #endif +#ifndef U_FALLTHROUGH +# define U_FALLTHROUGH +#endif /** @} */ @@ -764,6 +754,7 @@ * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but * does not support u"abc" string literals. * C++11 and C11 require support for UTF-16 literals + * TODO: Fix for plain C. Doesn't work on Mac. */ # if U_CPLUSPLUS_VERSION >= 11 || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) # define U_HAVE_CHAR16_T 1 @@ -857,6 +848,16 @@ # define U_CALLCONV U_EXPORT2 #endif +/** + * \def U_CALLCONV_FPTR + * Similar to U_CALLCONV, but only used on function pointers. + * @internal + */ +#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus) +# define U_CALLCONV_FPTR U_CALLCONV +#else +# define U_CALLCONV_FPTR +#endif /* @} */ #endif diff --git a/deps/icu-small/source/common/unicode/ptypes.h b/deps/icu-small/source/common/unicode/ptypes.h index 69d7286d323e3d..6eaf2dbf035725 100644 --- a/deps/icu-small/source/common/unicode/ptypes.h +++ b/deps/icu-small/source/common/unicode/ptypes.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unicode/putil.h b/deps/icu-small/source/common/unicode/putil.h index 6f3250ed685fdc..91d6bb10f76f9a 100644 --- a/deps/icu-small/source/common/unicode/putil.h +++ b/deps/icu-small/source/common/unicode/putil.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unicode/rbbi.h b/deps/icu-small/source/common/unicode/rbbi.h index 9f2a1a62b369d1..c3c201dd35d333 100644 --- a/deps/icu-small/source/common/unicode/rbbi.h +++ b/deps/icu-small/source/common/unicode/rbbi.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -31,23 +31,14 @@ #include "unicode/schriter.h" #include "unicode/uchriter.h" - -struct UTrie; - U_NAMESPACE_BEGIN /** @internal */ +class LanguageBreakEngine; struct RBBIDataHeader; -class RuleBasedBreakIteratorTables; -class BreakIterator; class RBBIDataWrapper; -class UStack; -class LanguageBreakEngine; class UnhandledEngine; -struct RBBIStateTable; - - - +class UStack; /** * @@ -96,47 +87,49 @@ class U_COMMON_API RuleBasedBreakIterator /*U_FINAL*/ : public BreakIterator { */ RBBIDataWrapper *fData; - /** Index of the Rule {tag} values for the most recent match. + /** + * The iteration state - current position, rule status for the current position, + * and whether the iterator ran off the end, yielding UBRK_DONE. + * Current position is pinned to be 0 < position <= text.length. + * Current position is always set to a boundary. * @internal */ - int32_t fLastRuleStatusIndex; + /** + * The current position of the iterator. Pinned, 0 < fPosition <= text.length. + * Never has the value UBRK_DONE (-1). + */ + int32_t fPosition; /** - * Rule tag value valid flag. - * Some iterator operations don't intrinsically set the correct tag value. - * This flag lets us lazily compute the value if we are ever asked for it. - * @internal - */ - UBool fLastStatusIndexValid; + * TODO: + */ + int32_t fRuleStatusIndex; /** - * Counter for the number of characters encountered with the "dictionary" - * flag set. - * @internal - */ - uint32_t fDictionaryCharCount; + * True when iteration has run off the end, and iterator functions should return UBRK_DONE. + */ + UBool fDone; /** - * When a range of characters is divided up using the dictionary, the break - * positions that are discovered are stored here, preventing us from having - * to use either the dictionary or the state table again until the iterator - * leaves this range of text. Has the most impact for line breaking. - * @internal + * Cache of previously determined boundary positions. */ - int32_t* fCachedBreakPositions; - + public: // TODO: debug, return to private. + class BreakCache; + BreakCache *fBreakCache; + private: /** - * The number of elements in fCachedBreakPositions + * Counter for the number of characters encountered with the "dictionary" + * flag set. * @internal */ - int32_t fNumCachedBreakPositions; + uint32_t fDictionaryCharCount; /** - * if fCachedBreakPositions is not null, this indicates which item in the - * cache the current iteration position refers to - * @internal + * Cache of boundary positions within a region of text that has been + * sub-divided by dictionary based breaking. */ - int32_t fPositionInCache; + class DictionaryCache; + DictionaryCache *fDictionaryCache; /** * @@ -179,13 +172,11 @@ class U_COMMON_API RuleBasedBreakIterator /*U_FINAL*/ : public BreakIterator { */ RuleBasedBreakIterator(RBBIDataHeader* data, UErrorCode &status); - + /** @internal */ friend class RBBIRuleBuilder; /** @internal */ friend class BreakIterator; - - public: /** Default constructor. Creates an empty shell of an iterator, with no @@ -469,7 +460,10 @@ class U_COMMON_API RuleBasedBreakIterator /*U_FINAL*/ : public BreakIterator { virtual UBool isBoundary(int32_t offset); /** - * Returns the current iteration position. + * Returns the current iteration position. Note that UBRK_DONE is never + * returned from this function; if iteration has run to the end of a + * string, current() will return the length of the string while + * next() will return UBRK_DONE). * @return The current iteration position. * @stable ICU 2.0 */ @@ -501,6 +495,7 @@ class U_COMMON_API RuleBasedBreakIterator /*U_FINAL*/ : public BreakIterator { * Note: this function is not thread safe. It should not have been * declared const, and the const remains only for compatibility * reasons. (The function is logically const, but not bit-wise const). + * TODO: check this. Probably thread safe now. *

* @return the status from the break rule that determined the most recently * returned break position. @@ -660,46 +655,31 @@ class U_COMMON_API RuleBasedBreakIterator /*U_FINAL*/ : public BreakIterator { * Common initialization function, used by constructors and bufferClone. * @internal */ - void init(); - - /** - * This method backs the iterator back up to a "safe position" in the text. - * This is a position that we know, without any context, must be a break position. - * The various calling methods then iterate forward from this safe position to - * the appropriate position to return. (For more information, see the description - * of buildBackwardsStateTable() in RuleBasedBreakIterator.Builder.) - * @param statetable state table used of moving backwards - * @internal - */ - int32_t handlePrevious(const RBBIStateTable *statetable); + void init(UErrorCode &status); /** - * This method is the actual implementation of the next() method. All iteration - * vectors through here. This method initializes the state machine to state 1 - * and advances through the text character by character until we reach the end - * of the text or the state machine transitions to state 0. We update our return - * value every time the state machine passes through a possible end state. - * @param statetable state table used of moving forwards + * Iterate backwards from an arbitrary position in the input text using the Safe Reverse rules. + * This locates a "Safe Position" from which the forward break rules + * will operate correctly. A Safe Position is not necessarily a boundary itself. + * + * @param fromPosition the position in the input text to begin the iteration. * @internal */ - int32_t handleNext(const RBBIStateTable *statetable); - + int32_t handlePrevious(int32_t fromPosition); /** - * This is the function that actually implements dictionary-based - * breaking. Covering at least the range from startPos to endPos, - * it checks for dictionary characters, and if it finds them determines - * the appropriate object to deal with them. It may cache found breaks in - * fCachedBreakPositions as it goes. It may well also look at text outside - * the range startPos to endPos. - * If going forward, endPos is the normal Unicode break result, and - * if goind in reverse, startPos is the normal Unicode break result - * @param startPos The start position of a range of text - * @param endPos The end position of a range of text - * @param reverse The call is for the reverse direction + * Find a rule-based boundary by running the state machine. + * Input + * fPosition, the position in the text to begin from. + * Output + * fPosition: the boundary following the starting position. + * fDictionaryCharCount the number of dictionary characters encountered. + * If > 0, the segment will be further subdivided + * fRuleStatusIndex Info from the state table indicating which rules caused the boundary. + * * @internal */ - int32_t checkDictionary(int32_t startPos, int32_t endPos, UBool reverse); + int32_t handleNext(); /** @@ -710,11 +690,14 @@ class U_COMMON_API RuleBasedBreakIterator /*U_FINAL*/ : public BreakIterator { */ const LanguageBreakEngine *getLanguageBreakEngine(UChar32 c); + public: +#ifndef U_HIDE_INTERNAL_API /** - * @internal + * Debugging function only. + * @internal */ - void makeRuleStatusValid(); - + void dumpCache(); +#endif /* U_HIDE_INTERNAL_API */ }; //------------------------------------------------------------------------------ diff --git a/deps/icu-small/source/common/unicode/rep.h b/deps/icu-small/source/common/unicode/rep.h index 8fa2332a71ca3e..b1023a37a2daf1 100644 --- a/deps/icu-small/source/common/unicode/rep.h +++ b/deps/icu-small/source/common/unicode/rep.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ************************************************************************** @@ -93,7 +93,7 @@ class U_COMMON_API Replaceable : public UObject { * @return 16-bit code unit of text at given offset * @stable ICU 1.8 */ - inline UChar charAt(int32_t offset) const; + inline char16_t charAt(int32_t offset) const; /** * Returns the 32-bit code point at the given 16-bit offset into @@ -230,7 +230,7 @@ class U_COMMON_API Replaceable : public UObject { * Virtual version of charAt(). * @stable ICU 2.4 */ - virtual UChar getCharAt(int32_t offset) const = 0; + virtual char16_t getCharAt(int32_t offset) const = 0; /** * Virtual version of char32At(). @@ -246,7 +246,7 @@ Replaceable::length() const { return getLength(); } -inline UChar +inline char16_t Replaceable::charAt(int32_t offset) const { return getCharAt(offset); } diff --git a/deps/icu-small/source/common/unicode/resbund.h b/deps/icu-small/source/common/unicode/resbund.h index 0d37d4209d6f44..358ed7eeb9e535 100644 --- a/deps/icu-small/source/common/unicode/resbund.h +++ b/deps/icu-small/source/common/unicode/resbund.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -216,7 +216,7 @@ class U_COMMON_API ResourceBundle : public UObject { * could be U_MISSING_RESOURCE_ERROR if the key is not found * could be a warning * e.g.: U_USING_FALLBACK_WARNING,U_USING_DEFAULT_WARNING - * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file. + * @return a pointer to a zero-terminated char16_t array which lives in a memory mapped/DLL file. * @stable ICU 2.0 */ UnicodeString diff --git a/deps/icu-small/source/common/unicode/schriter.h b/deps/icu-small/source/common/unicode/schriter.h index b5fa32d0aecb8d..d83a57f8d04b57 100644 --- a/deps/icu-small/source/common/unicode/schriter.h +++ b/deps/icu-small/source/common/unicode/schriter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -175,7 +175,7 @@ class U_COMMON_API StringCharacterIterator : public UCharCharacterIterator { * @param newTextLength The length of the String * @stable ICU 2.0 */ - void setText(const UChar* newText, int32_t newTextLength); + void setText(const char16_t* newText, int32_t newTextLength); /** * Copy of the iterated string object. diff --git a/deps/icu-small/source/common/unicode/simpleformatter.h b/deps/icu-small/source/common/unicode/simpleformatter.h index 2b74f5ca527ca2..850949caaf5cda 100644 --- a/deps/icu-small/source/common/unicode/simpleformatter.h +++ b/deps/icu-small/source/common/unicode/simpleformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -19,10 +19,15 @@ #include "unicode/utypes.h" #include "unicode/unistr.h" -#ifndef U_HIDE_DRAFT_API - U_NAMESPACE_BEGIN +// Forward declaration: +namespace number { +namespace impl { +class SimpleModifier; +} +} + /** * Formats simple patterns like "{1} was born in {0}". * Minimal subset of MessageFormat; fast, simple, minimal dependencies. @@ -49,15 +54,15 @@ U_NAMESPACE_BEGIN * * @see MessageFormat * @see UMessagePatternApostropheMode - * @draft ICU 57 + * @stable ICU 57 */ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { public: /** * Default constructor. - * @draft ICU 57 + * @stable ICU 57 */ - SimpleFormatter() : compiledPattern((UChar)0) {} + SimpleFormatter() : compiledPattern((char16_t)0) {} /** * Constructs a formatter from the pattern string. @@ -66,7 +71,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * @param errorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax. - * @draft ICU 57 + * @stable ICU 57 */ SimpleFormatter(const UnicodeString& pattern, UErrorCode &errorCode) { applyPattern(pattern, errorCode); @@ -84,7 +89,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * Must fulfill U_SUCCESS before the function call. * Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax and * too few or too many arguments. - * @draft ICU 57 + * @stable ICU 57 */ SimpleFormatter(const UnicodeString& pattern, int32_t min, int32_t max, UErrorCode &errorCode) { @@ -93,20 +98,20 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { /** * Copy constructor. - * @draft ICU 57 + * @stable ICU 57 */ SimpleFormatter(const SimpleFormatter& other) : compiledPattern(other.compiledPattern) {} /** * Assignment operator. - * @draft ICU 57 + * @stable ICU 57 */ SimpleFormatter &operator=(const SimpleFormatter& other); /** * Destructor. - * @draft ICU 57 + * @stable ICU 57 */ ~SimpleFormatter(); @@ -118,7 +123,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * Must fulfill U_SUCCESS before the function call. * Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax. * @return TRUE if U_SUCCESS(errorCode). - * @draft ICU 57 + * @stable ICU 57 */ UBool applyPattern(const UnicodeString &pattern, UErrorCode &errorCode) { return applyPatternMinMaxArguments(pattern, 0, INT32_MAX, errorCode); @@ -137,14 +142,14 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax and * too few or too many arguments. * @return TRUE if U_SUCCESS(errorCode). - * @draft ICU 57 + * @stable ICU 57 */ UBool applyPatternMinMaxArguments(const UnicodeString &pattern, int32_t min, int32_t max, UErrorCode &errorCode); /** * @return The max argument number + 1. - * @draft ICU 57 + * @stable ICU 57 */ int32_t getArgumentLimit() const { return getArgumentLimit(compiledPattern.getBuffer(), compiledPattern.length()); @@ -160,7 +165,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * @param errorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString &format( const UnicodeString &value0, @@ -177,7 +182,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * @param errorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString &format( const UnicodeString &value0, @@ -196,7 +201,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * @param errorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString &format( const UnicodeString &value0, @@ -221,7 +226,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * @param errorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString &formatAndAppend( const UnicodeString *const *values, int32_t valuesLength, @@ -247,7 +252,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { * @param errorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return result - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString &formatAndReplace( const UnicodeString *const *values, int32_t valuesLength, @@ -257,7 +262,7 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { /** * Returns the pattern text with none of the arguments. * Like formatting with all-empty string values. - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString getTextWithNoArguments() const { return getTextWithNoArguments(compiledPattern.getBuffer(), compiledPattern.length()); @@ -275,23 +280,24 @@ class U_COMMON_API SimpleFormatter U_FINAL : public UMemory { */ UnicodeString compiledPattern; - static inline int32_t getArgumentLimit(const UChar *compiledPattern, + static inline int32_t getArgumentLimit(const char16_t *compiledPattern, int32_t compiledPatternLength) { return compiledPatternLength == 0 ? 0 : compiledPattern[0]; } - static UnicodeString getTextWithNoArguments(const UChar *compiledPattern, int32_t compiledPatternLength); + static UnicodeString getTextWithNoArguments(const char16_t *compiledPattern, int32_t compiledPatternLength); static UnicodeString &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, UErrorCode &errorCode); + + // Give access to internals to SimpleModifier for number formatting + friend class number::impl::SimpleModifier; }; U_NAMESPACE_END -#endif /* U_HIDE_DRAFT_API */ - #endif // __SIMPLEFORMATTER_H__ diff --git a/deps/icu-small/source/common/unicode/std_string.h b/deps/icu-small/source/common/unicode/std_string.h index 104ef0c83e8cfe..729c56399506eb 100644 --- a/deps/icu-small/source/common/unicode/std_string.h +++ b/deps/icu-small/source/common/unicode/std_string.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: std_string.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -27,13 +27,11 @@ #include "unicode/utypes.h" -#if U_HAVE_STD_STRING - -#if !defined(_MSC_VER) -namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364 +// Workaround for a libstdc++ bug before libstdc++4.6 (2011). +// https://bugs.llvm.org/show_bug.cgi?id=13364 +#if defined(__GLIBCXX__) +namespace std { class type_info; } #endif #include -#endif // U_HAVE_STD_STRING - #endif // __STD_STRING_H__ diff --git a/deps/icu-small/source/common/unicode/strenum.h b/deps/icu-small/source/common/unicode/strenum.h index 74ff28decc3df2..fa525d4f5227da 100644 --- a/deps/icu-small/source/common/unicode/strenum.h +++ b/deps/icu-small/source/common/unicode/strenum.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -35,7 +35,7 @@ U_NAMESPACE_BEGIN * call, so the returned string still might not be 'valid' on * subsequent use.

* - *

Strings may take the form of const char*, const UChar*, or const + *

Strings may take the form of const char*, const char16_t*, or const * UnicodeString*. The type you get is determine by the variant of * 'next' that you call. In general the StringEnumeration is * optimized for one of these types, but all StringEnumerations can @@ -112,7 +112,7 @@ class U_COMMON_API StringEnumeration : public UObject { *

If the iterator is out of sync with its service, status is set * to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned.

* - *

If the native service string is a UChar* string, it is + *

If the native service string is a char16_t* string, it is * converted to char* with the invariant converter. If the * conversion fails (because a character cannot be converted) then * status is set to U_INVARIANT_CONVERSION_ERROR and the return @@ -131,7 +131,7 @@ class U_COMMON_API StringEnumeration : public UObject { virtual const char* next(int32_t *resultLength, UErrorCode& status); /** - *

Returns the next element as a NUL-terminated UChar*. If there + *

Returns the next element as a NUL-terminated char16_t*. If there * are no more elements, returns NULL. If the resultLength pointer * is not NULL, the length of the string (not counting the * terminating NUL) is returned at that address. If an error @@ -153,7 +153,7 @@ class U_COMMON_API StringEnumeration : public UObject { * * @stable ICU 2.4 */ - virtual const UChar* unext(int32_t *resultLength, UErrorCode& status); + virtual const char16_t* unext(int32_t *resultLength, UErrorCode& status); /** *

Returns the next element a UnicodeString*. If there are no diff --git a/deps/icu-small/source/common/unicode/stringoptions.h b/deps/icu-small/source/common/unicode/stringoptions.h new file mode 100644 index 00000000000000..f2de96e9634a02 --- /dev/null +++ b/deps/icu-small/source/common/unicode/stringoptions.h @@ -0,0 +1,198 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// stringoptions.h +// created: 2017jun08 Markus W. Scherer + +#ifndef __STRINGOPTIONS_H__ +#define __STRINGOPTIONS_H__ + +#include "unicode/utypes.h" + +/** + * \file + * \brief C API: Bit set option bit constants for various string and character processing functions. + */ + +/** + * Option value for case folding: Use default mappings defined in CaseFolding.txt. + * + * @stable ICU 2.0 + */ +#define U_FOLD_CASE_DEFAULT 0 + +/** + * Option value for case folding: + * + * Use the modified set of mappings provided in CaseFolding.txt to handle dotted I + * and dotless i appropriately for Turkic languages (tr, az). + * + * Before Unicode 3.2, CaseFolding.txt contains mappings marked with 'I' that + * are to be included for default mappings and + * excluded for the Turkic-specific mappings. + * + * Unicode 3.2 CaseFolding.txt instead contains mappings marked with 'T' that + * are to be excluded for default mappings and + * included for the Turkic-specific mappings. + * + * @stable ICU 2.0 + */ +#define U_FOLD_CASE_EXCLUDE_SPECIAL_I 1 + +#ifndef U_HIDE_DRAFT_API + +/** + * Titlecase the string as a whole rather than each word. + * (Titlecase only the character at index 0, possibly adjusted.) + * Option bits value for titlecasing APIs that take an options bit set. + * + * It is an error to specify multiple titlecasing iterator options together, + * including both an options bit and an explicit BreakIterator. + * + * @see U_TITLECASE_ADJUST_TO_CASED + * @draft ICU 60 + */ +#define U_TITLECASE_WHOLE_STRING 0x20 + +/** + * Titlecase sentences rather than words. + * (Titlecase only the first character of each sentence, possibly adjusted.) + * Option bits value for titlecasing APIs that take an options bit set. + * + * It is an error to specify multiple titlecasing iterator options together, + * including both an options bit and an explicit BreakIterator. + * + * @see U_TITLECASE_ADJUST_TO_CASED + * @draft ICU 60 + */ +#define U_TITLECASE_SENTENCES 0x40 + +#endif // U_HIDE_DRAFT_API + +/** + * Do not lowercase non-initial parts of words when titlecasing. + * Option bit for titlecasing APIs that take an options bit set. + * + * By default, titlecasing will titlecase the character at each + * (possibly adjusted) BreakIterator index and + * lowercase all other characters up to the next iterator index. + * With this option, the other characters will not be modified. + * + * @see U_TITLECASE_ADJUST_TO_CASED + * @see UnicodeString::toTitle + * @see CaseMap::toTitle + * @see ucasemap_setOptions + * @see ucasemap_toTitle + * @see ucasemap_utf8ToTitle + * @stable ICU 3.8 + */ +#define U_TITLECASE_NO_LOWERCASE 0x100 + +/** + * Do not adjust the titlecasing BreakIterator indexes; + * titlecase exactly the characters at breaks from the iterator. + * Option bit for titlecasing APIs that take an options bit set. + * + * By default, titlecasing will take each break iterator index, + * adjust it to the next relevant character (see U_TITLECASE_ADJUST_TO_CASED), + * and titlecase that one. + * + * Other characters are lowercased. + * + * It is an error to specify multiple titlecasing adjustment options together. + * + * @see U_TITLECASE_ADJUST_TO_CASED + * @see U_TITLECASE_NO_LOWERCASE + * @see UnicodeString::toTitle + * @see CaseMap::toTitle + * @see ucasemap_setOptions + * @see ucasemap_toTitle + * @see ucasemap_utf8ToTitle + * @stable ICU 3.8 + */ +#define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200 + +#ifndef U_HIDE_DRAFT_API + +/** + * Adjust each titlecasing BreakIterator index to the next cased character. + * (See the Unicode Standard, chapter 3, Default Case Conversion, R3 toTitlecase(X).) + * Option bit for titlecasing APIs that take an options bit set. + * + * This used to be the default index adjustment in ICU. + * Since ICU 60, the default index adjustment is to the next character that is + * a letter, number, symbol, or private use code point. + * (Uncased modifier letters are skipped.) + * The difference in behavior is small for word titlecasing, + * but the new adjustment is much better for whole-string and sentence titlecasing: + * It yields "49ers" and "«丰(abc)»" instead of "49Ers" and "«丰(Abc)»". + * + * It is an error to specify multiple titlecasing adjustment options together. + * + * @see U_TITLECASE_NO_BREAK_ADJUSTMENT + * @draft ICU 60 + */ +#define U_TITLECASE_ADJUST_TO_CASED 0x400 + +/** + * Option for string transformation functions to not first reset the Edits object. + * Used for example in some case-mapping and normalization functions. + * + * @see CaseMap + * @see Edits + * @see Normalizer2 + * @draft ICU 60 + */ +#define U_EDITS_NO_RESET 0x2000 + +/** + * Omit unchanged text when recording how source substrings + * relate to changed and unchanged result substrings. + * Used for example in some case-mapping and normalization functions. + * + * @see CaseMap + * @see Edits + * @see Normalizer2 + * @draft ICU 60 + */ +#define U_OMIT_UNCHANGED_TEXT 0x4000 + +#endif // U_HIDE_DRAFT_API + +/** + * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: + * Compare strings in code point order instead of code unit order. + * @stable ICU 2.2 + */ +#define U_COMPARE_CODE_POINT_ORDER 0x8000 + +/** + * Option bit for unorm_compare: + * Perform case-insensitive comparison. + * @stable ICU 2.2 + */ +#define U_COMPARE_IGNORE_CASE 0x10000 + +/** + * Option bit for unorm_compare: + * Both input strings are assumed to fulfill FCD conditions. + * @stable ICU 2.2 + */ +#define UNORM_INPUT_IS_FCD 0x20000 + +// Related definitions elsewhere. +// Options that are not meaningful in the same functions +// can share the same bits. +// +// Public: +// unicode/unorm.h #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20 +// +// Internal: (may change or be removed) +// ucase.h #define _STRCASECMP_OPTIONS_MASK 0xffff +// ucase.h #define _FOLD_CASE_OPTIONS_MASK 7 +// ucasemap_imp.h #define U_TITLECASE_ITERATOR_MASK 0xe0 +// ucasemap_imp.h #define U_TITLECASE_ADJUSTMENT_MASK 0x600 +// ustr_imp.h #define _STRNCMP_STYLE 0x1000 +// unormcmp.cpp #define _COMPARE_EQUIV 0x80000 + +#endif // __STRINGOPTIONS_H__ diff --git a/deps/icu-small/source/common/unicode/stringpiece.h b/deps/icu-small/source/common/unicode/stringpiece.h index 43864ad81a8292..640fbac5a827d0 100644 --- a/deps/icu-small/source/common/unicode/stringpiece.h +++ b/deps/icu-small/source/common/unicode/stringpiece.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // Copyright (C) 2009-2013, International Business Machines // Corporation and others. All Rights Reserved. @@ -68,14 +68,12 @@ class U_COMMON_API StringPiece : public UMemory { * @stable ICU 4.2 */ StringPiece(const char* str); -#if U_HAVE_STD_STRING /** * Constructs from a std::string. * @stable ICU 4.2 */ StringPiece(const std::string& str) : ptr_(str.data()), length_(static_cast(str.size())) { } -#endif /** * Constructs from a const char * pointer and a specified length. * @param offset a const char * pointer (need not be terminated) diff --git a/deps/icu-small/source/common/unicode/stringtriebuilder.h b/deps/icu-small/source/common/unicode/stringtriebuilder.h index c2839fe53f29ff..8d2b229413cd6d 100644 --- a/deps/icu-small/source/common/unicode/stringtriebuilder.h +++ b/deps/icu-small/source/common/unicode/stringtriebuilder.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: stringtriebuilder.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -105,7 +105,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { /** @internal */ virtual int32_t getElementStringLength(int32_t i) const = 0; /** @internal */ - virtual UChar getElementUnit(int32_t i, int32_t unitIndex) const = 0; + virtual char16_t getElementUnit(int32_t i, int32_t unitIndex) const = 0; /** @internal */ virtual int32_t getElementValue(int32_t i) const = 0; @@ -120,7 +120,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { /** @internal */ virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const = 0; /** @internal */ - virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UChar unit) const = 0; + virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const = 0; /** @internal */ virtual UBool matchNodesCanHaveValues() const = 0; @@ -137,7 +137,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { /** @internal */ static const int32_t kMaxBranchLinearSubNodeLength=5; - // Maximum number of nested split-branch levels for a branch on all 2^16 possible UChar units. + // Maximum number of nested split-branch levels for a branch on all 2^16 possible char16_t units. // log2(2^16/kMaxBranchLinearSubNodeLength) rounded up. /** @internal */ static const int32_t kMaxSplitBranchLevels=14; @@ -256,7 +256,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { /** @internal */ class FinalValueNode : public Node { public: - FinalValueNode(int32_t v) : Node(0x111111*37+v), value(v) {} + FinalValueNode(int32_t v) : Node(0x111111u*37u+v), value(v) {} virtual UBool operator==(const Node &other) const; virtual void write(StringTrieBuilder &builder); protected: @@ -276,7 +276,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { void setValue(int32_t v) { hasValue=TRUE; value=v; - hash=hash*37+v; + hash=hash*37u+v; } protected: UBool hasValue; @@ -290,7 +290,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { class IntermediateValueNode : public ValueNode { public: IntermediateValueNode(int32_t v, Node *nextNode) - : ValueNode(0x222222*37+hashCode(nextNode)), next(nextNode) { setValue(v); } + : ValueNode(0x222222u*37u+hashCode(nextNode)), next(nextNode) { setValue(v); } virtual UBool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); virtual void write(StringTrieBuilder &builder); @@ -307,7 +307,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { class LinearMatchNode : public ValueNode { public: LinearMatchNode(int32_t len, Node *nextNode) - : ValueNode((0x333333*37+len)*37+hashCode(nextNode)), + : ValueNode((0x333333u*37u+len)*37u+hashCode(nextNode)), length(len), next(nextNode) {} virtual UBool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); @@ -338,25 +338,25 @@ class U_COMMON_API StringTrieBuilder : public UObject { virtual void write(StringTrieBuilder &builder); // Adds a unit with a final value. void add(int32_t c, int32_t value) { - units[length]=(UChar)c; + units[length]=(char16_t)c; equal[length]=NULL; values[length]=value; ++length; - hash=(hash*37+c)*37+value; + hash=(hash*37u+c)*37u+value; } // Adds a unit which leads to another match node. void add(int32_t c, Node *node) { - units[length]=(UChar)c; + units[length]=(char16_t)c; equal[length]=node; values[length]=0; ++length; - hash=(hash*37+c)*37+hashCode(node); + hash=(hash*37u+c)*37u+hashCode(node); } protected: Node *equal[kMaxBranchLinearSubNodeLength]; // NULL means "has final value". int32_t length; int32_t values[kMaxBranchLinearSubNodeLength]; - UChar units[kMaxBranchLinearSubNodeLength]; + char16_t units[kMaxBranchLinearSubNodeLength]; }; /** @@ -364,15 +364,15 @@ class U_COMMON_API StringTrieBuilder : public UObject { */ class SplitBranchNode : public BranchNode { public: - SplitBranchNode(UChar middleUnit, Node *lessThanNode, Node *greaterOrEqualNode) - : BranchNode(((0x555555*37+middleUnit)*37+ - hashCode(lessThanNode))*37+hashCode(greaterOrEqualNode)), + SplitBranchNode(char16_t middleUnit, Node *lessThanNode, Node *greaterOrEqualNode) + : BranchNode(((0x555555u*37u+middleUnit)*37u+ + hashCode(lessThanNode))*37u+hashCode(greaterOrEqualNode)), unit(middleUnit), lessThan(lessThanNode), greaterOrEqual(greaterOrEqualNode) {} virtual UBool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); virtual void write(StringTrieBuilder &builder); protected: - UChar unit; + char16_t unit; Node *lessThan; Node *greaterOrEqual; }; @@ -382,7 +382,7 @@ class U_COMMON_API StringTrieBuilder : public UObject { class BranchHeadNode : public ValueNode { public: BranchHeadNode(int32_t len, Node *subNode) - : ValueNode((0x666666*37+len)*37+hashCode(subNode)), + : ValueNode((0x666666u*37u+len)*37u+hashCode(subNode)), length(len), next(subNode) {} virtual UBool operator==(const Node &other) const; virtual int32_t markRightEdgesFirst(int32_t edgeNumber); diff --git a/deps/icu-small/source/common/unicode/symtable.h b/deps/icu-small/source/common/unicode/symtable.h index 829c8105d05d85..c2dc95a61bc020 100644 --- a/deps/icu-small/source/common/unicode/symtable.h +++ b/deps/icu-small/source/common/unicode/symtable.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/ubidi.h b/deps/icu-small/source/common/unicode/ubidi.h index e59969861f3402..ef21f2420666cd 100644 --- a/deps/icu-small/source/common/unicode/ubidi.h +++ b/deps/icu-small/source/common/unicode/ubidi.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ubidi.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -1196,11 +1196,14 @@ ubidi_setContext(UBiDi *pBiDi, * A level overrides the directional property of its corresponding * (same index) character if the level has the * #UBIDI_LEVEL_OVERRIDE bit set.

- * Except for that bit, it must be + * Aside from that bit, it must be * paraLevel<=embeddingLevels[]<=UBIDI_MAX_EXPLICIT_LEVEL, - * with one exception: a level of zero may be specified for a paragraph - * separator even if paraLevel>0 when multiple paragraphs - * are submitted in the same call to ubidi_setPara().

+ * except that level 0 is always allowed. + * Level 0 for a paragraph separator prevents reordering of paragraphs; + * this only works reliably if #UBIDI_LEVEL_OVERRIDE + * is also set for paragraph separators. + * Level 0 for other characters is treated as a wildcard + * and is lifted up to the resolved level of the surrounding paragraph.

* Caution: A copy of this pointer, not of the levels, * will be stored in the UBiDi object; * the embeddingLevels array must not be diff --git a/deps/icu-small/source/common/unicode/ubiditransform.h b/deps/icu-small/source/common/unicode/ubiditransform.h index 509f68bcc012e0..627b005ed45f8d 100644 --- a/deps/icu-small/source/common/unicode/ubiditransform.h +++ b/deps/icu-small/source/common/unicode/ubiditransform.h @@ -1,12 +1,12 @@ /* ****************************************************************************** * -* Copyright (C) 2016 and later: Unicode, Inc. and others. +* © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html * ****************************************************************************** * file name: ubiditransform.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -23,8 +23,6 @@ #include "unicode/uchar.h" #include "unicode/localpointer.h" -#ifndef U_HIDE_DRAFT_API - /** * \file * \brief Bidi Transformations @@ -60,17 +58,17 @@ * @see UBIDI_REORDER_DEFAULT * @see UBIDI_REORDER_INVERSE_LIKE_DIRECT * @see UBIDI_REORDER_RUNS_ONLY - * @draft ICU 58 + * @stable ICU 58 */ typedef enum { /** 0: Constant indicating a logical order. * This is the default for input text. - * @draft ICU 58 + * @stable ICU 58 */ UBIDI_LOGICAL = 0, /** 1: Constant indicating a visual order. * This is a default for output text. - * @draft ICU 58 + * @stable ICU 58 */ UBIDI_VISUAL } UBiDiOrder; @@ -83,20 +81,20 @@ typedef enum { * @see ubidi_setReorderingOptions * @see ubidi_writeReordered * @see ubidi_writeReverse - * @draft ICU 58 + * @stable ICU 58 */ typedef enum { /** 0: Constant indicating that character mirroring should not be * performed. * This is the default. - * @draft ICU 58 + * @stable ICU 58 */ UBIDI_MIRRORING_OFF = 0, /** 1: Constant indicating that character mirroring should be performed. * This corresponds to calling ubidi_writeReordered or * ubidi_writeReverse with the * UBIDI_DO_MIRRORING option bit set. - * @draft ICU 58 + * @stable ICU 58 */ UBIDI_MIRRORING_ON } UBiDiMirroring; @@ -104,7 +102,7 @@ typedef enum { /** * Forward declaration of the UBiDiTransform structure that stores * information used by the layout transformation engine. - * @draft ICU 58 + * @stable ICU 58 */ typedef struct UBiDiTransform UBiDiTransform; @@ -240,9 +238,9 @@ typedef struct UBiDiTransform UBiDiTransform; * @see UBiDiMirroring * @see ubidi_setPara * @see u_shapeArabic - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT uint32_t U_EXPORT2 +U_STABLE uint32_t U_EXPORT2 ubiditransform_transform(UBiDiTransform *pBiDiTransform, const UChar *src, int32_t srcLength, UChar *dest, int32_t destSize, @@ -286,16 +284,16 @@ ubiditransform_transform(UBiDiTransform *pBiDiTransform, * ubiditransform_close(). * * @return An empty UBiDiTransform object. - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT UBiDiTransform* U_EXPORT2 +U_STABLE UBiDiTransform* U_EXPORT2 ubiditransform_open(UErrorCode *pErrorCode); /** * Deallocates the given UBiDiTransform object. - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT void U_EXPORT2 +U_STABLE void U_EXPORT2 ubiditransform_close(UBiDiTransform *pBidiTransform); #if U_SHOW_CPLUSPLUS_API @@ -309,7 +307,7 @@ U_NAMESPACE_BEGIN * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 58 + * @stable ICU 58 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalUBiDiTransformPointer, UBiDiTransform, ubiditransform_close); @@ -317,5 +315,4 @@ U_NAMESPACE_END #endif -#endif /* U_HIDE_DRAFT_API */ #endif diff --git a/deps/icu-small/source/common/unicode/ubrk.h b/deps/icu-small/source/common/unicode/ubrk.h index f43943ed1ab12c..600328c49c66bc 100644 --- a/deps/icu-small/source/common/unicode/ubrk.h +++ b/deps/icu-small/source/common/unicode/ubrk.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -230,7 +230,8 @@ typedef enum USentenceBreakTag { * @param locale The locale specifying the text-breaking conventions. Note that * locale keys such as "lb" and "ss" may be used to modify text break behavior, * see general discussion of BreakIterator C API. - * @param text The text to be iterated over. + * @param text The text to be iterated over. May be null, in which case ubrk_setText() is + * used to specify the text to be iterated. * @param textLength The number of characters in text, or -1 if null-terminated. * @param status A UErrorCode to receive any errors. * @return A UBreakIterator for the specified locale. @@ -267,6 +268,34 @@ ubrk_openRules(const UChar *rules, UParseError *parseErr, UErrorCode *status); +#ifndef U_HIDE_DRAFT_API +/** + * Open a new UBreakIterator for locating text boundaries using precompiled binary rules. + * Opening a UBreakIterator this way is substantially faster than using ubrk_openRules. + * Binary rules may be obtained using ubrk_getBinaryRules. The compiled rules are not + * compatible across different major versions of ICU, nor across platforms of different + * endianness or different base character set family (ASCII vs EBCDIC). + * @param binaryRules A set of compiled binary rules specifying the text breaking + * conventions. Ownership of the storage containing the compiled + * rules remains with the caller of this function. The compiled + * rules must not be modified or deleted during the life of the + * break iterator. + * @param rulesLength The length of binaryRules in bytes; must be >= 0. + * @param text The text to be iterated over. May be null, in which case + * ubrk_setText() is used to specify the text to be iterated. + * @param textLength The number of characters in text, or -1 if null-terminated. + * @param status Pointer to UErrorCode to receive any errors. + * @return UBreakIterator for the specified rules. + * @see ubrk_getBinaryRules + * @draft ICU 59 + */ +U_DRAFT UBreakIterator* U_EXPORT2 +ubrk_openBinaryRules(const uint8_t *binaryRules, int32_t rulesLength, + const UChar * text, int32_t textLength, + UErrorCode * status); + +#endif /* U_HIDE_DRAFT_API */ + /** * Thread safe cloning operation * @param bi iterator to be cloned @@ -566,6 +595,40 @@ ubrk_refreshUText(UBreakIterator *bi, UText *text, UErrorCode *status); + +#ifndef U_HIDE_DRAFT_API +/** + * Get a compiled binary version of the rules specifying the behavior of a UBreakIterator. + * The binary rules may be used with ubrk_openBinaryRules to open a new UBreakIterator + * more quickly than using ubrk_openRules. The compiled rules are not compatible across + * different major versions of ICU, nor across platforms of different endianness or + * different base character set family (ASCII vs EBCDIC). Supports preflighting (with + * binaryRules=NULL and rulesCapacity=0) to get the rules length without copying them to + * the binaryRules buffer. However, whether preflighting or not, if the actual length + * is greater than INT32_MAX, then the function returns 0 and sets *status to + * U_INDEX_OUTOFBOUNDS_ERROR. + + * @param bi The break iterator to use. + * @param binaryRules Buffer to receive the compiled binary rules; set to NULL for + * preflighting. + * @param rulesCapacity Capacity (in bytes) of the binaryRules buffer; set to 0 for + * preflighting. Must be >= 0. + * @param status Pointer to UErrorCode to receive any errors, such as + * U_BUFFER_OVERFLOW_ERROR, U_INDEX_OUTOFBOUNDS_ERROR, or + * U_ILLEGAL_ARGUMENT_ERROR. + * @return The actual byte length of the binary rules, if <= INT32_MAX; + * otherwise 0. If not preflighting and this is larger than + * rulesCapacity, *status will be set to an error. + * @see ubrk_openBinaryRules + * @draft ICU 59 + */ +U_DRAFT int32_t U_EXPORT2 +ubrk_getBinaryRules(UBreakIterator *bi, + uint8_t * binaryRules, int32_t rulesCapacity, + UErrorCode * status); + +#endif /* U_HIDE_DRAFT_API */ + #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ #endif diff --git a/deps/icu-small/source/common/unicode/ucasemap.h b/deps/icu-small/source/common/unicode/ucasemap.h index d7345e8a402ab6..6b253e3d638475 100644 --- a/deps/icu-small/source/common/unicode/ucasemap.h +++ b/deps/icu-small/source/common/unicode/ucasemap.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucasemap.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -22,8 +22,9 @@ #define __UCASEMAP_H__ #include "unicode/utypes.h" -#include "unicode/ustring.h" #include "unicode/localpointer.h" +#include "unicode/stringoptions.h" +#include "unicode/ustring.h" /** * \file @@ -144,47 +145,6 @@ ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode); U_STABLE void U_EXPORT2 ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode); -/** - * Do not lowercase non-initial parts of words when titlecasing. - * Option bit for titlecasing APIs that take an options bit set. - * - * By default, titlecasing will titlecase the first cased character - * of a word and lowercase all other characters. - * With this option, the other characters will not be modified. - * - * @see ucasemap_setOptions - * @see ucasemap_toTitle - * @see ucasemap_utf8ToTitle - * @see UnicodeString::toTitle - * @stable ICU 3.8 - */ -#define U_TITLECASE_NO_LOWERCASE 0x100 - -/** - * Do not adjust the titlecasing indexes from BreakIterator::next() indexes; - * titlecase exactly the characters at breaks from the iterator. - * Option bit for titlecasing APIs that take an options bit set. - * - * By default, titlecasing will take each break iterator index, - * adjust it by looking for the next cased character, and titlecase that one. - * Other characters are lowercased. - * - * This follows Unicode 4 & 5 section 3.13 Default Case Operations: - * - * R3 toTitlecase(X): Find the word boundaries based on Unicode Standard Annex - * #29, "Text Boundaries." Between each pair of word boundaries, find the first - * cased character F. If F exists, map F to default_title(F); then map each - * subsequent character C to default_lower(C). - * - * @see ucasemap_setOptions - * @see ucasemap_toTitle - * @see ucasemap_utf8ToTitle - * @see UnicodeString::toTitle - * @see U_TITLECASE_NO_LOWERCASE - * @stable ICU 3.8 - */ -#define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200 - #if !UCONFIG_NO_BREAK_ITERATION /** @@ -242,7 +202,7 @@ ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode * The standard titlecase iterator for the root locale implements the * algorithm of Unicode TR 21. * - * This function uses only the setUText(), first(), next() and close() methods of the + * This function uses only the setText(), first() and next() methods of the * provided break iterator. * * The result may be longer or shorter than the original. @@ -253,7 +213,7 @@ ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode * @param dest A buffer for the result string. The result will be NUL-terminated if * the buffer is large enough. * The contents is undefined in case of failure. - * @param destCapacity The size of the buffer (number of bytes). If it is 0, then + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the result * without writing any of the result string. * @param src The original string. @@ -272,7 +232,7 @@ ucasemap_toTitle(UCaseMap *csm, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode); -#endif +#endif // UCONFIG_NO_BREAK_ITERATION /** * Lowercase the characters in a UTF-8 string. diff --git a/deps/icu-small/source/common/unicode/ucat.h b/deps/icu-small/source/common/unicode/ucat.h index 418b64fa19d919..f9c18b47d6c9b8 100644 --- a/deps/icu-small/source/common/unicode/ucat.h +++ b/deps/icu-small/source/common/unicode/ucat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/uchar.h b/deps/icu-small/source/common/unicode/uchar.h index 7f6ea6d9343ab7..3613374d9a43a5 100644 --- a/deps/icu-small/source/common/unicode/uchar.h +++ b/deps/icu-small/source/common/unicode/uchar.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -26,6 +26,7 @@ #define UCHAR_H #include "unicode/utypes.h" +#include "unicode/stringoptions.h" U_CDECL_BEGIN @@ -41,7 +42,7 @@ U_CDECL_BEGIN * @see u_getUnicodeVersion * @stable ICU 2.0 */ -#define U_UNICODE_VERSION "9.0" +#define U_UNICODE_VERSION "10.0" /** * \file @@ -148,8 +149,9 @@ U_CDECL_BEGIN * * The properties APIs are intended to reflect Unicode properties as defined * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). - * For details about the properties see http://www.unicode.org/ucd/ . - * For names of Unicode properties see the UCD file PropertyAliases.txt. + * + * For details about the properties see + * UAX #44: Unicode Character Database (http://www.unicode.org/reports/tr44/). * * Important: If ICU is built with UCD files from Unicode versions below, e.g., 3.2, * then properties marked with "new in Unicode 3.2" are not or not fully available. @@ -399,42 +401,57 @@ typedef enum UProperty { UCHAR_CHANGES_WHEN_CASEMAPPED=55, /** Binary property Changes_When_NFKC_Casefolded. @stable ICU 4.4 */ UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED=56, -#ifndef U_HIDE_DRAFT_API /** * Binary property Emoji. * See http://www.unicode.org/reports/tr51/#Emoji_Properties * - * @draft ICU 57 + * @stable ICU 57 */ UCHAR_EMOJI=57, /** * Binary property Emoji_Presentation. * See http://www.unicode.org/reports/tr51/#Emoji_Properties * - * @draft ICU 57 + * @stable ICU 57 */ UCHAR_EMOJI_PRESENTATION=58, /** * Binary property Emoji_Modifier. * See http://www.unicode.org/reports/tr51/#Emoji_Properties * - * @draft ICU 57 + * @stable ICU 57 */ UCHAR_EMOJI_MODIFIER=59, /** * Binary property Emoji_Modifier_Base. * See http://www.unicode.org/reports/tr51/#Emoji_Properties * - * @draft ICU 57 + * @stable ICU 57 */ UCHAR_EMOJI_MODIFIER_BASE=60, -#endif /* U_HIDE_DRAFT_API */ + /** + * Binary property Emoji_Component. + * See http://www.unicode.org/reports/tr51/#Emoji_Properties + * + * @stable ICU 60 + */ + UCHAR_EMOJI_COMPONENT=61, + /** + * Binary property Regional_Indicator. + * @stable ICU 60 + */ + UCHAR_REGIONAL_INDICATOR=62, + /** + * Binary property Prepended_Concatenation_Mark. + * @stable ICU 60 + */ + UCHAR_PREPENDED_CONCATENATION_MARK=63, #ifndef U_HIDE_DEPRECATED_API /** * One more than the last constant for binary Unicode properties. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ - UCHAR_BINARY_LIMIT=61, + UCHAR_BINARY_LIMIT, #endif // U_HIDE_DEPRECATED_API /** Enumerated property Bidi_Class. @@ -1649,6 +1666,23 @@ enum UBlockCode { /** @stable ICU 58 */ UBLOCK_TANGUT_COMPONENTS = 273, /*[18800]*/ + // New blocks in Unicode 10.0 + + /** @stable ICU 60 */ + UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F = 274, /*[2CEB0]*/ + /** @stable ICU 60 */ + UBLOCK_KANA_EXTENDED_A = 275, /*[1B100]*/ + /** @stable ICU 60 */ + UBLOCK_MASARAM_GONDI = 276, /*[11D00]*/ + /** @stable ICU 60 */ + UBLOCK_NUSHU = 277, /*[1B170]*/ + /** @stable ICU 60 */ + UBLOCK_SOYOMBO = 278, /*[11A50]*/ + /** @stable ICU 60 */ + UBLOCK_SYRIAC_SUPPLEMENT = 279, /*[0860]*/ + /** @stable ICU 60 */ + UBLOCK_ZANABAZAR_SQUARE = 280, /*[11A00]*/ + #ifndef U_HIDE_DEPRECATED_API /** * One more than the highest normal UBlockCode value. @@ -1656,7 +1690,7 @@ enum UBlockCode { * * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ - UBLOCK_COUNT = 274, + UBLOCK_COUNT = 281, #endif // U_HIDE_DEPRECATED_API /** @stable ICU 2.0 */ @@ -1932,6 +1966,19 @@ typedef enum UJoiningGroup { U_JG_AFRICAN_FEH, /**< @stable ICU 58 */ U_JG_AFRICAN_NOON, /**< @stable ICU 58 */ U_JG_AFRICAN_QAF, /**< @stable ICU 58 */ + + U_JG_MALAYALAM_BHA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_JA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_LLA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_LLLA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_NGA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_NNA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_NNNA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_NYA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_RA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_SSA, /**< @stable ICU 60 */ + U_JG_MALAYALAM_TTA, /**< @stable ICU 60 */ + #ifndef U_HIDE_DEPRECATED_API /** * One more than the highest normal UJoiningGroup value. @@ -3523,27 +3570,6 @@ u_toupper(UChar32 c); U_STABLE UChar32 U_EXPORT2 u_totitle(UChar32 c); -/** Option value for case folding: use default mappings defined in CaseFolding.txt. @stable ICU 2.0 */ -#define U_FOLD_CASE_DEFAULT 0 - -/** - * Option value for case folding: - * - * Use the modified set of mappings provided in CaseFolding.txt to handle dotted I - * and dotless i appropriately for Turkic languages (tr, az). - * - * Before Unicode 3.2, CaseFolding.txt contains mappings marked with 'I' that - * are to be included for default mappings and - * excluded for the Turkic-specific mappings. - * - * Unicode 3.2 CaseFolding.txt instead contains mappings marked with 'T' that - * are to be excluded for default mappings and - * included for the Turkic-specific mappings. - * - * @stable ICU 2.0 - */ -#define U_FOLD_CASE_EXCLUDE_SPECIAL_I 1 - /** * The given character is mapped to its case folding equivalent according to * UnicodeData.txt and CaseFolding.txt; diff --git a/deps/icu-small/source/common/unicode/ucharstrie.h b/deps/icu-small/source/common/unicode/ucharstrie.h index 8daed447cedab1..dfc93f6d0bae8a 100644 --- a/deps/icu-small/source/common/unicode/ucharstrie.h +++ b/deps/icu-small/source/common/unicode/ucharstrie.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucharstrie.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -36,7 +36,7 @@ class UVector32; /** * Light-weight, non-const reader class for a UCharsTrie. - * Traverses a UChar-serialized data structure with minimal state, + * Traverses a char16_t-serialized data structure with minimal state, * for mapping strings (16-bit-unit sequences) to non-negative integer values. * * This class owns the serialized trie data only if it was constructed by @@ -52,18 +52,18 @@ class U_COMMON_API UCharsTrie : public UMemory { /** * Constructs a UCharsTrie reader instance. * - * The trieUChars must contain a copy of a UChar sequence from the UCharsTrieBuilder, - * starting with the first UChar of that sequence. - * The UCharsTrie object will not read more UChars than + * The trieUChars must contain a copy of a char16_t sequence from the UCharsTrieBuilder, + * starting with the first char16_t of that sequence. + * The UCharsTrie object will not read more char16_ts than * the UCharsTrieBuilder generated in the corresponding build() call. * * The array is not copied/cloned and must not be modified while * the UCharsTrie object is in use. * - * @param trieUChars The UChar array that contains the serialized trie. + * @param trieUChars The char16_t array that contains the serialized trie. * @stable ICU 4.8 */ - UCharsTrie(const UChar *trieUChars) + UCharsTrie(ConstChar16Ptr trieUChars) : ownedArray_(NULL), uchars_(trieUChars), pos_(uchars_), remainingMatchLength_(-1) {} @@ -75,7 +75,7 @@ class U_COMMON_API UCharsTrie : public UMemory { /** * Copy constructor, copies the other trie reader object and its state, - * but not the UChar array which will be shared. (Shallow copy.) + * but not the char16_t array which will be shared. (Shallow copy.) * @param other Another UCharsTrie object. * @stable ICU 4.8 */ @@ -109,8 +109,8 @@ class U_COMMON_API UCharsTrie : public UMemory { private: friend class UCharsTrie; - const UChar *uchars; - const UChar *pos; + const char16_t *uchars; + const char16_t *pos; int32_t remainingMatchLength; }; @@ -148,14 +148,14 @@ class U_COMMON_API UCharsTrie : public UMemory { /** * Determines whether the string so far matches, whether it has a value, - * and whether another input UChar can continue a matching string. + * and whether another input char16_t can continue a matching string. * @return The match/value Result. * @stable ICU 4.8 */ UStringTrieResult current() const; /** - * Traverses the trie from the initial state for this input UChar. + * Traverses the trie from the initial state for this input char16_t. * Equivalent to reset().next(uchar). * @param uchar Input char value. Values below 0 and above 0xffff will never match. * @return The match/value Result. @@ -177,7 +177,7 @@ class U_COMMON_API UCharsTrie : public UMemory { UStringTrieResult firstForCodePoint(UChar32 cp); /** - * Traverses the trie from the current state for this input UChar. + * Traverses the trie from the current state for this input char16_t. * @param uchar Input char value. Values below 0 and above 0xffff will never match. * @return The match/value Result. * @stable ICU 4.8 @@ -208,7 +208,7 @@ class U_COMMON_API UCharsTrie : public UMemory { * @return The match/value Result. * @stable ICU 4.8 */ - UStringTrieResult next(const UChar *s, int32_t length); + UStringTrieResult next(ConstChar16Ptr s, int32_t length); /** * Returns a matching string's value if called immediately after @@ -220,7 +220,7 @@ class U_COMMON_API UCharsTrie : public UMemory { * @stable ICU 4.8 */ inline int32_t getValue() const { - const UChar *pos=pos_; + const char16_t *pos=pos_; int32_t leadUnit=*pos++; // U_ASSERT(leadUnit>=kMinValueLead); return leadUnit&kValueIsFinal ? @@ -237,16 +237,16 @@ class U_COMMON_API UCharsTrie : public UMemory { * @stable ICU 4.8 */ inline UBool hasUniqueValue(int32_t &uniqueValue) const { - const UChar *pos=pos_; + const char16_t *pos=pos_; // Skip the rest of a pending linear-match node. return pos!=NULL && findUniqueValue(pos+remainingMatchLength_+1, FALSE, uniqueValue); } /** - * Finds each UChar which continues the string from the current state. - * That is, each UChar c for which it would be next(c)!=USTRINGTRIE_NO_MATCH now. - * @param out Each next UChar is appended to this object. - * @return the number of UChars which continue the string from here + * Finds each char16_t which continues the string from the current state. + * That is, each char16_t c for which it would be next(c)!=USTRINGTRIE_NO_MATCH now. + * @param out Each next char16_t is appended to this object. + * @return the number of char16_ts which continue the string from here * @stable ICU 4.8 */ int32_t getNextUChars(Appendable &out) const; @@ -258,8 +258,8 @@ class U_COMMON_API UCharsTrie : public UMemory { class U_COMMON_API Iterator : public UMemory { public: /** - * Iterates from the root of a UChar-serialized UCharsTrie. - * @param trieUChars The trie UChars. + * Iterates from the root of a char16_t-serialized UCharsTrie. + * @param trieUChars The trie char16_ts. * @param maxStringLength If 0, the iterator returns full strings. * Otherwise, the iterator returns strings with this maximum length. * @param errorCode Standard ICU error code. Its input value must @@ -268,7 +268,7 @@ class U_COMMON_API UCharsTrie : public UMemory { * function chaining. (See User Guide for details.) * @stable ICU 4.8 */ - Iterator(const UChar *trieUChars, int32_t maxStringLength, UErrorCode &errorCode); + Iterator(ConstChar16Ptr trieUChars, int32_t maxStringLength, UErrorCode &errorCode); /** * Iterates from the current state of the specified UCharsTrie. @@ -336,11 +336,11 @@ class U_COMMON_API UCharsTrie : public UMemory { return TRUE; } - const UChar *branchNext(const UChar *pos, int32_t length, UErrorCode &errorCode); + const char16_t *branchNext(const char16_t *pos, int32_t length, UErrorCode &errorCode); - const UChar *uchars_; - const UChar *pos_; - const UChar *initialPos_; + const char16_t *uchars_; + const char16_t *pos_; + const char16_t *initialPos_; int32_t remainingMatchLength_; int32_t initialRemainingMatchLength_; UBool skipValue_; // Skip intermediate value which was already delivered. @@ -368,7 +368,7 @@ class U_COMMON_API UCharsTrie : public UMemory { * this constructor adopts the builder's array. * This constructor is only called by the builder. */ - UCharsTrie(UChar *adoptUChars, const UChar *trieUChars) + UCharsTrie(char16_t *adoptUChars, const char16_t *trieUChars) : ownedArray_(adoptUChars), uchars_(trieUChars), pos_(uchars_), remainingMatchLength_(-1) {} @@ -381,7 +381,7 @@ class U_COMMON_API UCharsTrie : public UMemory { // Reads a compact 32-bit integer. // pos is already after the leadUnit, and the lead unit has bit 15 reset. - static inline int32_t readValue(const UChar *pos, int32_t leadUnit) { + static inline int32_t readValue(const char16_t *pos, int32_t leadUnit) { int32_t value; if(leadUnit=kMinTwoUnitValueLead) { if(leadUnit=kMinTwoUnitNodeValueLead) { if(leadUnit=kMinTwoUnitDeltaLead) { if(delta==kThreeUnitDeltaLead) { @@ -444,7 +444,7 @@ class U_COMMON_API UCharsTrie : public UMemory { return pos+delta; } - static const UChar *skipDelta(const UChar *pos) { + static const char16_t *skipDelta(const char16_t *pos) { int32_t delta=*pos++; if(delta>=kMinTwoUnitDeltaLead) { if(delta==kThreeUnitDeltaLead) { @@ -461,28 +461,28 @@ class U_COMMON_API UCharsTrie : public UMemory { } // Handles a branch node for both next(uchar) and next(string). - UStringTrieResult branchNext(const UChar *pos, int32_t length, int32_t uchar); + UStringTrieResult branchNext(const char16_t *pos, int32_t length, int32_t uchar); // Requires remainingLength_<0. - UStringTrieResult nextImpl(const UChar *pos, int32_t uchar); + UStringTrieResult nextImpl(const char16_t *pos, int32_t uchar); // Helper functions for hasUniqueValue(). // Recursively finds a unique value (or whether there is not a unique one) // from a branch. - static const UChar *findUniqueValueFromBranch(const UChar *pos, int32_t length, + static const char16_t *findUniqueValueFromBranch(const char16_t *pos, int32_t length, UBool haveUniqueValue, int32_t &uniqueValue); // Recursively finds a unique value (or whether there is not a unique one) // starting from a position on a node lead unit. - static UBool findUniqueValue(const UChar *pos, UBool haveUniqueValue, int32_t &uniqueValue); + static UBool findUniqueValue(const char16_t *pos, UBool haveUniqueValue, int32_t &uniqueValue); // Helper functions for getNextUChars(). // getNextUChars() when pos is on a branch node. - static void getNextBranchUChars(const UChar *pos, int32_t length, Appendable &out); + static void getNextBranchUChars(const char16_t *pos, int32_t length, Appendable &out); // UCharsTrie data structure // - // The trie consists of a series of UChar-serialized nodes for incremental - // Unicode string/UChar sequence matching. (UChar=16-bit unsigned integer) + // The trie consists of a series of char16_t-serialized nodes for incremental + // Unicode string/char16_t sequence matching. (char16_t=16-bit unsigned integer) // The root node is at the beginning of the trie data. // // Types of nodes are distinguished by their node lead unit ranges. @@ -491,9 +491,9 @@ class U_COMMON_API UCharsTrie : public UMemory { // // Node types: // - Final-value node: Stores a 32-bit integer in a compact, variable-length format. - // The value is for the string/UChar sequence so far. + // The value is for the string/char16_t sequence so far. // - Match node, optionally with an intermediate value in a different compact format. - // The value, if present, is for the string/UChar sequence so far. + // The value, if present, is for the string/char16_t sequence so far. // // Aside from the value, which uses the node lead unit's high bits: // @@ -560,15 +560,15 @@ class U_COMMON_API UCharsTrie : public UMemory { static const int32_t kMaxTwoUnitDelta=((kThreeUnitDeltaLead-kMinTwoUnitDeltaLead)<<16)-1; // 0x03feffff - UChar *ownedArray_; + char16_t *ownedArray_; // Fixed value referencing the UCharsTrie words. - const UChar *uchars_; + const char16_t *uchars_; // Iterator variables. // Pointer to next trie unit to read. NULL if no more matches. - const UChar *pos_; + const char16_t *pos_; // Remaining length of a linear-match node, minus 1. Negative if not in such a node. int32_t remainingMatchLength_; }; diff --git a/deps/icu-small/source/common/unicode/ucharstriebuilder.h b/deps/icu-small/source/common/unicode/ucharstriebuilder.h index cc9fb77a9176e0..2aa4757e52cb07 100644 --- a/deps/icu-small/source/common/unicode/ucharstriebuilder.h +++ b/deps/icu-small/source/common/unicode/ucharstriebuilder.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucharstriebuilder.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -89,21 +89,21 @@ class U_COMMON_API UCharsTrieBuilder : public StringTrieBuilder { UCharsTrie *build(UStringTrieBuildOption buildOption, UErrorCode &errorCode); /** - * Builds a UCharsTrie for the add()ed data and UChar-serializes it. + * Builds a UCharsTrie for the add()ed data and char16_t-serializes it. * Once built, no further data can be add()ed until clear() is called. * * A UCharsTrie cannot be empty. At least one (string, value) pair * must have been add()ed. * * Multiple calls to buildUnicodeString() set the UnicodeStrings to the - * builder's same UChar array, without rebuilding. + * builder's same char16_t array, without rebuilding. * If buildUnicodeString() is called after build(), the trie will be * re-serialized into a new array. * If build() is called after buildUnicodeString(), the trie object will become * the owner of the previously returned array. * After clear() has been called, a new array will be used as well. * @param buildOption Build option, see UStringTrieBuildOption. - * @param result A UnicodeString which will be set to the UChar-serialized + * @param result A UnicodeString which will be set to the char16_t-serialized * UCharsTrie for the add()ed data. * @param errorCode Standard ICU error code. Its input value must * pass the U_SUCCESS() test, or else the function returns @@ -135,14 +135,14 @@ class U_COMMON_API UCharsTrieBuilder : public StringTrieBuilder { void buildUChars(UStringTrieBuildOption buildOption, UErrorCode &errorCode); virtual int32_t getElementStringLength(int32_t i) const; - virtual UChar getElementUnit(int32_t i, int32_t unitIndex) const; + virtual char16_t getElementUnit(int32_t i, int32_t unitIndex) const; virtual int32_t getElementValue(int32_t i) const; virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t unitIndex) const; virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unitIndex) const; virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const; - virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UChar unit) const; + virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const; virtual UBool matchNodesCanHaveValues() const { return TRUE; } @@ -152,11 +152,11 @@ class U_COMMON_API UCharsTrieBuilder : public StringTrieBuilder { class UCTLinearMatchNode : public LinearMatchNode { public: - UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode); + UCTLinearMatchNode(const char16_t *units, int32_t len, Node *nextNode); virtual UBool operator==(const Node &other) const; virtual void write(StringTrieBuilder &builder); private: - const UChar *s; + const char16_t *s; }; virtual Node *createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t length, @@ -164,7 +164,7 @@ class U_COMMON_API UCharsTrieBuilder : public StringTrieBuilder { UBool ensureCapacity(int32_t length); virtual int32_t write(int32_t unit); - int32_t write(const UChar *s, int32_t length); + int32_t write(const char16_t *s, int32_t length); virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t length); virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal); virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node); @@ -175,9 +175,9 @@ class U_COMMON_API UCharsTrieBuilder : public StringTrieBuilder { int32_t elementsCapacity; int32_t elementsLength; - // UChar serialization of the trie. + // char16_t serialization of the trie. // Grows from the back: ucharsLength measures from the end of the buffer! - UChar *uchars; + char16_t *uchars; int32_t ucharsCapacity; int32_t ucharsLength; }; diff --git a/deps/icu-small/source/common/unicode/uchriter.h b/deps/icu-small/source/common/unicode/uchriter.h index 1365c9b7d1a0ae..38f67c5b454cba 100644 --- a/deps/icu-small/source/common/unicode/uchriter.h +++ b/deps/icu-small/source/common/unicode/uchriter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -15,18 +15,18 @@ /** * \file - * \brief C++ API: UChar Character Iterator + * \brief C++ API: char16_t Character Iterator */ U_NAMESPACE_BEGIN /** * A concrete subclass of CharacterIterator that iterates over the - * characters (code units or code points) in a UChar array. + * characters (code units or code points) in a char16_t array. * It's possible not only to create an - * iterator that iterates over an entire UChar array, but also to - * create one that iterates over only a subrange of a UChar array - * (iterators over different subranges of the same UChar array don't + * iterator that iterates over an entire char16_t array, but also to + * create one that iterates over only a subrange of a char16_t array + * (iterators over different subranges of the same char16_t array don't * compare equal). * @see CharacterIterator * @see ForwardCharacterIterator @@ -35,34 +35,34 @@ U_NAMESPACE_BEGIN class U_COMMON_API UCharCharacterIterator : public CharacterIterator { public: /** - * Create an iterator over the UChar array referred to by "textPtr". + * Create an iterator over the char16_t array referred to by "textPtr". * The iteration range is 0 to length-1. * text is only aliased, not adopted (the * destructor will not delete it). - * @param textPtr The UChar array to be iterated over - * @param length The length of the UChar array + * @param textPtr The char16_t array to be iterated over + * @param length The length of the char16_t array * @stable ICU 2.0 */ - UCharCharacterIterator(const UChar* textPtr, int32_t length); + UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length); /** - * Create an iterator over the UChar array referred to by "textPtr". + * Create an iterator over the char16_t array referred to by "textPtr". * The iteration range is 0 to length-1. * text is only aliased, not adopted (the * destructor will not delete it). * The starting * position is specified by "position". If "position" is outside the valid * iteration range, the behavior of this object is undefined. - * @param textPtr The UChar array to be iteratd over - * @param length The length of the UChar array + * @param textPtr The char16_t array to be iteratd over + * @param length The length of the char16_t array * @param position The starting position of the iteration * @stable ICU 2.0 */ - UCharCharacterIterator(const UChar* textPtr, int32_t length, + UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length, int32_t position); /** - * Create an iterator over the UChar array referred to by "textPtr". + * Create an iterator over the char16_t array referred to by "textPtr". * The iteration range is 0 to end-1. * text is only aliased, not adopted (the * destructor will not delete it). @@ -70,14 +70,14 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * position is specified by "position". If begin and end do not * form a valid iteration range or "position" is outside the valid * iteration range, the behavior of this object is undefined. - * @param textPtr The UChar array to be iterated over - * @param length The length of the UChar array + * @param textPtr The char16_t array to be iterated over + * @param length The length of the char16_t array * @param textBegin The begin position of the iteration range * @param textEnd The end position of the iteration range * @param position The starting position of the iteration * @stable ICU 2.0 */ - UCharCharacterIterator(const UChar* textPtr, int32_t length, + UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length, int32_t textBegin, int32_t textEnd, int32_t position); @@ -141,7 +141,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the first code unit in its iteration range. * @stable ICU 2.0 */ - virtual UChar first(void); + virtual char16_t first(void); /** * Sets the iterator to refer to the first code unit in its @@ -151,7 +151,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the first code unit in its iteration range * @stable ICU 2.0 */ - virtual UChar firstPostInc(void); + virtual char16_t firstPostInc(void); /** * Sets the iterator to refer to the first code point in its @@ -181,7 +181,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the last code unit in its iteration range. * @stable ICU 2.0 */ - virtual UChar last(void); + virtual char16_t last(void); /** * Sets the iterator to refer to the last code point in its @@ -200,7 +200,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the code unit * @stable ICU 2.0 */ - virtual UChar setIndex(int32_t position); + virtual char16_t setIndex(int32_t position); /** * Sets the iterator to refer to the beginning of the code point @@ -220,7 +220,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the code unit the iterator currently refers to. * @stable ICU 2.0 */ - virtual UChar current(void) const; + virtual char16_t current(void) const; /** * Returns the code point the iterator currently refers to. @@ -236,7 +236,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the next code unit in the iteration range. * @stable ICU 2.0 */ - virtual UChar next(void); + virtual char16_t next(void); /** * Gets the current code unit for returning and advances to the next code unit @@ -246,7 +246,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the current code unit. * @stable ICU 2.0 */ - virtual UChar nextPostInc(void); + virtual char16_t nextPostInc(void); /** * Advances to the next code point in the iteration range (toward @@ -288,7 +288,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the previous code unit in the iteration range. * @stable ICU 2.0 */ - virtual UChar previous(void); + virtual char16_t previous(void); /** * Advances to the previous code point in the iteration range (toward @@ -334,16 +334,20 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * @return the new position * @stable ICU 2.0 */ +#ifdef move32 + // One of the system headers right now is sometimes defining a conflicting macro we don't use +#undef move32 +#endif virtual int32_t move32(int32_t delta, EOrigin origin); /** * Sets the iterator to iterate over a new range of text * @stable ICU 2.0 */ - void setText(const UChar* newText, int32_t newTextLength); + void setText(ConstChar16Ptr newText, int32_t newTextLength); /** - * Copies the UChar array under iteration into the UnicodeString + * Copies the char16_t array under iteration into the UnicodeString * referred to by "result". Even if this iterator iterates across * only a part of this string, the whole string is copied. * @param result Receives a copy of the text under iteration. @@ -375,7 +379,7 @@ class U_COMMON_API UCharCharacterIterator : public CharacterIterator { * Protected member text * @stable ICU 2.0 */ - const UChar* text; + const char16_t* text; }; diff --git a/deps/icu-small/source/common/unicode/uclean.h b/deps/icu-small/source/common/unicode/uclean.h index 6a5a4f42b6c886..3f73af37b83e81 100644 --- a/deps/icu-small/source/common/unicode/uclean.h +++ b/deps/icu-small/source/common/unicode/uclean.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: uclean.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -101,7 +101,7 @@ u_init(UErrorCode *status); U_STABLE void U_EXPORT2 u_cleanup(void); - +U_CDECL_BEGIN /** * Pointer type for a user supplied memory allocation function. * @param context user supplied value, obtained from from u_setMemoryFunctions(). @@ -149,9 +149,10 @@ typedef void U_CALLCONV UMemFreeFn (const void *context, void *mem); * @system */ U_STABLE void U_EXPORT2 -u_setMemoryFunctions(const void *context, UMemAllocFn *a, UMemReallocFn *r, UMemFreeFn *f, +u_setMemoryFunctions(const void *context, UMemAllocFn * U_CALLCONV_FPTR a, UMemReallocFn * U_CALLCONV_FPTR r, UMemFreeFn * U_CALLCONV_FPTR f, UErrorCode *status); +U_CDECL_END #ifndef U_HIDE_DEPRECATED_API /********************************************************************************* @@ -172,6 +173,7 @@ u_setMemoryFunctions(const void *context, UMemAllocFn *a, UMemReallocFn *r, UMem */ typedef void *UMTX; +U_CDECL_BEGIN /** * Function Pointer type for a user supplied mutex initialization function. * The user-supplied function will be called by ICU whenever ICU needs to create a @@ -201,7 +203,7 @@ typedef void U_CALLCONV UMtxInitFn (const void *context, UMTX *mutex, UErrorCod * @system */ typedef void U_CALLCONV UMtxFn (const void *context, UMTX *mutex); - +U_CDECL_END /** * Set the functions that ICU will use for mutex operations diff --git a/deps/icu-small/source/common/unicode/ucnv.h b/deps/icu-small/source/common/unicode/ucnv.h index 767c1a2a7f44f1..05d0050f4a2fc9 100644 --- a/deps/icu-small/source/common/unicode/ucnv.h +++ b/deps/icu-small/source/common/unicode/ucnv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -29,7 +29,7 @@ * converter, you can get its properties, set options, convert your data and * close the converter.

* - *

Since many software programs recogize different converter names for + *

Since many software programs recognize different converter names for * different types of converters, there are other functions in this API to * iterate over the converter aliases. The functions {@link ucnv_getAvailableName() }, * {@link ucnv_getAlias() } and {@link ucnv_getStandardName() } are some of the @@ -184,7 +184,7 @@ typedef enum { /** * Function pointer for error callback in the codepage to unicode direction. - * Called when an error has occured in conversion to unicode, or on open/close of the callback (see reason). + * Called when an error has occurred in conversion to unicode, or on open/close of the callback (see reason). * @param context Pointer to the callback's private data * @param args Information about the conversion in progress * @param codeUnits Points to 'length' bytes of the concerned codepage sequence @@ -452,7 +452,7 @@ ucnv_openU(const UChar *name, * @param platform the platform in which the codepage number exists * @param err error status U_MEMORY_ALLOCATION_ERROR, U_FILE_ACCESS_ERROR * @return the created Unicode converter object, or NULL if an error - * occured. + * occurred. * @see ucnv_open * @see ucnv_openU * @see ucnv_close @@ -596,7 +596,7 @@ U_NAMESPACE_END * stateful, then subChars will be an empty string. * * @param converter the Unicode converter - * @param subChars the subsitution characters + * @param subChars the substitution characters * @param len on input the capacity of subChars, on output the number * of bytes copied to it * @param err the outgoing error status code. @@ -832,7 +832,7 @@ ucnv_getMinCharSize(const UConverter *converter); * name will be filled in. * * @param converter the Unicode converter. - * @param displayLocale is the specific Locale we want to localised for + * @param displayLocale is the specific Locale we want to localized for * @param displayName user provided buffer to be filled in * @param displayNameCapacity size of displayName Buffer * @param err error status code @@ -877,7 +877,7 @@ ucnv_getName(const UConverter *converter, UErrorCode *err); * * @param converter the Unicode converter * @param err the error status code. - * @return If any error occurrs, -1 will be returned otherwise, the codepage number + * @return If any error occurs, -1 will be returned otherwise, the codepage number * will be returned * @see ucnv_openCCSID * @see ucnv_getPlatform diff --git a/deps/icu-small/source/common/unicode/ucnv_cb.h b/deps/icu-small/source/common/unicode/ucnv_cb.h index a553481c45f893..632cc0b35f26c5 100644 --- a/deps/icu-small/source/common/unicode/ucnv_cb.h +++ b/deps/icu-small/source/common/unicode/ucnv_cb.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/ucnv_err.h b/deps/icu-small/source/common/unicode/ucnv_err.h index ea7f757d0ce799..e8a79bcd815fbc 100644 --- a/deps/icu-small/source/common/unicode/ucnv_err.h +++ b/deps/icu-small/source/common/unicode/ucnv_err.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/ucnvsel.h b/deps/icu-small/source/common/unicode/ucnvsel.h index b5820031a5a9f0..5fee53f179ace7 100644 --- a/deps/icu-small/source/common/unicode/ucnvsel.h +++ b/deps/icu-small/source/common/unicode/ucnvsel.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/unicode/uconfig.h b/deps/icu-small/source/common/unicode/uconfig.h index d681febf4f8c3d..5e28a146de3fff 100644 --- a/deps/icu-small/source/common/unicode/uconfig.h +++ b/deps/icu-small/source/common/unicode/uconfig.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: uconfig.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -76,7 +76,7 @@ #endif /** - * Determines wheter to enable auto cleanup of libraries. + * Determines whether to enable auto cleanup of libraries. * @internal */ #ifndef UCLN_NO_AUTO_CLEANUP @@ -262,7 +262,8 @@ /** * \def UCONFIG_NO_CONVERSION - * ICU will not completely build with this switch turned on. + * ICU will not completely build (compiling the tools fails) with this + * switch turned on. * This switch turns off all converters. * * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1 @@ -320,7 +321,9 @@ */ #ifndef UCONFIG_NO_NORMALIZATION # define UCONFIG_NO_NORMALIZATION 0 -#elif UCONFIG_NO_NORMALIZATION +#endif + +#if UCONFIG_NO_NORMALIZATION /* common library */ /* ICU 50 CJK dictionary BreakIterator uses normalization */ # define UCONFIG_NO_BREAK_ITERATION 1 diff --git a/deps/icu-small/source/common/unicode/ucurr.h b/deps/icu-small/source/common/unicode/ucurr.h index 8b5d41ae3b8a7f..ecb54d146f6ee3 100644 --- a/deps/icu-small/source/common/unicode/ucurr.h +++ b/deps/icu-small/source/common/unicode/ucurr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/udata.h b/deps/icu-small/source/common/unicode/udata.h index abc043f6d01c91..6419c359f606af 100644 --- a/deps/icu-small/source/common/unicode/udata.h +++ b/deps/icu-small/source/common/unicode/udata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: udata.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/udisplaycontext.h b/deps/icu-small/source/common/unicode/udisplaycontext.h index eaef02d7956ef4..398481c6812247 100644 --- a/deps/icu-small/source/common/unicode/udisplaycontext.h +++ b/deps/icu-small/source/common/unicode/udisplaycontext.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -44,14 +44,12 @@ enum UDisplayContextType { * @stable ICU 54 */ UDISPCTX_TYPE_DISPLAY_LENGTH = 2, -#ifndef U_HIDE_DRAFT_API /** * Type to retrieve the substitute handling setting, e.g. * UDISPCTX_SUBSTITUTE, UDISPCTX_NO_SUBSTITUTE. - * @draft ICU 58 + * @stable ICU 58 */ UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3 -#endif /* U_HIDE_DRAFT_API */ }; /** * @stable ICU 51 @@ -143,7 +141,6 @@ enum UDisplayContext { * @stable ICU 54 */ UDISPCTX_LENGTH_SHORT = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 1, -#ifndef U_HIDE_DRAFT_API /** * ================================ * SUBSTITUTE_HANDLING can be set to one of UDISPCTX_SUBSTITUTE or @@ -154,16 +151,15 @@ enum UDisplayContext { * A possible setting for SUBSTITUTE_HANDLING: * Returns a fallback value (e.g., the input code) when no data is available. * This is the default value. - * @draft ICU 58 + * @stable ICU 58 */ UDISPCTX_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 0, /** * A possible setting for SUBSTITUTE_HANDLING: * Returns a null value when no data is available. - * @draft ICU 58 + * @stable ICU 58 */ UDISPCTX_NO_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 1 -#endif /* U_HIDE_DRAFT_API */ }; /** diff --git a/deps/icu-small/source/common/unicode/uenum.h b/deps/icu-small/source/common/unicode/uenum.h index 50dde60da1824b..56faae895279b6 100644 --- a/deps/icu-small/source/common/unicode/uenum.h +++ b/deps/icu-small/source/common/unicode/uenum.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uenum.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * @@ -23,7 +23,9 @@ #include "unicode/localpointer.h" #if U_SHOW_CPLUSPLUS_API -#include "unicode/strenum.h" +U_NAMESPACE_BEGIN +class StringEnumeration; +U_NAMESPACE_END #endif /** diff --git a/deps/icu-small/source/common/unicode/uidna.h b/deps/icu-small/source/common/unicode/uidna.h index d49729a29ce846..cb79ba8545008e 100644 --- a/deps/icu-small/source/common/unicode/uidna.h +++ b/deps/icu-small/source/common/unicode/uidna.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uidna.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/uiter.h b/deps/icu-small/source/common/unicode/uiter.h index 74075e5a6e0ea7..3b8537204cecfa 100644 --- a/deps/icu-small/source/common/unicode/uiter.h +++ b/deps/icu-small/source/common/unicode/uiter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uiter.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/uldnames.h b/deps/icu-small/source/common/unicode/uldnames.h index 8a3dfd0a6a36fa..3a3c0a06573c36 100644 --- a/deps/icu-small/source/common/unicode/uldnames.h +++ b/deps/icu-small/source/common/unicode/uldnames.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/common/unicode/ulistformatter.h b/deps/icu-small/source/common/unicode/ulistformatter.h index bed18984e9c255..e98a9f045221d9 100644 --- a/deps/icu-small/source/common/unicode/ulistformatter.h +++ b/deps/icu-small/source/common/unicode/ulistformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -49,7 +49,7 @@ typedef struct UListFormatter UListFormatter; /**< C typedef for struct UListFo * or NULL if an error occurred. * @stable ICU 55 */ -U_STABLE UListFormatter* U_EXPORT2 +U_CAPI UListFormatter* U_EXPORT2 ulistfmt_open(const char* locale, UErrorCode* status); @@ -59,7 +59,7 @@ ulistfmt_open(const char* locale, * The UListFormatter object to close. * @stable ICU 55 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ulistfmt_close(UListFormatter *listfmt); @@ -116,7 +116,7 @@ U_NAMESPACE_END * total buffer size needed (e.g. for illegal arguments). * @stable ICU 55 */ -U_DRAFT int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ulistfmt_format(const UListFormatter* listfmt, const UChar* const strings[], const int32_t * stringLengths, diff --git a/deps/icu-small/source/common/unicode/uloc.h b/deps/icu-small/source/common/unicode/uloc.h index 5146000f28cca4..5531070841187d 100644 --- a/deps/icu-small/source/common/unicode/uloc.h +++ b/deps/icu-small/source/common/unicode/uloc.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -61,7 +61,7 @@ * http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt * *

- * The second option includes an additonal ISO Country + * The second option includes an additional ISO Country * Code. These codes are the upper-case two-letter codes * as defined by ISO-3166. * You can find a full list of these codes at a number of sites, such as: @@ -69,7 +69,7 @@ * http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html * *

- * The third option requires another additonal information--the + * The third option requires another additional information--the * Variant. * The Variant codes are vendor and browser-specific. * For example, use WIN for Windows, MAC for Macintosh, and POSIX for POSIX. @@ -157,7 +157,7 @@ * just a mechanism for identifying these services. * *

- * Each international serivce that performs locale-sensitive operations + * Each international service that performs locale-sensitive operations * allows you * to get all the available objects of that type. You can sift * through these objects by language, country, or variant, @@ -539,6 +539,9 @@ uloc_getISO3Country(const char* localeID); * Gets the Win32 LCID value for the specified locale. * If the ICU locale is not recognized by Windows, 0 will be returned. * + * LCIDs were deprecated with Windows Vista and Microsoft recommends + * that developers use BCP47 style tags instead (uloc_toLanguageTag). + * * @param localeID the locale to get the Win32 LCID value with * @return country the Win32 LCID for localeID * @stable ICU 2.0 @@ -577,7 +580,7 @@ uloc_getDisplayLanguage(const char* locale, * if the locale's language code is "en", passing Locale::getFrench() for * inLocale would result in "", while passing Locale::getGerman() * for inLocale would result in "". NULL may be used to specify the default. - * @param script the displayable country code for localeID + * @param script the displayable script for the localeID * @param scriptCapacity the size of the script buffer to store the * displayable script code with * @param status error information if retrieving the displayable script code failed @@ -852,10 +855,12 @@ uloc_openKeywords(const char* localeID, * Get the value for a keyword. Locale name does not need to be normalized. * * @param localeID locale name containing the keyword ("de_DE@currency=EURO;collation=PHONEBOOK") - * @param keywordName name of the keyword for which we want the value. Case insensitive. + * @param keywordName name of the keyword for which we want the value; must not be + * NULL or empty, and must consist only of [A-Za-z0-9]. Case insensitive. * @param buffer receiving buffer * @param bufferCapacity capacity of receiving buffer - * @param status containing error code - buffer not big enough. + * @param status containing error code: e.g. buffer not big enough or ill-formed localeID + * or keywordName parameters. * @return the length of keyword value * @stable ICU 2.8 */ @@ -872,18 +877,26 @@ uloc_getKeywordValue(const char* localeID, * For removing all keywords, use uloc_getBaseName(). * * NOTE: Unlike almost every other ICU function which takes a - * buffer, this function will NOT truncate the output text. If a - * BUFFER_OVERFLOW_ERROR is received, it means that the original - * buffer is untouched. This is done to prevent incorrect or possibly - * even malformed locales from being generated and used. - * - * @param keywordName name of the keyword to be set. Case insensitive. + * buffer, this function will NOT truncate the output text, and will + * not update the buffer with unterminated text setting a status of + * U_STRING_NOT_TERMINATED_WARNING. If a BUFFER_OVERFLOW_ERROR is received, + * it means a terminated version of the updated locale ID would not fit + * in the buffer, and the original buffer is untouched. This is done to + * prevent incorrect or possibly even malformed locales from being generated + * and used. + * + * @param keywordName name of the keyword to be set; must not be + * NULL or empty, and must consist only of [A-Za-z0-9]. Case insensitive. * @param keywordValue value of the keyword to be set. If 0-length or - * NULL, will result in the keyword being removed. No error is given if - * that keyword does not exist. - * @param buffer input buffer containing locale to be modified. + * NULL, will result in the keyword being removed; no error is given if + * that keyword does not exist. Otherwise, must consist only of + * [A-Za-z0-9] and [/_+-]. + * @param buffer input buffer containing well-formed locale ID to be + * modified. * @param bufferCapacity capacity of receiving buffer - * @param status containing error code - buffer not big enough. + * @param status containing error code: e.g. buffer not big enough + * or ill-formed keywordName or keywordValue parameters, or ill-formed + * locale ID in buffer on input. * @return the length needed for the buffer * @see uloc_getKeywordValue * @stable ICU 3.2 diff --git a/deps/icu-small/source/common/unicode/umachine.h b/deps/icu-small/source/common/unicode/umachine.h index 22820d4b003a55..30de4dba0dbf5b 100644 --- a/deps/icu-small/source/common/unicode/umachine.h +++ b/deps/icu-small/source/common/unicode/umachine.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: umachine.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -51,29 +51,6 @@ */ #include -#ifndef U_HIDE_INTERNAL_API -/* - * U_USE_CHAR16_T - * When defined, force use of char16_t for UChar. - * Note: char16_t is expected to become the default and required in the future, - * and this option will be removed. - * @internal - */ -#ifdef U_USE_CHAR16_T -#ifdef UCHAR_TYPE -#undef UCHAR_TYPE -#endif -#define UCHAR_TYPE char16_t - -/* - * In plain C, is needed for the definition of char16_t - */ -#ifndef __cplusplus -#include -#endif -#endif -#endif /* U_HIDE_INTERNAL_API */ - /*==========================================================================*/ /* For C wrappers, we use the symbol U_STABLE. */ /* This works properly if the includer is C or C++. */ @@ -313,30 +290,92 @@ typedef int8_t UBool; /** Number of bytes in a UChar. @stable ICU 2.0 */ #define U_SIZEOF_UCHAR 2 +/** + * \def U_CHAR16_IS_TYPEDEF + * If 1, then char16_t is a typedef and not a real type (yet) + * @internal + */ +#if (U_PLATFORM == U_PF_AIX) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11) +// for AIX, uchar.h needs to be included +# include +# define U_CHAR16_IS_TYPEDEF 1 +#else +# define U_CHAR16_IS_TYPEDEF 0 +#endif + + /** * \var UChar - * Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), - * or wchar_t if that is 16 bits wide; always assumed to be unsigned. - * If neither is available, then define UChar to be uint16_t. * - * This makes the definition of UChar platform-dependent - * but allows direct string type compatibility with platforms with - * 16-bit wchar_t types. + * The base type for UTF-16 code units and pointers. + * Unsigned 16-bit integer. + * Starting with ICU 59, C++ API uses char16_t directly, while C API continues to use UChar. + * + * UChar is configurable by defining the macro UCHAR_TYPE + * on the preprocessor or compiler command line: + * -DUCHAR_TYPE=uint16_t or -DUCHAR_TYPE=wchar_t (if U_SIZEOF_WCHAR_T==2) etc. + * (The UCHAR_TYPE can also be #defined earlier in this file, for outside the ICU library code.) + * This is for transitional use from application code that uses uint16_t or wchar_t for UTF-16. + * + * The default is UChar=char16_t. + * + * C++11 defines char16_t as bit-compatible with uint16_t, but as a distinct type. + * + * In C, char16_t is a simple typedef of uint_least16_t. + * ICU requires uint_least16_t=uint16_t for data memory mapping. + * On macOS, char16_t is not available because the uchar.h standard header is missing. * * @stable ICU 4.4 */ -#if defined(UCHAR_TYPE) + +#if 1 + // #if 1 is normal. UChar defaults to char16_t in C++. + // For configuration testing of UChar=uint16_t temporarily change this to #if 0. + // The intltest Makefile #defines UCHAR_TYPE=char16_t, + // so we only #define it to uint16_t if it is undefined so far. +#elif !defined(UCHAR_TYPE) +# define UCHAR_TYPE uint16_t +#endif + +#if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \ + defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) + // Inside the ICU library code, never configurable. + typedef char16_t UChar; +#elif defined(UCHAR_TYPE) typedef UCHAR_TYPE UChar; -/* Not #elif U_HAVE_CHAR16_T -- because that is type-incompatible with pre-C++11 callers - typedef char16_t UChar; */ -#elif U_SIZEOF_WCHAR_T==2 - typedef wchar_t UChar; -#elif defined(__CHAR16_TYPE__) - typedef __CHAR16_TYPE__ UChar; +#elif defined(__cplusplus) + typedef char16_t UChar; #else typedef uint16_t UChar; #endif +/** + * \var OldUChar + * Default ICU 58 definition of UChar. + * A base type for UTF-16 code units and pointers. + * Unsigned 16-bit integer. + * + * Define OldUChar to be wchar_t if that is 16 bits wide. + * If wchar_t is not 16 bits wide, then define UChar to be uint16_t. + * + * This makes the definition of OldUChar platform-dependent + * but allows direct string type compatibility with platforms with + * 16-bit wchar_t types. + * + * This is how UChar was defined in ICU 58, for transition convenience. + * Exception: ICU 58 UChar was defined to UCHAR_TYPE if that macro was defined. + * The current UChar responds to UCHAR_TYPE but OldUChar does not. + * + * @draft ICU 59 + */ +#if U_SIZEOF_WCHAR_T==2 + typedef wchar_t OldUChar; +#elif defined(__CHAR16_TYPE__) + typedef __CHAR16_TYPE__ OldUChar; +#else + typedef uint16_t OldUChar; +#endif + /** * Define UChar32 as a type for single Unicode code points. * UChar32 is a signed 32-bit integer (same as int32_t). diff --git a/deps/icu-small/source/common/unicode/umisc.h b/deps/icu-small/source/common/unicode/umisc.h index 4cc665721a00be..a46fa323c8c1a3 100644 --- a/deps/icu-small/source/common/unicode/umisc.h +++ b/deps/icu-small/source/common/unicode/umisc.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: umisc.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/unifilt.h b/deps/icu-small/source/common/unicode/unifilt.h index cedde81de4a0e1..99cce785b6eec8 100644 --- a/deps/icu-small/source/common/unicode/unifilt.h +++ b/deps/icu-small/source/common/unicode/unifilt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -30,7 +30,7 @@ U_NAMESPACE_BEGIN * defined range. * @stable ICU 3.0 */ -#define U_ETHER ((UChar)0xFFFF) +#define U_ETHER ((char16_t)0xFFFF) /** * diff --git a/deps/icu-small/source/common/unicode/unifunct.h b/deps/icu-small/source/common/unicode/unifunct.h index 724893ad962bb0..66a02ce7cd5ce8 100644 --- a/deps/icu-small/source/common/unicode/unifunct.h +++ b/deps/icu-small/source/common/unicode/unifunct.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/unimatch.h b/deps/icu-small/source/common/unicode/unimatch.h index a83199ef61f720..8bf39950187b1b 100644 --- a/deps/icu-small/source/common/unicode/unimatch.h +++ b/deps/icu-small/source/common/unicode/unimatch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2001-2005, International Business Machines Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/common/unicode/uniset.h b/deps/icu-small/source/common/unicode/uniset.h index 32e973dd791d5d..914818a00ec41a 100644 --- a/deps/icu-small/source/common/unicode/uniset.h +++ b/deps/icu-small/source/common/unicode/uniset.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -294,7 +294,7 @@ class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter { * indicating that toPattern() must generate a pattern * representation from the inversion list. */ - UChar *pat; + char16_t *pat; UVector* strings; // maintained in sorted order UnicodeSetStringSpan *stringSpan; @@ -891,7 +891,7 @@ class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter { * @stable ICU 3.8 * @see USetSpanCondition */ - 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; /** * Returns the end of the substring of the input string according to the USetSpanCondition. @@ -924,7 +924,7 @@ class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter { * @stable ICU 3.8 * @see USetSpanCondition */ - 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; /** * Returns the start of the substring of the input string according to the USetSpanCondition. diff --git a/deps/icu-small/source/common/unicode/unistr.h b/deps/icu-small/source/common/unicode/unistr.h index 6f62244a1e2824..b99a686126c4e1 100644 --- a/deps/icu-small/source/common/unicode/unistr.h +++ b/deps/icu-small/source/common/unicode/unistr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -28,25 +28,16 @@ * \brief C++ API: Unicode String */ +#include #include "unicode/utypes.h" +#include "unicode/char16ptr.h" #include "unicode/rep.h" #include "unicode/std_string.h" #include "unicode/stringpiece.h" #include "unicode/bytestream.h" -#include "unicode/ucasemap.h" struct UConverter; // unicode/ucnv.h -#ifndef U_COMPARE_CODE_POINT_ORDER -/* see also ustring.h and unorm.h */ -/** - * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: - * Compare strings in code point order instead of code unit order. - * @stable ICU 2.2 - */ -#define U_COMPARE_CODE_POINT_ORDER 0x8000 -#endif - #ifndef USTRING_H /** * \ingroup ustring_ustrlen @@ -55,30 +46,34 @@ U_STABLE int32_t U_EXPORT2 u_strlen(const UChar *s); #endif -/** - * \def U_STRING_CASE_MAPPER_DEFINED - * @internal - */ -#ifndef U_STRING_CASE_MAPPER_DEFINED -#define U_STRING_CASE_MAPPER_DEFINED +U_NAMESPACE_BEGIN + +#if !UCONFIG_NO_BREAK_ITERATION +class BreakIterator; // unicode/brkiter.h +#endif +class Edits; + +U_NAMESPACE_END +// Not #ifndef U_HIDE_INTERNAL_API because UnicodeString needs the UStringCaseMapper. /** * Internal string case mapping function type. + * All error checking must be done. + * src and dest must not overlap. * @internal */ typedef int32_t U_CALLCONV -UStringCaseMapper(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode); - +UStringCaseMapper(int32_t caseLocale, uint32_t options, +#if !UCONFIG_NO_BREAK_ITERATION + icu::BreakIterator *iter, #endif + char16_t *dest, int32_t destCapacity, + const char16_t *src, int32_t srcLength, + icu::Edits *edits, + UErrorCode &errorCode); U_NAMESPACE_BEGIN -#if !UCONFIG_NO_BREAK_ITERATION -class BreakIterator; // unicode/brkiter.h -#endif class Locale; // unicode/locid.h class StringCharacterIterator; class UnicodeStringAppendable; // unicode/appendable.h @@ -99,10 +94,12 @@ class UnicodeStringAppendable; // unicode/appendable.h /** * Unicode String literals in C++. - * Dependent on the platform properties, different UnicodeString - * constructors should be used to create a UnicodeString object from - * a string literal. - * The macros are defined for maximum performance. + * + * Note: these macros are not recommended for new code. + * Prior to the availability of C++11 and u"unicode string literals", + * these macros were provided for portability and efficiency when + * initializing UnicodeStrings from literals. + * * They work only for strings that contain "invariant characters", i.e., * only latin letters, digits, and some punctuation. * See utypes.h for details. @@ -110,18 +107,12 @@ class UnicodeStringAppendable; // unicode/appendable.h * The string parameter must be a C string literal. * The length of the string, not including the terminating * NUL, must be specified as a constant. - * The U_STRING_DECL macro should be invoked exactly once for one - * such string variable before it is used. * @stable ICU 2.0 */ -#if defined(U_DECLARE_UTF16) -# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)U_DECLARE_UTF16(cs), _length) -#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16))) -# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)L ## cs, _length) -#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY -# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)cs, _length) +#if !U_CHAR16_IS_TYPEDEF +# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, u ## cs, _length) #else -# define UNICODE_STRING(cs, _length) icu::UnicodeString(cs, _length, US_INV) +# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const char16_t*)u ## cs, _length) #endif /** @@ -142,7 +133,7 @@ class UnicodeStringAppendable; // unicode/appendable.h /** * \def UNISTR_FROM_CHAR_EXPLICIT * This can be defined to be empty or "explicit". - * If explicit, then the UnicodeString(UChar) and UnicodeString(UChar32) + * If explicit, then the UnicodeString(char16_t) and UnicodeString(UChar32) * constructors are marked as explicit, preventing their inadvertent use. * @stable ICU 49 */ @@ -159,7 +150,7 @@ class UnicodeStringAppendable; // unicode/appendable.h /** * \def UNISTR_FROM_STRING_EXPLICIT * This can be defined to be empty or "explicit". - * If explicit, then the UnicodeString(const char *) and UnicodeString(const UChar *) + * If explicit, then the UnicodeString(const char *) and UnicodeString(const char16_t *) * constructors are marked as explicit, preventing their inadvertent use. * * In particular, this helps prevent accidentally depending on ICU conversion code @@ -193,18 +184,18 @@ class UnicodeStringAppendable; // unicode/appendable.h * to 4 * sizeof(pointer) (or 3 * sizeof(pointer) for P128 data models), * to hold the fields for heap-allocated strings. * Such a minimum size also ensures that the object is easily large enough - * to hold at least 2 UChars, for one supplementary code point (U16_MAX_LENGTH). + * to hold at least 2 char16_ts, for one supplementary code point (U16_MAX_LENGTH). * * sizeof(UnicodeString) >= 48 should work for all known platforms. * * For example, on a 64-bit machine where sizeof(vtable pointer) is 8, * sizeof(UnicodeString) = 64 would leave space for * (64 - sizeof(vtable pointer) - 2) / U_SIZEOF_UCHAR = (64 - 8 - 2) / 2 = 27 - * UChars stored inside the object. + * char16_ts stored inside the object. * * The minimum object size on a 64-bit machine would be * 4 * sizeof(pointer) = 4 * 8 = 32 bytes, - * and the internal buffer would hold up to 11 UChars in that case. + * and the internal buffer would hold up to 11 char16_ts in that case. * * @see U16_MAX_LENGTH * @stable ICU 56 @@ -236,7 +227,7 @@ class UnicodeStringAppendable; // unicode/appendable.h *

In ICU, a Unicode string consists of 16-bit Unicode code units. * A Unicode character may be stored with either one code unit * (the most common case) or with a matched pair of special code units - * ("surrogates"). The data type for code units is UChar. + * ("surrogates"). The data type for code units is char16_t. * For single-character handling, a Unicode character code point is a value * in the range 0..0x10ffff. ICU uses the UChar32 type for code points.

* @@ -252,7 +243,7 @@ class UnicodeStringAppendable; // unicode/appendable.h * than other ICU APIs. In particular: * - If indexes are out of bounds for a UnicodeString object * (<0 or >length()) then they are "pinned" to the nearest boundary. - * - If primitive string pointer values (e.g., const UChar * or char *) + * - If primitive string pointer values (e.g., const char16_t * or char *) * for input strings are NULL, then those input string parameters are treated * as if they pointed to an empty string. * However, this is not the case for char * parameters for charset names @@ -439,7 +430,7 @@ class U_COMMON_API UnicodeString : public Replaceable * in srcChars. * @stable ICU 2.0 */ - inline int8_t compare(const UChar *srcChars, + inline int8_t compare(ConstChar16Ptr srcChars, int32_t srcLength) const; /** @@ -458,7 +449,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline int8_t compare(int32_t start, int32_t length, - const UChar *srcChars) const; + const char16_t *srcChars) const; /** * Compare the characters bitwise in the range @@ -479,7 +470,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline int8_t compare(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const; @@ -593,7 +584,7 @@ class U_COMMON_API UnicodeString : public Replaceable * in code point order * @stable ICU 2.0 */ - inline int8_t compareCodePointOrder(const UChar *srcChars, + inline int8_t compareCodePointOrder(ConstChar16Ptr srcChars, int32_t srcLength) const; /** @@ -617,7 +608,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline int8_t compareCodePointOrder(int32_t start, int32_t length, - const UChar *srcChars) const; + const char16_t *srcChars) const; /** * Compare two Unicode strings in code point order. @@ -642,7 +633,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline int8_t compareCodePointOrder(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const; @@ -766,7 +757,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return A negative, zero, or positive integer indicating the comparison result. * @stable ICU 2.0 */ - inline int8_t caseCompare(const UChar *srcChars, + inline int8_t caseCompare(ConstChar16Ptr srcChars, int32_t srcLength, uint32_t options) const; @@ -792,7 +783,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline int8_t caseCompare(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, uint32_t options) const; /** @@ -819,7 +810,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline int8_t caseCompare(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength, uint32_t options) const; @@ -884,7 +875,7 @@ class U_COMMON_API UnicodeString : public Replaceable * FALSE otherwise * @stable ICU 2.0 */ - inline UBool startsWith(const UChar *srcChars, + inline UBool startsWith(ConstChar16Ptr srcChars, int32_t srcLength) const; /** @@ -896,7 +887,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return TRUE if this ends with the characters in srcChars, FALSE otherwise * @stable ICU 2.0 */ - inline UBool startsWith(const UChar *srcChars, + inline UBool startsWith(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const; @@ -931,7 +922,7 @@ class U_COMMON_API UnicodeString : public Replaceable * FALSE otherwise * @stable ICU 2.0 */ - inline UBool endsWith(const UChar *srcChars, + inline UBool endsWith(ConstChar16Ptr srcChars, int32_t srcLength) const; /** @@ -944,7 +935,7 @@ class U_COMMON_API UnicodeString : public Replaceable * FALSE otherwise * @stable ICU 2.0 */ - inline UBool endsWith(const UChar *srcChars, + inline UBool endsWith(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const; @@ -1021,7 +1012,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or -1 if not found. * @stable ICU 2.0 */ - inline int32_t indexOf(const UChar *srcChars, + inline int32_t indexOf(const char16_t *srcChars, int32_t srcLength, int32_t start) const; @@ -1037,7 +1028,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or -1 if not found. * @stable ICU 2.0 */ - inline int32_t indexOf(const UChar *srcChars, + inline int32_t indexOf(ConstChar16Ptr srcChars, int32_t srcLength, int32_t start, int32_t length) const; @@ -1058,7 +1049,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or -1 if not found. * @stable ICU 2.0 */ - int32_t indexOf(const UChar *srcChars, + int32_t indexOf(const char16_t *srcChars, int32_t srcStart, int32_t srcLength, int32_t start, @@ -1071,7 +1062,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return The offset into this of c, or -1 if not found. * @stable ICU 2.0 */ - inline int32_t indexOf(UChar c) const; + inline int32_t indexOf(char16_t c) const; /** * Locate in this the first occurrence of the code point c, @@ -1091,7 +1082,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return The offset into this of c, or -1 if not found. * @stable ICU 2.0 */ - inline int32_t indexOf(UChar c, + inline int32_t indexOf(char16_t c, int32_t start) const; /** @@ -1116,7 +1107,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return The offset into this of c, or -1 if not found. * @stable ICU 2.0 */ - inline int32_t indexOf(UChar c, + inline int32_t indexOf(char16_t c, int32_t start, int32_t length) const; @@ -1204,7 +1195,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or -1 if not found. * @stable ICU 2.0 */ - inline int32_t lastIndexOf(const UChar *srcChars, + inline int32_t lastIndexOf(const char16_t *srcChars, int32_t srcLength, int32_t start) const; @@ -1220,7 +1211,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or -1 if not found. * @stable ICU 2.0 */ - inline int32_t lastIndexOf(const UChar *srcChars, + inline int32_t lastIndexOf(ConstChar16Ptr srcChars, int32_t srcLength, int32_t start, int32_t length) const; @@ -1241,7 +1232,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or -1 if not found. * @stable ICU 2.0 */ - int32_t lastIndexOf(const UChar *srcChars, + int32_t lastIndexOf(const char16_t *srcChars, int32_t srcStart, int32_t srcLength, int32_t start, @@ -1254,7 +1245,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return The offset into this of c, or -1 if not found. * @stable ICU 2.0 */ - inline int32_t lastIndexOf(UChar c) const; + inline int32_t lastIndexOf(char16_t c) const; /** * Locate in this the last occurrence of the code point c, @@ -1274,7 +1265,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return The offset into this of c, or -1 if not found. * @stable ICU 2.0 */ - inline int32_t lastIndexOf(UChar c, + inline int32_t lastIndexOf(char16_t c, int32_t start) const; /** @@ -1299,7 +1290,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return The offset into this of c, or -1 if not found. * @stable ICU 2.0 */ - inline int32_t lastIndexOf(UChar c, + inline int32_t lastIndexOf(char16_t c, int32_t start, int32_t length) const; @@ -1329,7 +1320,7 @@ class U_COMMON_API UnicodeString : public Replaceable * or 0xffff if the offset is not valid for this string * @stable ICU 2.0 */ - inline UChar charAt(int32_t offset) const; + inline char16_t charAt(int32_t offset) const; /** * Return the code unit at offset offset. @@ -1338,7 +1329,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return the code unit at offset offset * @stable ICU 2.0 */ - inline UChar operator[] (int32_t offset) const; + inline char16_t operator[] (int32_t offset) const; /** * Return the code point that contains the code unit @@ -1459,7 +1450,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline void extract(int32_t start, int32_t length, - UChar *dst, + Char16Ptr dst, int32_t dstStart = 0) const; /** @@ -1478,13 +1469,13 @@ class U_COMMON_API UnicodeString : public Replaceable * then extract() will not copy the contents. * * @param dest Destination string buffer. - * @param destCapacity Number of UChars available at dest. + * @param destCapacity Number of char16_ts available at dest. * @param errorCode ICU error code. * @return length() * @stable ICU 2.0 */ int32_t - extract(UChar *dest, int32_t destCapacity, + extract(Char16Ptr dest, int32_t destCapacity, UErrorCode &errorCode) const; /** @@ -1514,7 +1505,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline void extractBetween(int32_t start, int32_t limit, - UChar *dst, + char16_t *dst, int32_t dstStart = 0) const; /** @@ -1715,8 +1706,6 @@ class U_COMMON_API UnicodeString : public Replaceable */ void toUTF8(ByteSink &sink) const; -#if U_HAVE_STD_STRING - /** * Convert the UnicodeString to UTF-8 and append the result * to a standard string. @@ -1731,13 +1720,11 @@ class U_COMMON_API UnicodeString : public Replaceable */ template StringClass &toUTF8String(StringClass &result) const { - StringByteSink sbs(&result); + StringByteSink sbs(&result, length()); toUTF8(sbs); return result; } -#endif - /** * Convert the UnicodeString to UTF-32. * Unpaired surrogates are replaced with U+FFFD. @@ -1759,7 +1746,7 @@ class U_COMMON_API UnicodeString : public Replaceable /** * Return the length of the UnicodeString object. - * The length is the number of UChar code units are in the UnicodeString. + * The length is the number of char16_t code units are in the UnicodeString. * If you want the number of code points, please use countChar32(). * @return the length of the UnicodeString object * @see countChar32 @@ -1768,14 +1755,14 @@ class U_COMMON_API UnicodeString : public Replaceable inline int32_t length(void) const; /** - * Count Unicode code points in the length UChar code units of the string. - * A code point may occupy either one or two UChar code units. + * Count Unicode code points in the length char16_t code units of the string. + * A code point may occupy either one or two char16_t code units. * Counting code points involves reading all code units. * * This functions is basically the inverse of moveIndex32(). * * @param start the index of the first code unit to check - * @param length the number of UChar code units to check + * @param length the number of char16_t code units to check * @return the number of code points in the specified code units * @see length * @stable ICU 2.0 @@ -1784,7 +1771,7 @@ class U_COMMON_API UnicodeString : public Replaceable countChar32(int32_t start=0, int32_t length=INT32_MAX) const; /** - * Check if the length UChar code units of the string + * Check if the length char16_t code units of the string * contain more Unicode code points than a certain number. * This is more efficient than counting all code points in this part of the string * and comparing that number with a threshold. @@ -1792,10 +1779,10 @@ class U_COMMON_API UnicodeString : public Replaceable * falls within a certain range, and * never needs to count more than 'number+1' code points. * Logically equivalent to (countChar32(start, length)>number). - * A Unicode code point may occupy either one or two UChar code units. + * A Unicode code point may occupy either one or two char16_t code units. * * @param start the index of the first code unit to check (0 for the entire string) - * @param length the number of UChar code units to check + * @param length the number of char16_t code units to check * (use INT32_MAX for the entire string; remember that start/length * values are pinned) * @param number The number of code points in the (sub)string is compared against @@ -1821,7 +1808,7 @@ class U_COMMON_API UnicodeString : public Replaceable * This is useful together with the getBuffer functions. * See there for details. * - * @return the number of UChars available in the internal buffer + * @return the number of char16_ts available in the internal buffer * @see getBuffer * @stable ICU 2.0 */ @@ -1904,7 +1891,6 @@ class U_COMMON_API UnicodeString : public Replaceable */ UnicodeString &fastCopyFrom(const UnicodeString &src); -#if U_HAVE_RVALUE_REFERENCES /** * Move assignment operator, might leave src in bogus state. * This string will have the same contents and state that the source string had. @@ -1916,7 +1902,7 @@ class U_COMMON_API UnicodeString : public Replaceable UnicodeString &operator=(UnicodeString &&src) U_NOEXCEPT { return moveFrom(src); } -#endif + // do not use #ifndef U_HIDE_DRAFT_API for moveFrom, needed by non-draft API /** * Move assignment, might leave src in bogus state. @@ -1955,7 +1941,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - inline UnicodeString& operator= (UChar ch); + inline UnicodeString& operator= (char16_t ch); /** * Assignment operator. Replace the characters in this UnicodeString @@ -2015,7 +2001,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - inline UnicodeString& setTo(const UChar *srcChars, + inline UnicodeString& setTo(const char16_t *srcChars, int32_t srcLength); /** @@ -2026,7 +2012,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - UnicodeString& setTo(UChar srcChar); + UnicodeString& setTo(char16_t srcChar); /** * Set the characters in the UnicodeString object to the code point @@ -2039,7 +2025,7 @@ class U_COMMON_API UnicodeString : public Replaceable UnicodeString& setTo(UChar32 srcChar); /** - * Aliasing setTo() function, analogous to the readonly-aliasing UChar* constructor. + * Aliasing setTo() function, analogous to the readonly-aliasing char16_t* constructor. * The text will be used for the UnicodeString object, but * it will not be released when the UnicodeString is destroyed. * This has copy-on-write semantics: @@ -2062,11 +2048,11 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ UnicodeString &setTo(UBool isTerminated, - const UChar *text, + ConstChar16Ptr text, int32_t textLength); /** - * Aliasing setTo() function, analogous to the writable-aliasing UChar* constructor. + * Aliasing setTo() function, analogous to the writable-aliasing char16_t* constructor. * The text will be used for the UnicodeString object, but * it will not be released when the UnicodeString is destroyed. * This has write-through semantics: @@ -2075,16 +2061,16 @@ class U_COMMON_API UnicodeString : public Replaceable * a new buffer will be allocated and the contents copied as with regularly * constructed strings. * In an assignment to another UnicodeString, the buffer will be copied. - * The extract(UChar *dst) function detects whether the dst pointer is the same + * The extract(Char16Ptr dst) function detects whether the dst pointer is the same * as the string buffer itself and will in this case not copy the contents. * * @param buffer The characters to alias for the UnicodeString. * @param buffLength The number of Unicode characters in buffer to alias. - * @param buffCapacity The size of buffer in UChars. + * @param buffCapacity The size of buffer in char16_ts. * @return a reference to this * @stable ICU 2.0 */ - UnicodeString &setTo(UChar *buffer, + UnicodeString &setTo(char16_t *buffer, int32_t buffLength, int32_t buffCapacity); @@ -2120,7 +2106,7 @@ class U_COMMON_API UnicodeString : public Replaceable * s.truncate(0); // set to an empty string (complete truncation), or * s=UnicodeString(); // assign an empty string, or * s.setTo((UChar32)-1); // set to a pseudo code point that is out of range, or - * static const UChar nul=0; + * static const char16_t nul=0; * s.setTo(&nul, 0); // set to an empty C Unicode string * } * \endcode @@ -2138,7 +2124,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ UnicodeString& setCharAt(int32_t offset, - UChar ch); + char16_t ch); /* Append operations */ @@ -2150,7 +2136,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - inline UnicodeString& operator+= (UChar ch); + inline UnicodeString& operator+= (char16_t ch); /** * Append operator. Append the code point ch to the UnicodeString @@ -2210,7 +2196,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - inline UnicodeString& append(const UChar *srcChars, + inline UnicodeString& append(const char16_t *srcChars, int32_t srcStart, int32_t srcLength); @@ -2223,7 +2209,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - inline UnicodeString& append(const UChar *srcChars, + inline UnicodeString& append(ConstChar16Ptr srcChars, int32_t srcLength); /** @@ -2232,7 +2218,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @return a reference to this * @stable ICU 2.0 */ - inline UnicodeString& append(UChar srcChar); + inline UnicodeString& append(char16_t srcChar); /** * Append the code point srcChar to the UnicodeString object. @@ -2288,7 +2274,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ inline UnicodeString& insert(int32_t start, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength); @@ -2302,7 +2288,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ inline UnicodeString& insert(int32_t start, - const UChar *srcChars, + ConstChar16Ptr srcChars, int32_t srcLength); /** @@ -2314,7 +2300,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ inline UnicodeString& insert(int32_t start, - UChar srcChar); + char16_t srcChar); /** * Insert the code point srcChar into the UnicodeString object at @@ -2388,7 +2374,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ UnicodeString& replace(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength); @@ -2406,7 +2392,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline UnicodeString& replace(int32_t start, int32_t length, - const UChar *srcChars, + ConstChar16Ptr srcChars, int32_t srcLength); /** @@ -2422,7 +2408,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline UnicodeString& replace(int32_t start, int32_t length, - UChar srcChar); + char16_t srcChar); /** * Replace the characters in the range @@ -2620,7 +2606,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ UBool padLeading(int32_t targetLength, - UChar padChar = 0x0020); + char16_t padChar = 0x0020); /** * Pad the end of this UnicodeString with the character padChar. @@ -2634,7 +2620,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ UBool padTrailing(int32_t targetLength, - UChar padChar = 0x0020); + char16_t padChar = 0x0020); /** * Truncate this UnicodeString to the targetLength. @@ -2789,11 +2775,11 @@ class U_COMMON_API UnicodeString : public Replaceable * break iterator is opened. * Otherwise the provided iterator is set to the string's text. * @param locale The locale to consider. + * @param options Options bit set, usually 0. See U_TITLECASE_NO_LOWERCASE, + * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, + * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. * @param options Options bit set, see ucasemap_open(). * @return A reference to this. - * @see U_TITLECASE_NO_LOWERCASE - * @see U_TITLECASE_NO_BREAK_ADJUSTMENT - * @see ucasemap_open * @stable ICU 3.8 */ UnicodeString &toTitle(BreakIterator *titleIter, const Locale &locale, uint32_t options); @@ -2821,7 +2807,7 @@ class U_COMMON_API UnicodeString : public Replaceable /** * Get a read/write pointer to the internal buffer. - * The buffer is guaranteed to be large enough for at least minCapacity UChars, + * The buffer is guaranteed to be large enough for at least minCapacity char16_ts, * writable, and is still owned by the UnicodeString object. * Calls to getBuffer(minCapacity) must not be nested, and * must be matched with calls to releaseBuffer(newLength). @@ -2852,17 +2838,17 @@ class U_COMMON_API UnicodeString : public Replaceable * - You must call releaseBuffer(newLength) before and in order to * return to normal UnicodeString operation. * - * @param minCapacity the minimum number of UChars that are to be available + * @param minCapacity the minimum number of char16_ts that are to be available * in the buffer, starting at the returned pointer; * default to the current string capacity if minCapacity==-1 * @return a writable pointer to the internal string buffer, - * or 0 if an error occurs (nested calls, out of memory) + * or nullptr if an error occurs (nested calls, out of memory) * * @see releaseBuffer * @see getTerminatedBuffer() * @stable ICU 2.0 */ - UChar *getBuffer(int32_t minCapacity); + char16_t *getBuffer(int32_t minCapacity); /** * Release a read/write buffer on a UnicodeString object with an @@ -2910,13 +2896,13 @@ class U_COMMON_API UnicodeString : public Replaceable * be modified. * * @return a read-only pointer to the internal string buffer, - * or 0 if the string is empty or bogus + * or nullptr if the string is empty or bogus * * @see getBuffer(int32_t minCapacity) * @see getTerminatedBuffer() * @stable ICU 2.0 */ - inline const UChar *getBuffer() const; + inline const char16_t *getBuffer() const; /** * Get a read-only pointer to the internal buffer, @@ -2951,7 +2937,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @see getBuffer() * @stable ICU 2.2 */ - const UChar *getTerminatedBuffer(); + const char16_t *getTerminatedBuffer(); //======================================== // Constructors @@ -2963,8 +2949,8 @@ class U_COMMON_API UnicodeString : public Replaceable inline UnicodeString(); /** - * Construct a UnicodeString with capacity to hold capacity UChars - * @param capacity the number of UChars this UnicodeString should hold + * Construct a UnicodeString with capacity to hold capacity char16_ts + * @param capacity the number of char16_ts this UnicodeString should hold * before a resize is necessary; if count is greater than 0 and count * code points c take up more space than capacity, then capacity is adjusted * accordingly. @@ -2976,7 +2962,7 @@ class U_COMMON_API UnicodeString : public Replaceable UnicodeString(int32_t capacity, UChar32 c, int32_t count); /** - * Single UChar (code unit) constructor. + * Single char16_t (code unit) constructor. * * It is recommended to mark this constructor "explicit" by * -DUNISTR_FROM_CHAR_EXPLICIT=explicit @@ -2984,7 +2970,7 @@ class U_COMMON_API UnicodeString : public Replaceable * @param ch the character to place in the UnicodeString * @stable ICU 2.0 */ - UNISTR_FROM_CHAR_EXPLICIT UnicodeString(UChar ch); + UNISTR_FROM_CHAR_EXPLICIT UnicodeString(char16_t ch); /** * Single UChar32 (code point) constructor. @@ -2998,7 +2984,7 @@ class U_COMMON_API UnicodeString : public Replaceable UNISTR_FROM_CHAR_EXPLICIT UnicodeString(UChar32 ch); /** - * UChar* constructor. + * char16_t* constructor. * * It is recommended to mark this constructor "explicit" by * -DUNISTR_FROM_STRING_EXPLICIT=explicit @@ -3007,20 +2993,121 @@ class U_COMMON_API UnicodeString : public Replaceable * must be NULL (U+0000) terminated. * @stable ICU 2.0 */ - UNISTR_FROM_STRING_EXPLICIT UnicodeString(const UChar *text); + UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char16_t *text); + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ +#if !U_CHAR16_IS_TYPEDEF + /** + * uint16_t * constructor. + * Delegates to UnicodeString(const char16_t *). + * + * It is recommended to mark this constructor "explicit" by + * -DUNISTR_FROM_STRING_EXPLICIT=explicit + * on the compiler command line or similar. + * @param text NUL-terminated UTF-16 string + * @draft ICU 59 + */ + UNISTR_FROM_STRING_EXPLICIT UnicodeString(const uint16_t *text) : + UnicodeString(ConstChar16Ptr(text)) {} +#endif + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ +#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN) + /** + * wchar_t * constructor. + * (Only defined if U_SIZEOF_WCHAR_T==2.) + * Delegates to UnicodeString(const char16_t *). + * + * It is recommended to mark this constructor "explicit" by + * -DUNISTR_FROM_STRING_EXPLICIT=explicit + * on the compiler command line or similar. + * @param text NUL-terminated UTF-16 string + * @draft ICU 59 + */ + UNISTR_FROM_STRING_EXPLICIT UnicodeString(const wchar_t *text) : + UnicodeString(ConstChar16Ptr(text)) {} +#endif + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ /** - * UChar* constructor. + * nullptr_t constructor. + * Effectively the same as the default constructor, makes an empty string object. + * + * It is recommended to mark this constructor "explicit" by + * -DUNISTR_FROM_STRING_EXPLICIT=explicit + * on the compiler command line or similar. + * @param text nullptr + * @draft ICU 59 + */ + UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text); + + /** + * char16_t* constructor. * @param text The characters to place in the UnicodeString. * @param textLength The number of Unicode characters in text * to copy. * @stable ICU 2.0 */ - UnicodeString(const UChar *text, + UnicodeString(const char16_t *text, int32_t textLength); + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ +#if !U_CHAR16_IS_TYPEDEF + /** + * uint16_t * constructor. + * Delegates to UnicodeString(const char16_t *, int32_t). + * @param text UTF-16 string + * @param length string length + * @draft ICU 59 + */ + UnicodeString(const uint16_t *text, int32_t length) : + UnicodeString(ConstChar16Ptr(text), length) {} +#endif + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ +#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN) + /** + * wchar_t * constructor. + * (Only defined if U_SIZEOF_WCHAR_T==2.) + * Delegates to UnicodeString(const char16_t *, int32_t). + * @param text NUL-terminated UTF-16 string + * @param length string length + * @draft ICU 59 + */ + UnicodeString(const wchar_t *text, int32_t length) : + UnicodeString(ConstChar16Ptr(text), length) {} +#endif + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ /** - * Readonly-aliasing UChar* constructor. + * nullptr_t constructor. + * Effectively the same as the default constructor, makes an empty string object. + * @param text nullptr + * @param length ignored + * @draft ICU 59 + */ + inline UnicodeString(const std::nullptr_t text, int32_t length); + + /** + * Readonly-aliasing char16_t* constructor. * The text will be used for the UnicodeString object, but * it will not be released when the UnicodeString is destroyed. * This has copy-on-write semantics: @@ -3042,11 +3129,11 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 2.0 */ UnicodeString(UBool isTerminated, - const UChar *text, + ConstChar16Ptr text, int32_t textLength); /** - * Writable-aliasing UChar* constructor. + * Writable-aliasing char16_t* constructor. * The text will be used for the UnicodeString object, but * it will not be released when the UnicodeString is destroyed. * This has write-through semantics: @@ -3055,15 +3142,64 @@ class U_COMMON_API UnicodeString : public Replaceable * a new buffer will be allocated and the contents copied as with regularly * constructed strings. * In an assignment to another UnicodeString, the buffer will be copied. - * The extract(UChar *dst) function detects whether the dst pointer is the same + * The extract(Char16Ptr dst) function detects whether the dst pointer is the same * as the string buffer itself and will in this case not copy the contents. * * @param buffer The characters to alias for the UnicodeString. * @param buffLength The number of Unicode characters in buffer to alias. - * @param buffCapacity The size of buffer in UChars. + * @param buffCapacity The size of buffer in char16_ts. * @stable ICU 2.0 */ - UnicodeString(UChar *buffer, int32_t buffLength, int32_t buffCapacity); + UnicodeString(char16_t *buffer, int32_t buffLength, int32_t buffCapacity); + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ +#if !U_CHAR16_IS_TYPEDEF + /** + * Writable-aliasing uint16_t * constructor. + * Delegates to UnicodeString(const char16_t *, int32_t, int32_t). + * @param buffer writable buffer of/for UTF-16 text + * @param buffLength length of the current buffer contents + * @param buffCapacity buffer capacity + * @draft ICU 59 + */ + UnicodeString(uint16_t *buffer, int32_t buffLength, int32_t buffCapacity) : + UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {} +#endif + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ +#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN) + /** + * Writable-aliasing wchar_t * constructor. + * (Only defined if U_SIZEOF_WCHAR_T==2.) + * Delegates to UnicodeString(const char16_t *, int32_t, int32_t). + * @param buffer writable buffer of/for UTF-16 text + * @param buffLength length of the current buffer contents + * @param buffCapacity buffer capacity + * @draft ICU 59 + */ + UnicodeString(wchar_t *buffer, int32_t buffLength, int32_t buffCapacity) : + UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {} +#endif + + /* + * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor, + * it should always be available regardless of U_HIDE_DRAFT_API status + */ + /** + * Writable-aliasing nullptr_t constructor. + * Effectively the same as the default constructor, makes an empty string object. + * @param buffer nullptr + * @param buffLength ignored + * @param buffCapacity ignored + * @draft ICU 59 + */ + inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity); #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION @@ -3213,7 +3349,6 @@ class U_COMMON_API UnicodeString : public Replaceable */ UnicodeString(const UnicodeString& that); -#if U_HAVE_RVALUE_REFERENCES /** * Move constructor, might leave src in bogus state. * This string will have the same contents and state that the source string had. @@ -3221,7 +3356,6 @@ class U_COMMON_API UnicodeString : public Replaceable * @stable ICU 56 */ UnicodeString(UnicodeString &&src) U_NOEXCEPT; -#endif /** * 'Substring' constructor from tail of source string. @@ -3380,7 +3514,7 @@ class U_COMMON_API UnicodeString : public Replaceable * UnicodeString::charAt() to be inline again (see jitterbug 709). * @stable ICU 2.4 */ - virtual UChar getCharAt(int32_t offset) const; + virtual char16_t getCharAt(int32_t offset) const; /** * The change in Replaceable to use virtual getChar32At() allows @@ -3416,7 +3550,7 @@ class U_COMMON_API UnicodeString : public Replaceable int8_t doCompare(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const; @@ -3429,7 +3563,7 @@ class U_COMMON_API UnicodeString : public Replaceable int8_t doCompareCodePointOrder(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const; @@ -3444,12 +3578,12 @@ class U_COMMON_API UnicodeString : public Replaceable int8_t doCaseCompare(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength, uint32_t options) const; - int32_t doIndexOf(UChar c, + int32_t doIndexOf(char16_t c, int32_t start, int32_t length) const; @@ -3457,7 +3591,7 @@ class U_COMMON_API UnicodeString : public Replaceable int32_t start, int32_t length) const; - int32_t doLastIndexOf(UChar c, + int32_t doLastIndexOf(char16_t c, int32_t start, int32_t length) const; @@ -3467,14 +3601,14 @@ class U_COMMON_API UnicodeString : public Replaceable void doExtract(int32_t start, int32_t length, - UChar *dst, + char16_t *dst, int32_t dstStart) const; inline void doExtract(int32_t start, int32_t length, UnicodeString& target) const; - inline UChar doCharAt(int32_t offset) const; + inline char16_t doCharAt(int32_t offset) const; UnicodeString& doReplace(int32_t start, int32_t length, @@ -3484,12 +3618,12 @@ class U_COMMON_API UnicodeString : public Replaceable UnicodeString& doReplace(int32_t start, int32_t length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength); UnicodeString& doAppend(const UnicodeString& src, int32_t srcStart, int32_t srcLength); - UnicodeString& doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength); + UnicodeString& doAppend(const char16_t *srcChars, int32_t srcStart, int32_t srcLength); UnicodeString& doReverse(int32_t start, int32_t length); @@ -3499,8 +3633,8 @@ class U_COMMON_API UnicodeString : public Replaceable // get pointer to start of array // these do not check for kOpenGetBuffer, unlike the public getBuffer() function - inline UChar* getArrayStart(void); - inline const UChar* getArrayStart(void) const; + inline char16_t* getArrayStart(void); + inline const char16_t* getArrayStart(void) const; inline UBool hasShortLength() const; inline int32_t getShortLength() const; @@ -3517,7 +3651,7 @@ class U_COMMON_API UnicodeString : public Replaceable inline void setShortLength(int32_t len); inline void setLength(int32_t len); inline void setToEmpty(); - inline void setArray(UChar *array, int32_t len, int32_t capacity); // sets length but not flags + inline void setArray(char16_t *array, int32_t len, int32_t capacity); // sets length but not flags // allocate the array; result may be the stack buffer // sets refCount to 1 if appropriate @@ -3600,7 +3734,11 @@ class U_COMMON_API UnicodeString : public Replaceable * as in ustr_imp.h for ustrcase_map(). */ UnicodeString & - caseMap(const UCaseMap *csm, UStringCaseMapper *stringCaseMapper); + caseMap(int32_t caseLocale, uint32_t options, +#if !UCONFIG_NO_BREAK_ITERATION + BreakIterator *iter, +#endif + UStringCaseMapper *stringCaseMapper); // ref counting void addRef(void); @@ -3691,15 +3829,15 @@ class U_COMMON_API UnicodeString : public Replaceable // Each struct of the union must begin with fLengthAndFlags. struct { int16_t fLengthAndFlags; // bit fields: see constants above - UChar fBuffer[US_STACKBUF_SIZE]; // buffer for short strings + char16_t fBuffer[US_STACKBUF_SIZE]; // buffer for short strings } fStackFields; struct { int16_t fLengthAndFlags; // bit fields: see constants above int32_t fLength; // number of characters in fArray if >127; else undefined - int32_t fCapacity; // capacity of fArray (in UChars) + int32_t fCapacity; // capacity of fArray (in char16_ts) // array pointer last to minimize padding for machines with P128 data model // or pointer sizes that are not a power of 2 - UChar *fArray; // the Unicode data + char16_t *fArray; // the Unicode data } fFields; } fUnion; }; @@ -3752,13 +3890,13 @@ UnicodeString::pinIndices(int32_t& start, } } -inline UChar* +inline char16_t* UnicodeString::getArrayStart() { return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ? fUnion.fStackFields.fBuffer : fUnion.fFields.fArray; } -inline const UChar* +inline const char16_t* UnicodeString::getArrayStart() const { return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ? fUnion.fStackFields.fBuffer : fUnion.fFields.fArray; @@ -3773,6 +3911,18 @@ UnicodeString::UnicodeString() { fUnion.fStackFields.fLengthAndFlags=kShortString; } +inline UnicodeString::UnicodeString(const std::nullptr_t /*text*/) { + fUnion.fStackFields.fLengthAndFlags=kShortString; +} + +inline UnicodeString::UnicodeString(const std::nullptr_t /*text*/, int32_t /*length*/) { + fUnion.fStackFields.fLengthAndFlags=kShortString; +} + +inline UnicodeString::UnicodeString(std::nullptr_t /*buffer*/, int32_t /*buffLength*/, int32_t /*buffCapacity*/) { + fUnion.fStackFields.fLengthAndFlags=kShortString; +} + //======================================== // Read-only implementation methods //======================================== @@ -3819,10 +3969,10 @@ UnicodeString::isBufferWritable() const (!(fUnion.fFields.fLengthAndFlags&kRefCounted) || refCount()==1)); } -inline const UChar * +inline const char16_t * UnicodeString::getBuffer() const { if(fUnion.fFields.fLengthAndFlags&(kIsBogus|kOpenGetBuffer)) { - return 0; + return nullptr; } else if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) { return fUnion.fStackFields.fBuffer; } else { @@ -3890,7 +4040,7 @@ UnicodeString::compare(int32_t start, { return doCompare(start, _length, srcText, 0, srcText.length()); } inline int8_t -UnicodeString::compare(const UChar *srcChars, +UnicodeString::compare(ConstChar16Ptr srcChars, int32_t srcLength) const { return doCompare(0, length(), srcChars, 0, srcLength); } @@ -3905,13 +4055,13 @@ UnicodeString::compare(int32_t start, inline int8_t UnicodeString::compare(int32_t start, int32_t _length, - const UChar *srcChars) const + const char16_t *srcChars) const { return doCompare(start, _length, srcChars, 0, _length); } inline int8_t UnicodeString::compare(int32_t start, int32_t _length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const { return doCompare(start, _length, srcChars, srcStart, srcLength); } @@ -3951,7 +4101,7 @@ UnicodeString::compareCodePointOrder(int32_t start, { return doCompareCodePointOrder(start, _length, srcText, 0, srcText.length()); } inline int8_t -UnicodeString::compareCodePointOrder(const UChar *srcChars, +UnicodeString::compareCodePointOrder(ConstChar16Ptr srcChars, int32_t srcLength) const { return doCompareCodePointOrder(0, length(), srcChars, 0, srcLength); } @@ -3966,13 +4116,13 @@ UnicodeString::compareCodePointOrder(int32_t start, inline int8_t UnicodeString::compareCodePointOrder(int32_t start, int32_t _length, - const UChar *srcChars) const + const char16_t *srcChars) const { return doCompareCodePointOrder(start, _length, srcChars, 0, _length); } inline int8_t UnicodeString::compareCodePointOrder(int32_t start, int32_t _length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const { return doCompareCodePointOrder(start, _length, srcChars, srcStart, srcLength); } @@ -4016,7 +4166,7 @@ UnicodeString::caseCompare(int32_t start, } inline int8_t -UnicodeString::caseCompare(const UChar *srcChars, +UnicodeString::caseCompare(ConstChar16Ptr srcChars, int32_t srcLength, uint32_t options) const { return doCaseCompare(0, length(), srcChars, 0, srcLength, options); @@ -4035,7 +4185,7 @@ UnicodeString::caseCompare(int32_t start, inline int8_t UnicodeString::caseCompare(int32_t start, int32_t _length, - const UChar *srcChars, + const char16_t *srcChars, uint32_t options) const { return doCaseCompare(start, _length, srcChars, 0, _length, options); } @@ -4043,7 +4193,7 @@ UnicodeString::caseCompare(int32_t start, inline int8_t UnicodeString::caseCompare(int32_t start, int32_t _length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength, uint32_t options) const { @@ -4094,7 +4244,7 @@ UnicodeString::indexOf(const UnicodeString& text, { return indexOf(text, 0, text.length(), start, _length); } inline int32_t -UnicodeString::indexOf(const UChar *srcChars, +UnicodeString::indexOf(const char16_t *srcChars, int32_t srcLength, int32_t start) const { pinIndex(start); @@ -4102,14 +4252,14 @@ UnicodeString::indexOf(const UChar *srcChars, } inline int32_t -UnicodeString::indexOf(const UChar *srcChars, +UnicodeString::indexOf(ConstChar16Ptr srcChars, int32_t srcLength, int32_t start, int32_t _length) const { return indexOf(srcChars, 0, srcLength, start, _length); } inline int32_t -UnicodeString::indexOf(UChar c, +UnicodeString::indexOf(char16_t c, int32_t start, int32_t _length) const { return doIndexOf(c, start, _length); } @@ -4121,7 +4271,7 @@ UnicodeString::indexOf(UChar32 c, { return doIndexOf(c, start, _length); } inline int32_t -UnicodeString::indexOf(UChar c) const +UnicodeString::indexOf(char16_t c) const { return doIndexOf(c, 0, length()); } inline int32_t @@ -4129,7 +4279,7 @@ UnicodeString::indexOf(UChar32 c) const { return indexOf(c, 0, length()); } inline int32_t -UnicodeString::indexOf(UChar c, +UnicodeString::indexOf(char16_t c, int32_t start) const { pinIndex(start); return doIndexOf(c, start, length() - start); @@ -4143,14 +4293,14 @@ UnicodeString::indexOf(UChar32 c, } inline int32_t -UnicodeString::lastIndexOf(const UChar *srcChars, +UnicodeString::lastIndexOf(ConstChar16Ptr srcChars, int32_t srcLength, int32_t start, int32_t _length) const { return lastIndexOf(srcChars, 0, srcLength, start, _length); } inline int32_t -UnicodeString::lastIndexOf(const UChar *srcChars, +UnicodeString::lastIndexOf(const char16_t *srcChars, int32_t srcLength, int32_t start) const { pinIndex(start); @@ -4191,7 +4341,7 @@ UnicodeString::lastIndexOf(const UnicodeString& text) const { return lastIndexOf(text, 0, text.length(), 0, length()); } inline int32_t -UnicodeString::lastIndexOf(UChar c, +UnicodeString::lastIndexOf(char16_t c, int32_t start, int32_t _length) const { return doLastIndexOf(c, start, _length); } @@ -4204,7 +4354,7 @@ UnicodeString::lastIndexOf(UChar32 c, } inline int32_t -UnicodeString::lastIndexOf(UChar c) const +UnicodeString::lastIndexOf(char16_t c) const { return doLastIndexOf(c, 0, length()); } inline int32_t @@ -4213,7 +4363,7 @@ UnicodeString::lastIndexOf(UChar32 c) const { } inline int32_t -UnicodeString::lastIndexOf(UChar c, +UnicodeString::lastIndexOf(char16_t c, int32_t start) const { pinIndex(start); return doLastIndexOf(c, start, length() - start); @@ -4237,17 +4387,17 @@ UnicodeString::startsWith(const UnicodeString& srcText, { return doCompare(0, srcLength, srcText, srcStart, srcLength) == 0; } inline UBool -UnicodeString::startsWith(const UChar *srcChars, int32_t srcLength) const { +UnicodeString::startsWith(ConstChar16Ptr srcChars, int32_t srcLength) const { if(srcLength < 0) { - srcLength = u_strlen(srcChars); + srcLength = u_strlen(toUCharPtr(srcChars)); } return doCompare(0, srcLength, srcChars, 0, srcLength) == 0; } inline UBool -UnicodeString::startsWith(const UChar *srcChars, int32_t srcStart, int32_t srcLength) const { +UnicodeString::startsWith(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const { if(srcLength < 0) { - srcLength = u_strlen(srcChars); + srcLength = u_strlen(toUCharPtr(srcChars)); } return doCompare(0, srcLength, srcChars, srcStart, srcLength) == 0; } @@ -4267,21 +4417,21 @@ UnicodeString::endsWith(const UnicodeString& srcText, } inline UBool -UnicodeString::endsWith(const UChar *srcChars, +UnicodeString::endsWith(ConstChar16Ptr srcChars, int32_t srcLength) const { if(srcLength < 0) { - srcLength = u_strlen(srcChars); + srcLength = u_strlen(toUCharPtr(srcChars)); } return doCompare(length() - srcLength, srcLength, srcChars, 0, srcLength) == 0; } inline UBool -UnicodeString::endsWith(const UChar *srcChars, +UnicodeString::endsWith(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const { if(srcLength < 0) { - srcLength = u_strlen(srcChars + srcStart); + srcLength = u_strlen(toUCharPtr(srcChars + srcStart)); } return doCompare(length() - srcLength, srcLength, srcChars, srcStart, srcLength) == 0; @@ -4307,14 +4457,14 @@ UnicodeString::replace(int32_t start, inline UnicodeString& UnicodeString::replace(int32_t start, int32_t _length, - const UChar *srcChars, + ConstChar16Ptr srcChars, int32_t srcLength) { return doReplace(start, _length, srcChars, 0, srcLength); } inline UnicodeString& UnicodeString::replace(int32_t start, int32_t _length, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) { return doReplace(start, _length, srcChars, srcStart, srcLength); } @@ -4322,7 +4472,7 @@ UnicodeString::replace(int32_t start, inline UnicodeString& UnicodeString::replace(int32_t start, int32_t _length, - UChar srcChar) + char16_t srcChar) { return doReplace(start, _length, &srcChar, 0, 1); } inline UnicodeString& @@ -4365,7 +4515,7 @@ UnicodeString::doExtract(int32_t start, inline void UnicodeString::extract(int32_t start, int32_t _length, - UChar *target, + Char16Ptr target, int32_t targetStart) const { doExtract(start, _length, target, targetStart); } @@ -4393,7 +4543,7 @@ UnicodeString::extract(int32_t start, inline void UnicodeString::extractBetween(int32_t start, int32_t limit, - UChar *dst, + char16_t *dst, int32_t dstStart) const { pinIndex(start); pinIndex(limit); @@ -4405,7 +4555,7 @@ UnicodeString::tempSubStringBetween(int32_t start, int32_t limit) const { return tempSubString(start, limit - start); } -inline UChar +inline char16_t UnicodeString::doCharAt(int32_t offset) const { if((uint32_t)offset < (uint32_t)length()) { @@ -4415,11 +4565,11 @@ UnicodeString::doCharAt(int32_t offset) const } } -inline UChar +inline char16_t UnicodeString::charAt(int32_t offset) const { return doCharAt(offset); } -inline UChar +inline char16_t UnicodeString::operator[] (int32_t offset) const { return doCharAt(offset); } @@ -4460,14 +4610,14 @@ UnicodeString::setToEmpty() { } inline void -UnicodeString::setArray(UChar *array, int32_t len, int32_t capacity) { +UnicodeString::setArray(char16_t *array, int32_t len, int32_t capacity) { setLength(len); fUnion.fFields.fArray = array; fUnion.fFields.fCapacity = capacity; } inline UnicodeString& -UnicodeString::operator= (UChar ch) +UnicodeString::operator= (char16_t ch) { return doReplace(0, length(), &ch, 0, 1); } inline UnicodeString& @@ -4499,7 +4649,7 @@ UnicodeString::setTo(const UnicodeString& srcText) } inline UnicodeString& -UnicodeString::setTo(const UChar *srcChars, +UnicodeString::setTo(const char16_t *srcChars, int32_t srcLength) { unBogus(); @@ -4507,7 +4657,7 @@ UnicodeString::setTo(const UChar *srcChars, } inline UnicodeString& -UnicodeString::setTo(UChar srcChar) +UnicodeString::setTo(char16_t srcChar) { unBogus(); return doReplace(0, length(), &srcChar, 0, 1); @@ -4531,22 +4681,22 @@ UnicodeString::append(const UnicodeString& srcText) { return doAppend(srcText, 0, srcText.length()); } inline UnicodeString& -UnicodeString::append(const UChar *srcChars, +UnicodeString::append(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) { return doAppend(srcChars, srcStart, srcLength); } inline UnicodeString& -UnicodeString::append(const UChar *srcChars, +UnicodeString::append(ConstChar16Ptr srcChars, int32_t srcLength) { return doAppend(srcChars, 0, srcLength); } inline UnicodeString& -UnicodeString::append(UChar srcChar) +UnicodeString::append(char16_t srcChar) { return doAppend(&srcChar, 0, 1); } inline UnicodeString& -UnicodeString::operator+= (UChar ch) +UnicodeString::operator+= (char16_t ch) { return doAppend(&ch, 0, 1); } inline UnicodeString& @@ -4572,20 +4722,20 @@ UnicodeString::insert(int32_t start, inline UnicodeString& UnicodeString::insert(int32_t start, - const UChar *srcChars, + const char16_t *srcChars, int32_t srcStart, int32_t srcLength) { return doReplace(start, 0, srcChars, srcStart, srcLength); } inline UnicodeString& UnicodeString::insert(int32_t start, - const UChar *srcChars, + ConstChar16Ptr srcChars, int32_t srcLength) { return doReplace(start, 0, srcChars, 0, srcLength); } inline UnicodeString& UnicodeString::insert(int32_t start, - UChar srcChar) + char16_t srcChar) { return doReplace(start, 0, &srcChar, 0, 1); } inline UnicodeString& diff --git a/deps/icu-small/source/common/unicode/unorm.h b/deps/icu-small/source/common/unicode/unorm.h index f527c263f0298a..3839de129573c1 100644 --- a/deps/icu-small/source/common/unicode/unorm.h +++ b/deps/icu-small/source/common/unicode/unorm.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -210,7 +210,7 @@ enum { * the output was truncated, and the error code is set to U_BUFFER_OVERFLOW_ERROR. * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 unorm_normalize(const UChar *source, int32_t sourceLength, UNormalizationMode mode, int32_t options, UChar *result, int32_t resultLength, @@ -236,7 +236,7 @@ unorm_normalize(const UChar *source, int32_t sourceLength, * @see unorm_isNormalized * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE UNormalizationCheckResult U_EXPORT2 +U_DEPRECATED UNormalizationCheckResult U_EXPORT2 unorm_quickCheck(const UChar *source, int32_t sourcelength, UNormalizationMode mode, UErrorCode *status); @@ -257,7 +257,7 @@ unorm_quickCheck(const UChar *source, int32_t sourcelength, * @see unorm_isNormalized * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE UNormalizationCheckResult U_EXPORT2 +U_DEPRECATED UNormalizationCheckResult U_EXPORT2 unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode); @@ -283,7 +283,7 @@ unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength, * @see unorm_quickCheck * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE UBool U_EXPORT2 +U_DEPRECATED UBool U_EXPORT2 unorm_isNormalized(const UChar *src, int32_t srcLength, UNormalizationMode mode, UErrorCode *pErrorCode); @@ -305,7 +305,7 @@ unorm_isNormalized(const UChar *src, int32_t srcLength, * @see unorm_isNormalized * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE UBool U_EXPORT2 +U_DEPRECATED UBool U_EXPORT2 unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode); @@ -383,7 +383,7 @@ unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength, * * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 unorm_next(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, @@ -416,7 +416,7 @@ unorm_next(UCharIterator *src, * * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 unorm_previous(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, @@ -460,7 +460,7 @@ unorm_previous(UCharIterator *src, * * @deprecated ICU 56 Use unorm2.h instead. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 unorm_concatenate(const UChar *left, int32_t leftLength, const UChar *right, int32_t rightLength, UChar *dest, int32_t destCapacity, diff --git a/deps/icu-small/source/common/unicode/unorm2.h b/deps/icu-small/source/common/unicode/unorm2.h index 56e99b2a22b413..a9bd02f256361f 100644 --- a/deps/icu-small/source/common/unicode/unorm2.h +++ b/deps/icu-small/source/common/unicode/unorm2.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unorm2.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -32,6 +32,7 @@ #include "unicode/utypes.h" #include "unicode/localpointer.h" +#include "unicode/stringoptions.h" #include "unicode/uset.h" /** @@ -526,30 +527,6 @@ unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c); U_STABLE UBool U_EXPORT2 unorm2_isInert(const UNormalizer2 *norm2, UChar32 c); -/** - * Option bit for unorm_compare: - * Both input strings are assumed to fulfill FCD conditions. - * @stable ICU 2.2 - */ -#define UNORM_INPUT_IS_FCD 0x20000 - -/** - * Option bit for unorm_compare: - * Perform case-insensitive comparison. - * @stable ICU 2.2 - */ -#define U_COMPARE_IGNORE_CASE 0x10000 - -#ifndef U_COMPARE_CODE_POINT_ORDER -/* see also unistr.h and ustring.h */ -/** - * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: - * Compare strings in code point order instead of code unit order. - * @stable ICU 2.2 - */ -#define U_COMPARE_CODE_POINT_ORDER 0x8000 -#endif - /** * Compares two strings for canonical equivalence. * Further options include case-insensitive comparison and diff --git a/deps/icu-small/source/common/unicode/uobject.h b/deps/icu-small/source/common/unicode/uobject.h index 96b1b8fbeadd19..080600e52650d5 100644 --- a/deps/icu-small/source/common/unicode/uobject.h +++ b/deps/icu-small/source/common/unicode/uobject.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: uobject.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/urename.h b/deps/icu-small/source/common/unicode/urename.h index b220a546975e47..982655c4425e0b 100644 --- a/deps/icu-small/source/common/unicode/urename.h +++ b/deps/icu-small/source/common/unicode/urename.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -7,7 +7,7 @@ ******************************************************************************* * * file name: urename.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -100,12 +100,17 @@ #define _UTF16BEData U_ICU_ENTRY_POINT_RENAME(_UTF16BEData) #define _UTF16Data U_ICU_ENTRY_POINT_RENAME(_UTF16Data) #define _UTF16LEData U_ICU_ENTRY_POINT_RENAME(_UTF16LEData) +#define _UTF16v2Data U_ICU_ENTRY_POINT_RENAME(_UTF16v2Data) #define _UTF32BEData U_ICU_ENTRY_POINT_RENAME(_UTF32BEData) #define _UTF32Data U_ICU_ENTRY_POINT_RENAME(_UTF32Data) #define _UTF32LEData U_ICU_ENTRY_POINT_RENAME(_UTF32LEData) #define _UTF7Data U_ICU_ENTRY_POINT_RENAME(_UTF7Data) #define _UTF8Data U_ICU_ENTRY_POINT_RENAME(_UTF8Data) +#define allowedHourFormatsCleanup U_ICU_ENTRY_POINT_RENAME(allowedHourFormatsCleanup) +#define checkImpl U_ICU_ENTRY_POINT_RENAME(checkImpl) #define cmemory_cleanup U_ICU_ENTRY_POINT_RENAME(cmemory_cleanup) +#define dayPeriodRulesCleanup U_ICU_ENTRY_POINT_RENAME(dayPeriodRulesCleanup) +#define deleteAllowedHourFormats U_ICU_ENTRY_POINT_RENAME(deleteAllowedHourFormats) #define gTimeZoneFilesInitOnce U_ICU_ENTRY_POINT_RENAME(gTimeZoneFilesInitOnce) #define izrule_clone U_ICU_ENTRY_POINT_RENAME(izrule_clone) #define izrule_close U_ICU_ENTRY_POINT_RENAME(izrule_close) @@ -121,16 +126,6 @@ #define izrule_getStaticClassID U_ICU_ENTRY_POINT_RENAME(izrule_getStaticClassID) #define izrule_isEquivalentTo U_ICU_ENTRY_POINT_RENAME(izrule_isEquivalentTo) #define izrule_open U_ICU_ENTRY_POINT_RENAME(izrule_open) -#define le_close U_ICU_ENTRY_POINT_RENAME(le_close) -#define le_create U_ICU_ENTRY_POINT_RENAME(le_create) -#define le_getCharIndices U_ICU_ENTRY_POINT_RENAME(le_getCharIndices) -#define le_getCharIndicesWithBase U_ICU_ENTRY_POINT_RENAME(le_getCharIndicesWithBase) -#define le_getGlyphCount U_ICU_ENTRY_POINT_RENAME(le_getGlyphCount) -#define le_getGlyphPosition U_ICU_ENTRY_POINT_RENAME(le_getGlyphPosition) -#define le_getGlyphPositions U_ICU_ENTRY_POINT_RENAME(le_getGlyphPositions) -#define le_getGlyphs U_ICU_ENTRY_POINT_RENAME(le_getGlyphs) -#define le_layoutChars U_ICU_ENTRY_POINT_RENAME(le_layoutChars) -#define le_reset U_ICU_ENTRY_POINT_RENAME(le_reset) #define locale_getKeywords U_ICU_ENTRY_POINT_RENAME(locale_getKeywords) #define locale_getKeywordsStart U_ICU_ENTRY_POINT_RENAME(locale_getKeywordsStart) #define locale_get_default U_ICU_ENTRY_POINT_RENAME(locale_get_default) @@ -486,6 +481,7 @@ #define ubrk_first U_ICU_ENTRY_POINT_RENAME(ubrk_first) #define ubrk_following U_ICU_ENTRY_POINT_RENAME(ubrk_following) #define ubrk_getAvailable U_ICU_ENTRY_POINT_RENAME(ubrk_getAvailable) +#define ubrk_getBinaryRules U_ICU_ENTRY_POINT_RENAME(ubrk_getBinaryRules) #define ubrk_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ubrk_getLocaleByType) #define ubrk_getRuleStatus U_ICU_ENTRY_POINT_RENAME(ubrk_getRuleStatus) #define ubrk_getRuleStatusVec U_ICU_ENTRY_POINT_RENAME(ubrk_getRuleStatusVec) @@ -493,6 +489,7 @@ #define ubrk_last U_ICU_ENTRY_POINT_RENAME(ubrk_last) #define ubrk_next U_ICU_ENTRY_POINT_RENAME(ubrk_next) #define ubrk_open U_ICU_ENTRY_POINT_RENAME(ubrk_open) +#define ubrk_openBinaryRules U_ICU_ENTRY_POINT_RENAME(ubrk_openBinaryRules) #define ubrk_openRules U_ICU_ENTRY_POINT_RENAME(ubrk_openRules) #define ubrk_preceding U_ICU_ENTRY_POINT_RENAME(ubrk_preceding) #define ubrk_previous U_ICU_ENTRY_POINT_RENAME(ubrk_previous) @@ -554,7 +551,6 @@ #define ucase_addStringCaseClosure U_ICU_ENTRY_POINT_RENAME(ucase_addStringCaseClosure) #define ucase_fold U_ICU_ENTRY_POINT_RENAME(ucase_fold) #define ucase_getCaseLocale U_ICU_ENTRY_POINT_RENAME(ucase_getCaseLocale) -#define ucase_getSingleton U_ICU_ENTRY_POINT_RENAME(ucase_getSingleton) #define ucase_getType U_ICU_ENTRY_POINT_RENAME(ucase_getType) #define ucase_getTypeOrIgnorable U_ICU_ENTRY_POINT_RENAME(ucase_getTypeOrIgnorable) #define ucase_hasBinaryProperty U_ICU_ENTRY_POINT_RENAME(ucase_hasBinaryProperty) @@ -949,6 +945,7 @@ #define uhash_iget U_ICU_ENTRY_POINT_RENAME(uhash_iget) #define uhash_igeti U_ICU_ENTRY_POINT_RENAME(uhash_igeti) #define uhash_init U_ICU_ENTRY_POINT_RENAME(uhash_init) +#define uhash_initSize U_ICU_ENTRY_POINT_RENAME(uhash_initSize) #define uhash_iput U_ICU_ENTRY_POINT_RENAME(uhash_iput) #define uhash_iputi U_ICU_ENTRY_POINT_RENAME(uhash_iputi) #define uhash_iremove U_ICU_ENTRY_POINT_RENAME(uhash_iremove) @@ -1150,6 +1147,7 @@ #define unum_formatDecimal U_ICU_ENTRY_POINT_RENAME(unum_formatDecimal) #define unum_formatDouble U_ICU_ENTRY_POINT_RENAME(unum_formatDouble) #define unum_formatDoubleCurrency U_ICU_ENTRY_POINT_RENAME(unum_formatDoubleCurrency) +#define unum_formatDoubleForFields U_ICU_ENTRY_POINT_RENAME(unum_formatDoubleForFields) #define unum_formatInt64 U_ICU_ENTRY_POINT_RENAME(unum_formatInt64) #define unum_formatUFormattable U_ICU_ENTRY_POINT_RENAME(unum_formatUFormattable) #define unum_getAttribute U_ICU_ENTRY_POINT_RENAME(unum_getAttribute) @@ -1181,9 +1179,11 @@ #define unumsys_openAvailableNames U_ICU_ENTRY_POINT_RENAME(unumsys_openAvailableNames) #define unumsys_openByName U_ICU_ENTRY_POINT_RENAME(unumsys_openByName) #define uplrules_close U_ICU_ENTRY_POINT_RENAME(uplrules_close) +#define uplrules_getKeywords U_ICU_ENTRY_POINT_RENAME(uplrules_getKeywords) #define uplrules_open U_ICU_ENTRY_POINT_RENAME(uplrules_open) #define uplrules_openForType U_ICU_ENTRY_POINT_RENAME(uplrules_openForType) #define uplrules_select U_ICU_ENTRY_POINT_RENAME(uplrules_select) +#define uplrules_selectWithFormat U_ICU_ENTRY_POINT_RENAME(uplrules_selectWithFormat) #define uplug_closeLibrary U_ICU_ENTRY_POINT_RENAME(uplug_closeLibrary) #define uplug_findLibrary U_ICU_ENTRY_POINT_RENAME(uplug_findLibrary) #define uplug_getConfiguration U_ICU_ENTRY_POINT_RENAME(uplug_getConfiguration) @@ -1220,6 +1220,7 @@ #define uprv_compareInvEbcdic U_ICU_ENTRY_POINT_RENAME(uprv_compareInvEbcdic) #define uprv_compareInvEbcdicAsAscii U_ICU_ENTRY_POINT_RENAME(uprv_compareInvEbcdicAsAscii) #define uprv_convertToLCID U_ICU_ENTRY_POINT_RENAME(uprv_convertToLCID) +#define uprv_convertToLCIDPlatform U_ICU_ENTRY_POINT_RENAME(uprv_convertToLCIDPlatform) #define uprv_convertToPosix U_ICU_ENTRY_POINT_RENAME(uprv_convertToPosix) #define uprv_copyAscii U_ICU_ENTRY_POINT_RENAME(uprv_copyAscii) #define uprv_copyEbcdic U_ICU_ENTRY_POINT_RENAME(uprv_copyEbcdic) @@ -1654,12 +1655,14 @@ #define ustr_hashCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashCharsN) #define ustr_hashICharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashICharsN) #define ustr_hashUCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashUCharsN) +#define ustrcase_getCaseLocale U_ICU_ENTRY_POINT_RENAME(ustrcase_getCaseLocale) +#define ustrcase_getTitleBreakIterator U_ICU_ENTRY_POINT_RENAME(ustrcase_getTitleBreakIterator) #define ustrcase_internalFold U_ICU_ENTRY_POINT_RENAME(ustrcase_internalFold) #define ustrcase_internalToLower U_ICU_ENTRY_POINT_RENAME(ustrcase_internalToLower) #define ustrcase_internalToTitle U_ICU_ENTRY_POINT_RENAME(ustrcase_internalToTitle) #define ustrcase_internalToUpper U_ICU_ENTRY_POINT_RENAME(ustrcase_internalToUpper) #define ustrcase_map U_ICU_ENTRY_POINT_RENAME(ustrcase_map) -#define ustrcase_setTempCaseMapLocale U_ICU_ENTRY_POINT_RENAME(ustrcase_setTempCaseMapLocale) +#define ustrcase_mapWithOverlap U_ICU_ENTRY_POINT_RENAME(ustrcase_mapWithOverlap) #define utext_char32At U_ICU_ENTRY_POINT_RENAME(utext_char32At) #define utext_clone U_ICU_ENTRY_POINT_RENAME(utext_clone) #define utext_close U_ICU_ENTRY_POINT_RENAME(utext_close) @@ -1704,7 +1707,6 @@ #define utrace_functionName U_ICU_ENTRY_POINT_RENAME(utrace_functionName) #define utrace_getFunctions U_ICU_ENTRY_POINT_RENAME(utrace_getFunctions) #define utrace_getLevel U_ICU_ENTRY_POINT_RENAME(utrace_getLevel) -#define utrace_level U_ICU_ENTRY_POINT_RENAME(utrace_level) #define utrace_setFunctions U_ICU_ENTRY_POINT_RENAME(utrace_setFunctions) #define utrace_setLevel U_ICU_ENTRY_POINT_RENAME(utrace_setLevel) #define utrace_vformat U_ICU_ENTRY_POINT_RENAME(utrace_vformat) diff --git a/deps/icu-small/source/common/unicode/urep.h b/deps/icu-small/source/common/unicode/urep.h index 128f465319e2be..c54ba7c4661414 100644 --- a/deps/icu-small/source/common/unicode/urep.h +++ b/deps/icu-small/source/common/unicode/urep.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unicode/ures.h b/deps/icu-small/source/common/unicode/ures.h index 620d9268aaceeb..918b9f208e2cd0 100644 --- a/deps/icu-small/source/common/unicode/ures.h +++ b/deps/icu-small/source/common/unicode/ures.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/uscript.h b/deps/icu-small/source/common/unicode/uscript.h index a20cd157a45507..3ec235d50ce2c2 100644 --- a/deps/icu-small/source/common/unicode/uscript.h +++ b/deps/icu-small/source/common/unicode/uscript.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -444,6 +444,13 @@ typedef enum UScriptCode { /** @stable ICU 58 */ USCRIPT_SYMBOLS_EMOJI = 174,/* Zsye */ + /** @stable ICU 60 */ + USCRIPT_MASARAM_GONDI = 175,/* Gonm */ + /** @stable ICU 60 */ + USCRIPT_SOYOMBO = 176,/* Soyo */ + /** @stable ICU 60 */ + USCRIPT_ZANABAZAR_SQUARE = 177,/* Zanb */ + #ifndef U_HIDE_DEPRECATED_API /** * One more than the highest normal UScriptCode value. @@ -451,7 +458,7 @@ typedef enum UScriptCode { * * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ - USCRIPT_CODE_LIMIT = 175 + USCRIPT_CODE_LIMIT = 178 #endif // U_HIDE_DEPRECATED_API } UScriptCode; diff --git a/deps/icu-small/source/common/unicode/uset.h b/deps/icu-small/source/common/unicode/uset.h index b4ed176eb951a6..5b7c5db9ec03e5 100644 --- a/deps/icu-small/source/common/unicode/uset.h +++ b/deps/icu-small/source/common/unicode/uset.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uset.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/usetiter.h b/deps/icu-small/source/common/unicode/usetiter.h index d70e897b223335..057adbc04f5f05 100644 --- a/deps/icu-small/source/common/unicode/usetiter.h +++ b/deps/icu-small/source/common/unicode/usetiter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unicode/ushape.h b/deps/icu-small/source/common/unicode/ushape.h index 97fe9e3880b843..5af8ffe1c58c31 100644 --- a/deps/icu-small/source/common/unicode/ushape.h +++ b/deps/icu-small/source/common/unicode/ushape.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ushape.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/usprep.h b/deps/icu-small/source/common/unicode/usprep.h index fce161759d9f9b..33ca1461ce0813 100644 --- a/deps/icu-small/source/common/unicode/usprep.h +++ b/deps/icu-small/source/common/unicode/usprep.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: usprep.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/ustring.h b/deps/icu-small/source/common/unicode/ustring.h index 8f4809c8159ca9..1ea27126cc4de9 100644 --- a/deps/icu-small/source/common/unicode/ustring.h +++ b/deps/icu-small/source/common/unicode/ustring.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -497,16 +497,6 @@ u_strCompare(const UChar *s1, int32_t length1, U_STABLE int32_t U_EXPORT2 u_strCompareIter(UCharIterator *iter1, UCharIterator *iter2, UBool codePointOrder); -#ifndef U_COMPARE_CODE_POINT_ORDER -/* see also unistr.h and unorm.h */ -/** - * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: - * Compare strings in code point order instead of code unit order. - * @stable ICU 2.2 - */ -#define U_COMPARE_CODE_POINT_ORDER 0x8000 -#endif - /** * Compare two strings case-insensitively using full case folding. * This is equivalent to diff --git a/deps/icu-small/source/common/unicode/ustringtrie.h b/deps/icu-small/source/common/unicode/ustringtrie.h index 50d31ba226c308..fd85648225408c 100644 --- a/deps/icu-small/source/common/unicode/ustringtrie.h +++ b/deps/icu-small/source/common/unicode/ustringtrie.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: udicttrie.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/utext.h b/deps/icu-small/source/common/unicode/utext.h index 84ff22ad630f38..7eea1da240c1d5 100644 --- a/deps/icu-small/source/common/unicode/utext.h +++ b/deps/icu-small/source/common/unicode/utext.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utext.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -389,7 +389,7 @@ utext_equals(const UText *a, const UText *b); /***************************************************************************** * - * Functions to work with the text represeted by a UText wrapper + * Functions to work with the text represented by a UText wrapper * *****************************************************************************/ @@ -433,7 +433,7 @@ utext_isLengthExpensive(const UText *ut); * * The iteration position will be set to the start of the returned code point. * - * This function is roughly equivalent to the the sequence + * This function is roughly equivalent to the sequence * utext_setNativeIndex(index); * utext_current32(); * (There is a subtle difference if the index is out of bounds by being less than zero - @@ -592,7 +592,7 @@ U_STABLE void U_EXPORT2 utext_setNativeIndex(UText *ut, int64_t nativeIndex); /** - * Move the iterator postion by delta code points. The number of code points + * Move the iterator position by delta code points. The number of code points * is a signed number; a negative delta will move the iterator backwards, * towards the start of the text. *

@@ -611,7 +611,7 @@ U_STABLE UBool U_EXPORT2 utext_moveIndex32(UText *ut, int32_t delta); /** - * Get the native index of the character preceeding the current position. + * Get the native index of the character preceding the current position. * If the iteration position is already at the start of the text, zero * is returned. * The value returned is the same as that obtained from the following sequence, @@ -628,7 +628,7 @@ utext_moveIndex32(UText *ut, int32_t delta); * native index of the character most recently returned from utext_next(). * * @param ut the text to be accessed - * @return the native index of the character preceeding the current index position, + * @return the native index of the character preceding the current index position, * or zero if the current position is at the start of the text. * @stable ICU 3.6 */ @@ -768,7 +768,7 @@ utext_extract(UText *ut, */ #define UTEXT_SETNATIVEINDEX(ut, ix) \ { int64_t __offset = (ix) - (ut)->chunkNativeStart; \ - if (__offset>=0 && __offset<=(int64_t)(ut)->nativeIndexingLimit) { \ + if (__offset>=0 && __offset<(int64_t)(ut)->nativeIndexingLimit && (ut)->chunkContents[__offset]<0xdc00) { \ (ut)->chunkOffset=(int32_t)__offset; \ } else { \ utext_setNativeIndex((ut), (ix)); } } @@ -1054,7 +1054,7 @@ UTextAccess(UText *ut, int64_t nativeIndex, UBool forward); * be NUL-terminated if there is sufficient space in the destination buffer. * * @param ut the UText from which to extract data. - * @param nativeStart the native index of the first characer to extract. + * @param nativeStart the native index of the first character to extract. * @param nativeLimit the native string index of the position following the last * character to extract. * @param dest the UChar (UTF-16) buffer into which the extracted text is placed @@ -1211,7 +1211,7 @@ UTextClose(UText *ut); struct UTextFuncs { /** * (public) Function table size, sizeof(UTextFuncs) - * Intended for use should the table grow to accomodate added + * Intended for use should the table grow to accommodate added * functions in the future, to allow tests for older format * function tables that do not contain the extensions. * @@ -1345,7 +1345,7 @@ typedef struct UTextFuncs UTextFuncs; struct UText { /** * (private) Magic. Used to help detect when UText functions are handed - * invalid or unitialized UText structs. + * invalid or uninitialized UText structs. * utext_openXYZ() functions take an initialized, * but not necessarily open, UText struct as an * optional fill-in parameter. This magic field @@ -1367,7 +1367,7 @@ struct UText { /** - * Text provider properties. This set of flags is maintainted by the + * Text provider properties. This set of flags is maintained by the * text provider implementation. * @stable ICU 3.4 */ diff --git a/deps/icu-small/source/common/unicode/utf.h b/deps/icu-small/source/common/unicode/utf.h index 7f40190eb81ac7..aa5698069154cc 100644 --- a/deps/icu-small/source/common/unicode/utf.h +++ b/deps/icu-small/source/common/unicode/utf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utf.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -23,9 +23,6 @@ * This file defines macros for checking whether a code point is * a surrogate or a non-character etc. * - * The UChar and UChar32 data types for Unicode code units and code points - * are defined in umachine.h because they can be machine-dependent. - * * If U_NO_DEFAULT_INCLUDE_UTF_HEADERS is 0 then utf.h is included by utypes.h * and itself includes utf8.h and utf16.h after some * common definitions. @@ -50,11 +47,11 @@ * but are optimized for the much more frequently occurring BMP code points. * * umachine.h defines UChar to be an unsigned 16-bit integer. - * Where available, UChar is defined to be a char16_t - * or a wchar_t (if that is an unsigned 16-bit type), otherwise uint16_t. + * Since ICU 59, ICU uses char16_t in C++, UChar only in C, + * and defines UChar=char16_t by default. See the UChar API docs for details. * * UChar32 is defined to be a signed 32-bit integer (int32_t), large enough for a 21-bit - * Unicode code point (Unicode scalar value, 0..0x10ffff). + * Unicode code point (Unicode scalar value, 0..0x10ffff) and U_SENTINEL (-1). * Before ICU 2.4, the definition of UChar32 was similarly platform-dependent as * the definition of UChar. For details see the documentation for UChar32 itself. * @@ -63,11 +60,20 @@ * For actual Unicode character properties see uchar.h. * * By default, string operations must be done with error checking in case - * a string is not well-formed UTF-16. - * The macros will detect if a surrogate code unit is unpaired + * a string is not well-formed UTF-16 or UTF-8. + * + * The U16_ macros detect if a surrogate code unit is unpaired * (lead unit without trail unit or vice versa) and just return the unit itself * as the code point. * + * The U8_ macros detect illegal byte sequences and return a negative value. + * Starting with ICU 60, the observable length of a single illegal byte sequence + * skipped by one of these macros follows the Unicode 6+ recommendation + * which is consistent with the W3C Encoding Standard. + * + * There are ..._OR_FFFD versions of both U16_ and U8_ macros + * that return U+FFFD for illegal code unit sequences. + * * The regular "safe" macros require that the initial, passed-in string index * is within bounds. They only check the index when they read more than one * code unit. This is usually done with code similar to the following loop: @@ -91,10 +97,7 @@ * The performance differences are much larger here because UTF-8 provides so * many opportunities for malformed sequences. * The unsafe UTF-8 macros are entirely implemented inside the macro definitions - * and are fast, while the safe UTF-8 macros call functions for all but the - * trivial (ASCII) cases. - * (ICU 3.6 optimizes U8_NEXT() and U8_APPEND() to handle most other common - * characters inline as well.) + * and are fast, while the safe UTF-8 macros call functions for some complicated cases. * * Unlike with UTF-16, malformed sequences cannot be expressed with distinct * code point values (0..U+10ffff). They are indicated with negative values instead. @@ -126,8 +129,7 @@ */ #define U_IS_UNICODE_NONCHAR(c) \ ((c)>=0xfdd0 && \ - ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \ - (uint32_t)(c)<=0x10ffff) + ((c)<=0xfdef || ((c)&0xfffe)==0xfffe) && (c)<=0x10ffff) /** * Is c a Unicode code point value (0..U+10ffff) @@ -148,9 +150,7 @@ */ #define U_IS_UNICODE_CHAR(c) \ ((uint32_t)(c)<0xd800 || \ - ((uint32_t)(c)>0xdfff && \ - (uint32_t)(c)<=0x10ffff && \ - !U_IS_UNICODE_NONCHAR(c))) + (0xdfff<(c) && (c)<=0x10ffff && !U_IS_UNICODE_NONCHAR(c))) /** * Is this code point a BMP code point (U+0000..U+ffff)? diff --git a/deps/icu-small/source/common/unicode/utf16.h b/deps/icu-small/source/common/unicode/utf16.h index 3455a40e56cceb..b9b9c59d3cb21f 100644 --- a/deps/icu-small/source/common/unicode/utf16.h +++ b/deps/icu-small/source/common/unicode/utf16.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utf16.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -185,8 +185,8 @@ * * The length can be negative for a NUL-terminated string. * - * If the offset points to a single, unpaired surrogate, then that itself - * will be returned as the code point. + * If the offset points to a single, unpaired surrogate, then + * c is set to that unpaired surrogate. * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT. * * @param s const UChar * string @@ -213,6 +213,53 @@ } \ } +#ifndef U_HIDE_DRAFT_API + +/** + * Get a code point from a string at a random-access offset, + * without changing the offset. + * "Safe" macro, handles unpaired surrogates and checks for string boundaries. + * + * The offset may point to either the lead or trail surrogate unit + * for a supplementary code point, in which case the macro will read + * the adjacent matching surrogate as well. + * + * The length can be negative for a NUL-terminated string. + * + * If the offset points to a single, unpaired surrogate, then + * c is set to U+FFFD. + * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT_OR_FFFD. + * + * @param s const UChar * string + * @param start starting string offset (usually 0) + * @param i string offset, must be start<=i(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ + (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ + } else { \ + (c)=0xfffd; \ + } \ + } \ + } \ +} + +#endif // U_HIDE_DRAFT_API + /* definitions with forward iteration --------------------------------------- */ /** @@ -253,8 +300,7 @@ * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate or - * to a single, unpaired lead surrogate, then that itself - * will be returned as the code point. + * to a single, unpaired lead surrogate, then c is set to that unpaired surrogate. * * @param s const UChar * string * @param i string offset, must be i(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ + --(i); \ + (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ + } else { \ + (c)=0xfffd; \ + } \ + } \ +} + +#endif // U_HIDE_DRAFT_API + /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) diff --git a/deps/icu-small/source/common/unicode/utf32.h b/deps/icu-small/source/common/unicode/utf32.h index f93727c109442a..8822c4dd0962c8 100644 --- a/deps/icu-small/source/common/unicode/utf32.h +++ b/deps/icu-small/source/common/unicode/utf32.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utf32.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/utf8.h b/deps/icu-small/source/common/unicode/utf8.h index 095e955ecd3c7e..59b4b2557021f0 100644 --- a/deps/icu-small/source/common/unicode/utf8.h +++ b/deps/icu-small/source/common/unicode/utf8.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utf8.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -41,52 +41,24 @@ /* internal definitions ----------------------------------------------------- */ -/** - * \var utf8_countTrailBytes - * Internal array with numbers of trail bytes for any given byte used in - * lead byte position. - * - * This is internal since it is not meant to be called directly by external clients; - * however it is called by public macros in this file and thus must remain stable, - * and should not be hidden when other internal functions are hidden (otherwise - * public macros would fail to compile). - * @internal - */ -#ifdef U_UTF8_IMPL -U_EXPORT const uint8_t -#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) -U_CFUNC const uint8_t -#else -U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/ -#endif -utf8_countTrailBytes[256]; - /** * Counts the trail bytes for a UTF-8 lead byte. - * Returns 0 for 0..0xbf as well as for 0xfe and 0xff. + * Returns 0 for 0..0xc1 as well as for 0xf5..0xff. + * leadByte might be evaluated multiple times. * * This is internal since it is not meant to be called directly by external clients; * however it is called by public macros in this file and thus must remain stable. * - * Note: Beginning with ICU 50, the implementation uses a multi-condition expression - * which was shown in 2012 (on x86-64) to compile to fast, branch-free code. - * leadByte is evaluated multiple times. - * - * The pre-ICU 50 implementation used the exported array utf8_countTrailBytes: - * #define U8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[leadByte]) - * leadByte was evaluated exactly once. - * * @param leadByte The first byte of a UTF-8 sequence. Must be 0..0xff. * @internal */ #define U8_COUNT_TRAIL_BYTES(leadByte) \ - ((uint8_t)(leadByte)<0xf0 ? \ - ((uint8_t)(leadByte)>=0xc0)+((uint8_t)(leadByte)>=0xe0) : \ - (uint8_t)(leadByte)<0xfe ? 3+((uint8_t)(leadByte)>=0xf8)+((uint8_t)(leadByte)>=0xfc) : 0) + (U8_IS_LEAD(leadByte) ? \ + ((uint8_t)(leadByte)>=0xe0)+((uint8_t)(leadByte)>=0xf0)+1 : 0) /** * Counts the trail bytes for a UTF-8 lead byte of a valid UTF-8 sequence. - * The maximum supported lead byte is 0xf4 corresponding to U+10FFFF. + * Returns 0 for 0..0xc1. Undefined for 0xf5..0xff. * leadByte might be evaluated multiple times. * * This is internal since it is not meant to be called directly by external clients; @@ -96,7 +68,7 @@ utf8_countTrailBytes[256]; * @internal */ #define U8_COUNT_TRAIL_BYTES_UNSAFE(leadByte) \ - (((leadByte)>=0xc0)+((leadByte)>=0xe0)+((leadByte)>=0xf0)) + (((uint8_t)(leadByte)>=0xc2)+((uint8_t)(leadByte)>=0xe0)+((uint8_t)(leadByte)>=0xf0)) /** * Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value. @@ -107,6 +79,40 @@ utf8_countTrailBytes[256]; */ #define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1) +/** + * Internal bit vector for 3-byte UTF-8 validity check, for use in U8_IS_VALID_LEAD3_AND_T1. + * Each bit indicates whether one lead byte + first trail byte pair starts a valid sequence. + * Lead byte E0..EF bits 3..0 are used as byte index, + * first trail byte bits 7..5 are used as bit index into that byte. + * @see U8_IS_VALID_LEAD3_AND_T1 + * @internal + */ +#define U8_LEAD3_T1_BITS "\x20\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x10\x30\x30" + +/** + * Internal 3-byte UTF-8 validity check. + * Non-zero if lead byte E0..EF and first trail byte 00..FF start a valid sequence. + * @internal + */ +#define U8_IS_VALID_LEAD3_AND_T1(lead, t1) (U8_LEAD3_T1_BITS[(lead)&0xf]&(1<<((uint8_t)(t1)>>5))) + +/** + * Internal bit vector for 4-byte UTF-8 validity check, for use in U8_IS_VALID_LEAD4_AND_T1. + * Each bit indicates whether one lead byte + first trail byte pair starts a valid sequence. + * First trail byte bits 7..4 are used as byte index, + * lead byte F0..F4 bits 2..0 are used as bit index into that byte. + * @see U8_IS_VALID_LEAD4_AND_T1 + * @internal + */ +#define U8_LEAD4_T1_BITS "\x00\x00\x00\x00\x00\x00\x00\x00\x1E\x0F\x0F\x0F\x00\x00\x00\x00" + +/** + * Internal 4-byte UTF-8 validity check. + * Non-zero if lead byte F0..F4 and first trail byte 00..FF start a valid sequence. + * @internal + */ +#define U8_IS_VALID_LEAD4_AND_T1(lead, t1) (U8_LEAD4_T1_BITS[(uint8_t)(t1)>>4]&(1<<((lead)&7))) + /** * Function for handling "next code point" with error-checking. * @@ -166,20 +172,21 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); #define U8_IS_SINGLE(c) (((c)&0x80)==0) /** - * Is this code unit (byte) a UTF-8 lead byte? + * Is this code unit (byte) a UTF-8 lead byte? (0xC2..0xF4) * @param c 8-bit code unit (byte) * @return TRUE or FALSE * @stable ICU 2.4 */ -#define U8_IS_LEAD(c) ((uint8_t)((c)-0xc0)<0x3e) +#define U8_IS_LEAD(c) ((uint8_t)((c)-0xc2)<=0x32) +// 0x32=0xf4-0xc2 /** - * Is this code unit (byte) a UTF-8 trail byte? + * Is this code unit (byte) a UTF-8 trail byte? (0x80..0xBF) * @param c 8-bit code unit (byte) * @return TRUE or FALSE * @stable ICU 2.4 */ -#define U8_IS_TRAIL(c) (((c)&0xc0)==0x80) +#define U8_IS_TRAIL(c) ((int8_t)(c)<-0x40) /** * How many code units (bytes) are used for the UTF-8 encoding @@ -307,7 +314,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); */ #define U8_NEXT_UNSAFE(s, i, c) { \ (c)=(uint8_t)(s)[(i)++]; \ - if((c)>=0x80) { \ + if(!U8_IS_SINGLE(c)) { \ if((c)<0xe0) { \ (c)=(((c)&0x1f)<<6)|((s)[(i)++]&0x3f); \ } else if((c)<0xf0) { \ @@ -343,22 +350,19 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); */ #define U8_NEXT(s, i, length, c) { \ (c)=(uint8_t)(s)[(i)++]; \ - if((c)>=0x80) { \ + if(!U8_IS_SINGLE(c)) { \ uint8_t __t1, __t2; \ - if( /* handle U+1000..U+CFFF inline */ \ - (0xe0<(c) && (c)<=0xec) && \ - (((i)+1)<(length) || (length)<0) && \ - (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \ - (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \ - ) { \ - /* no need for (c&0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */ \ - (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \ + if( /* handle U+0800..U+FFFF inline */ \ + (0xe0<=(c) && (c)<0xf0) && \ + (((i)+1)<(length) || (length)<0) && \ + U8_IS_VALID_LEAD3_AND_T1((c), __t1=(s)[i]) && \ + (__t2=(s)[(i)+1]-0x80)<=0x3f) { \ + (c)=(((c)&0xf)<<12)|((__t1&0x3f)<<6)|__t2; \ (i)+=2; \ } else if( /* handle U+0080..U+07FF inline */ \ - ((c)<0xe0 && (c)>=0xc2) && \ - ((i)!=(length)) && \ - (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \ - ) { \ + ((c)<0xe0 && (c)>=0xc2) && \ + ((i)!=(length)) && \ + (__t1=(s)[i]-0x80)<=0x3f) { \ (c)=(((c)&0x1f)<<6)|__t1; \ ++(i); \ } else { \ @@ -394,22 +398,19 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); */ #define U8_NEXT_OR_FFFD(s, i, length, c) { \ (c)=(uint8_t)(s)[(i)++]; \ - if((c)>=0x80) { \ + if(!U8_IS_SINGLE(c)) { \ uint8_t __t1, __t2; \ - if( /* handle U+1000..U+CFFF inline */ \ - (0xe0<(c) && (c)<=0xec) && \ - (((i)+1)<(length) || (length)<0) && \ - (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \ - (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \ - ) { \ - /* no need for (c&0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */ \ - (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \ + if( /* handle U+0800..U+FFFF inline */ \ + (0xe0<=(c) && (c)<0xf0) && \ + (((i)+1)<(length) || (length)<0) && \ + U8_IS_VALID_LEAD3_AND_T1((c), __t1=(s)[i]) && \ + (__t2=(s)[(i)+1]-0x80)<=0x3f) { \ + (c)=(((c)&0xf)<<12)|((__t1&0x3f)<<6)|__t2; \ (i)+=2; \ } else if( /* handle U+0080..U+07FF inline */ \ - ((c)<0xe0 && (c)>=0xc2) && \ - ((i)!=(length)) && \ - (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \ - ) { \ + ((c)<0xe0 && (c)>=0xc2) && \ + ((i)!=(length)) && \ + (__t1=(s)[i]-0x80)<=0x3f) { \ (c)=(((c)&0x1f)<<6)|__t1; \ ++(i); \ } else { \ @@ -494,7 +495,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); * @stable ICU 2.4 */ #define U8_FWD_1_UNSAFE(s, i) { \ - (i)+=1+U8_COUNT_TRAIL_BYTES_UNSAFE((uint8_t)(s)[i]); \ + (i)+=1+U8_COUNT_TRAIL_BYTES_UNSAFE((s)[i]); \ } /** @@ -511,15 +512,24 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); * @stable ICU 2.4 */ #define U8_FWD_1(s, i, length) { \ - uint8_t __b=(uint8_t)(s)[(i)++]; \ - if(U8_IS_LEAD(__b)) { \ - uint8_t __count=U8_COUNT_TRAIL_BYTES(__b); \ - if((i)+__count>(length) && (length)>=0) { \ - __count=(uint8_t)((length)-(i)); \ - } \ - while(__count>0 && U8_IS_TRAIL((s)[i])) { \ - ++(i); \ - --__count; \ + uint8_t __b=(s)[(i)++]; \ + if(U8_IS_LEAD(__b) && (i)!=(length)) { \ + uint8_t __t1=(s)[i]; \ + if((0xe0<=__b && __b<0xf0)) { \ + if(U8_IS_VALID_LEAD3_AND_T1(__b, __t1) && \ + ++(i)!=(length) && U8_IS_TRAIL((s)[i])) { \ + ++(i); \ + } \ + } else if(__b<0xe0) { \ + if(U8_IS_TRAIL(__t1)) { \ + ++(i); \ + } \ + } else /* c>=0xf0 */ { \ + if(U8_IS_VALID_LEAD4_AND_T1(__b, __t1) && \ + ++(i)!=(length) && U8_IS_TRAIL((s)[i]) && \ + ++(i)!=(length) && U8_IS_TRAIL((s)[i])) { \ + ++(i); \ + } \ } \ } \ } @@ -633,7 +643,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); /* c is a trail byte */ \ (c)&=0x3f; \ for(;;) { \ - __b=(uint8_t)(s)[--(i)]; \ + __b=(s)[--(i)]; \ if(__b>=0xc0) { \ U8_MASK_LEAD_BYTE(__b, __count); \ (c)|=(UChar32)__b<<__shift; \ @@ -669,7 +679,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); */ #define U8_PREV(s, start, i, c) { \ (c)=(uint8_t)(s)[--(i)]; \ - if((c)>=0x80) { \ + if(!U8_IS_SINGLE(c)) { \ (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -1); \ } \ } @@ -700,7 +710,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); */ #define U8_PREV_OR_FFFD(s, start, i, c) { \ (c)=(uint8_t)(s)[--(i)]; \ - if((c)>=0x80) { \ + if(!U8_IS_SINGLE(c)) { \ (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -3); \ } \ } diff --git a/deps/icu-small/source/common/unicode/utf_old.h b/deps/icu-small/source/common/unicode/utf_old.h index b550b28ae3ad98..55c17c01df6db3 100644 --- a/deps/icu-small/source/common/unicode/utf_old.h +++ b/deps/icu-small/source/common/unicode/utf_old.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utf_old.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -145,7 +145,22 @@ #ifndef __UTF_OLD_H__ #define __UTF_OLD_H__ -#ifndef U_HIDE_DEPRECATED_API +/** + * \def U_HIDE_OBSOLETE_UTF_OLD_H + * + * Hides the obsolete definitions in unicode/utf_old.h. + * Recommended to be set to 1 at compile time to make sure + * the long-deprecated macros are no longer used. + * + * For reasons for the deprecation see the utf_old.h file comments. + * + * @internal + */ +#ifndef U_HIDE_OBSOLETE_UTF_OLD_H +# define U_HIDE_OBSOLETE_UTF_OLD_H 0 +#endif + +#if !defined(U_HIDE_DEPRECATED_API) && !U_HIDE_OBSOLETE_UTF_OLD_H #include "unicode/utf.h" #include "unicode/utf8.h" @@ -267,6 +282,25 @@ typedef int32_t UTextOffset; /* Formerly utf8.h ---------------------------------------------------------- */ +/** +* \var utf8_countTrailBytes +* Internal array with numbers of trail bytes for any given byte used in +* lead byte position. +* +* This is internal since it is not meant to be called directly by external clients; +* however it is called by public macros in this file and thus must remain stable, +* and should not be hidden when other internal functions are hidden (otherwise +* public macros would fail to compile). +* @internal +*/ +#ifdef U_UTF8_IMPL +// No forward declaration if compiling utf_impl.cpp, which defines utf8_countTrailBytes. +#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) +U_CFUNC const uint8_t utf8_countTrailBytes[]; +#else +U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[]; /* U_IMPORT2? */ /*U_IMPORT*/ +#endif + /** * Count the trail bytes for a UTF-8 lead byte. * @deprecated ICU 2.4. Renamed to U8_COUNT_TRAIL_BYTES, see utf_old.h. @@ -1165,6 +1199,6 @@ typedef int32_t UTextOffset; */ #define UTF_SET_CHAR_LIMIT(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length) -#endif /* U_HIDE_DEPRECATED_API */ +#endif // !U_HIDE_DEPRECATED_API && !U_HIDE_OBSOLETE_UTF_OLD_H #endif diff --git a/deps/icu-small/source/common/unicode/utrace.h b/deps/icu-small/source/common/unicode/utrace.h index 9add16f1ccb078..5d561109c7f8fd 100644 --- a/deps/icu-small/source/common/unicode/utrace.h +++ b/deps/icu-small/source/common/unicode/utrace.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utrace.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unicode/utypes.h b/deps/icu-small/source/common/unicode/utypes.h index 8325d534ed1167..4c40e6a87c7653 100644 --- a/deps/icu-small/source/common/unicode/utypes.h +++ b/deps/icu-small/source/common/unicode/utypes.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -178,12 +178,12 @@ /** * \def NULL - * Define NULL if necessary, to 0 for C++ and to ((void *)0) for C. + * Define NULL if necessary, to nullptr for C++ and to ((void *)0) for C. * @stable ICU 2.0 */ #ifndef NULL #ifdef __cplusplus -#define NULL 0 +#define NULL nullptr #else #define NULL ((void *)0) #endif diff --git a/deps/icu-small/source/common/unicode/uvernum.h b/deps/icu-small/source/common/unicode/uvernum.h index 5590f9a5cc3edc..d905a0f50d1d29 100644 --- a/deps/icu-small/source/common/unicode/uvernum.h +++ b/deps/icu-small/source/common/unicode/uvernum.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -7,7 +7,7 @@ ******************************************************************************* * * file name: uvernum.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -58,7 +58,7 @@ * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ -#define U_ICU_VERSION_MAJOR_NUM 58 +#define U_ICU_VERSION_MAJOR_NUM 60 /** The current ICU minor version as an integer. * This value will change in the subsequent releases of ICU @@ -84,7 +84,7 @@ * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ -#define U_ICU_VERSION_SUFFIX _58 +#define U_ICU_VERSION_SUFFIX _60 /** * \def U_DEF2_ICU_ENTRY_POINT_RENAME @@ -119,19 +119,19 @@ * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ -#define U_ICU_VERSION "58.2" +#define U_ICU_VERSION "60.2" /** The current ICU library major/minor version as a string without dots, for library name suffixes. * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ -#define U_ICU_VERSION_SHORT "58" +#define U_ICU_VERSION_SHORT "60" #ifndef U_HIDE_INTERNAL_API /** Data version in ICU4C. * @internal ICU 4.4 Internal Use Only **/ -#define U_ICU_DATA_VERSION "58.2" +#define U_ICU_DATA_VERSION "60.2" #endif /* U_HIDE_INTERNAL_API */ /*=========================================================================== diff --git a/deps/icu-small/source/common/unicode/uversion.h b/deps/icu-small/source/common/unicode/uversion.h index 63e2d17a363d94..cda24b6e0fc5ba 100644 --- a/deps/icu-small/source/common/unicode/uversion.h +++ b/deps/icu-small/source/common/unicode/uversion.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -7,7 +7,7 @@ ******************************************************************************* * * file name: uversion.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unifiedcache.cpp b/deps/icu-small/source/common/unifiedcache.cpp index 3e8e33a1ff2806..fd0be593d786f2 100644 --- a/deps/icu-small/source/common/unifiedcache.cpp +++ b/deps/icu-small/source/common/unifiedcache.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -24,8 +24,8 @@ static UConditionVar gInProgressValueAddedCond = U_CONDITION_INITIALIZER; static icu::UInitOnce gCacheInitOnce = U_INITONCE_INITIALIZER; static const int32_t MAX_EVICT_ITERATIONS = 10; -static int32_t DEFAULT_MAX_UNUSED = 1000; -static int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100; +static const int32_t DEFAULT_MAX_UNUSED = 1000; +static const int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100; U_CDECL_BEGIN diff --git a/deps/icu-small/source/common/unifiedcache.h b/deps/icu-small/source/common/unifiedcache.h index 67c676d4531c72..947ebbdc78cf85 100644 --- a/deps/icu-small/source/common/unifiedcache.h +++ b/deps/icu-small/source/common/unifiedcache.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -107,7 +107,7 @@ class CacheKey : public CacheKeyBase { */ virtual int32_t hashCode() const { const char *s = typeid(T).name(); - return ustr_hashCharsN(s, uprv_strlen(s)); + return ustr_hashCharsN(s, static_cast(uprv_strlen(s))); } /** diff --git a/deps/icu-small/source/common/unifilt.cpp b/deps/icu-small/source/common/unifilt.cpp index 2d8ce355c7532a..4ab0d9b5f934ba 100644 --- a/deps/icu-small/source/common/unifilt.cpp +++ b/deps/icu-small/source/common/unifilt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/unifunct.cpp b/deps/icu-small/source/common/unifunct.cpp index 8fdc638407dee6..f3995b298d2c46 100644 --- a/deps/icu-small/source/common/unifunct.cpp +++ b/deps/icu-small/source/common/unifunct.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uniset.cpp b/deps/icu-small/source/common/uniset.cpp index ef1b6113d9b96e..d828660796f743 100644 --- a/deps/icu-small/source/common/uniset.cpp +++ b/deps/icu-small/source/common/uniset.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uniset_closure.cpp b/deps/icu-small/source/common/uniset_closure.cpp index cacadf47758334..b5cc21394109dc 100644 --- a/deps/icu-small/source/common/uniset_closure.cpp +++ b/deps/icu-small/source/common/uniset_closure.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uniset_closure.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -184,7 +184,6 @@ UnicodeSet& UnicodeSet::closeOver(int32_t attribute) { return *this; } if (attribute & (USET_CASE_INSENSITIVE | USET_ADD_CASE_MAPPINGS)) { - const UCaseProps *csp = ucase_getSingleton(); { UnicodeSet foldSet(*this); UnicodeString str; @@ -207,7 +206,6 @@ UnicodeSet& UnicodeSet::closeOver(int32_t attribute) { int32_t n = getRangeCount(); UChar32 result; const UChar *full; - int32_t locCache = 0; for (int32_t i=0; isize(); ++j) { str = *(const UnicodeString *) strings->elementAt(j); str.foldCase(); - if(!ucase_addStringCaseClosure(csp, str.getBuffer(), str.length(), &sa)) { + if(!ucase_addStringCaseClosure(str.getBuffer(), str.length(), &sa)) { foldSet.add(str); // does not map to code points: add the folded string itself } } diff --git a/deps/icu-small/source/common/uniset_props.cpp b/deps/icu-small/source/common/uniset_props.cpp index 8348f8a33aa611..d0ed074a9be387 100644 --- a/deps/icu-small/source/common/uniset_props.cpp +++ b/deps/icu-small/source/common/uniset_props.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uniset_props.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -195,7 +195,7 @@ void U_CALLCONV UnicodeSet_initInclusion(int32_t src, UErrorCode &status) { if(U_SUCCESS(status)) { impl->addPropertyStarts(&sa, status); } - ucase_addPropertyStarts(ucase_getSingleton(), &sa, &status); + ucase_addPropertyStarts(&sa, &status); break; } case UPROPS_SRC_NFC: { @@ -228,7 +228,7 @@ void U_CALLCONV UnicodeSet_initInclusion(int32_t src, UErrorCode &status) { } #endif case UPROPS_SRC_CASE: - ucase_addPropertyStarts(ucase_getSingleton(), &sa, &status); + ucase_addPropertyStarts(&sa, &status); break; case UPROPS_SRC_BIDI: ubidi_addPropertyStarts(ubidi_getSingleton(), &sa, &status); @@ -987,7 +987,7 @@ UnicodeSet::applyPropertyAlias(const UnicodeString& prop, UProperty p; int32_t v; - UBool mustNotBeEmpty = FALSE, invert = FALSE; + UBool invert = FALSE; if (value.length() > 0) { p = u_getPropertyEnum(pname.data()); @@ -1009,14 +1009,15 @@ UnicodeSet::applyPropertyAlias(const UnicodeString& prop, p == UCHAR_LEAD_CANONICAL_COMBINING_CLASS) { char* end; double value = uprv_strtod(vname.data(), &end); - v = (int32_t) value; - if (v != value || v < 0 || *end != 0) { - // non-integral or negative value, or trailing junk + // Anything between 0 and 255 is valid even if unused. + // Cast double->int only after range check. + // We catch NaN here because comparing it with both 0 and 255 will be false + // (as are all comparisons with NaN). + if (*end != 0 || !(0 <= value && value <= 255) || + (v = (int32_t)value) != value) { + // non-integral value or outside 0..255, or trailing junk FAIL(ec); } - // If the resultant set is empty then the numeric value - // was invalid. - mustNotBeEmpty = TRUE; } else { FAIL(ec); } @@ -1115,12 +1116,6 @@ UnicodeSet::applyPropertyAlias(const UnicodeString& prop, complement(); } - if (U_SUCCESS(ec) && (mustNotBeEmpty && isEmpty())) { - // mustNotBeEmpty is set to true if an empty set indicates - // invalid input. - ec = U_ILLEGAL_ARGUMENT_ERROR; - } - if (isBogus() && U_SUCCESS(ec)) { // We likely ran out of memory. AHHH! ec = U_MEMORY_ALLOCATION_ERROR; diff --git a/deps/icu-small/source/common/unisetspan.cpp b/deps/icu-small/source/common/unisetspan.cpp index 1179495d4feb6a..0a8893472f958b 100644 --- a/deps/icu-small/source/common/unisetspan.cpp +++ b/deps/icu-small/source/common/unisetspan.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: unisetspan.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -502,7 +502,7 @@ spanOneBack(const UnicodeSet &set, const UChar *s, int32_t length) { static inline int32_t spanOneUTF8(const UnicodeSet &set, const uint8_t *s, int32_t length) { UChar32 c=*s; - if((int8_t)c>=0) { + if(U8_IS_SINGLE(c)) { return set.contains(c) ? 1 : -1; } // Take advantage of non-ASCII fastpaths in U8_NEXT_OR_FFFD(). @@ -514,7 +514,7 @@ spanOneUTF8(const UnicodeSet &set, const uint8_t *s, int32_t length) { static inline int32_t spanOneBackUTF8(const UnicodeSet &set, const uint8_t *s, int32_t length) { UChar32 c=s[length-1]; - if((int8_t)c>=0) { + if(U8_IS_SINGLE(c)) { return set.contains(c) ? 1 : -1; } int32_t i=length-1; @@ -1006,11 +1006,9 @@ int32_t UnicodeSetStringSpan::spanUTF8(const uint8_t *s, int32_t length, USetSpa // Try to match if the increment is not listed already. // Match at code point boundaries. (The UTF-8 strings were converted // from UTF-16 and are guaranteed to be well-formed.) - if( !U8_IS_TRAIL(s[pos-overlap]) && - !offsets.containsOffset(inc) && - matches8(s+pos-overlap, s8, length8) - - ) { + if(!U8_IS_TRAIL(s[pos-overlap]) && + !offsets.containsOffset(inc) && + matches8(s+pos-overlap, s8, length8)) { if(inc==rest) { return length; // Reached the end of the string. } @@ -1052,11 +1050,10 @@ int32_t UnicodeSetStringSpan::spanUTF8(const uint8_t *s, int32_t length, USetSpa // Try to match if the string is longer or starts earlier. // Match at code point boundaries. (The UTF-8 strings were converted // from UTF-16 and are guaranteed to be well-formed.) - if( !U8_IS_TRAIL(s[pos-overlap]) && - (overlap>maxOverlap || /* redundant overlap==maxOverlap && */ inc>maxInc) && - matches8(s+pos-overlap, s8, length8) - - ) { + if(!U8_IS_TRAIL(s[pos-overlap]) && + (overlap>maxOverlap || + /* redundant overlap==maxOverlap && */ inc>maxInc) && + matches8(s+pos-overlap, s8, length8)) { maxInc=inc; // Longest match from earliest start. maxOverlap=overlap; break; diff --git a/deps/icu-small/source/common/unisetspan.h b/deps/icu-small/source/common/unisetspan.h index 36cdd98d044d09..f1e78ff3ee2b00 100644 --- a/deps/icu-small/source/common/unisetspan.h +++ b/deps/icu-small/source/common/unisetspan.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: unisetspan.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/unistr.cpp b/deps/icu-small/source/common/unistr.cpp index f825de91bba9dc..48ad929e85a729 100644 --- a/deps/icu-small/source/common/unistr.cpp +++ b/deps/icu-small/source/common/unistr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -218,9 +218,10 @@ UnicodeString::UnicodeString(const UChar *text, } UnicodeString::UnicodeString(UBool isTerminated, - const UChar *text, + ConstChar16Ptr textPtr, int32_t textLength) { fUnion.fFields.fLengthAndFlags = kReadonlyAlias; + const UChar *text = textPtr; if(text == NULL) { // treat as an empty string, do not alias setToEmpty(); @@ -234,7 +235,8 @@ UnicodeString::UnicodeString(UBool isTerminated, // text is terminated, or else it would have failed the above test textLength = u_strlen(text); } - setArray((UChar *)text, textLength, isTerminated ? textLength + 1 : textLength); + setArray(const_cast(text), textLength, + isTerminated ? textLength + 1 : textLength); } } @@ -306,12 +308,10 @@ UnicodeString::UnicodeString(const UnicodeString& that) { copyFrom(that); } -#if U_HAVE_RVALUE_REFERENCES UnicodeString::UnicodeString(UnicodeString &&src) U_NOEXCEPT { fUnion.fFields.fLengthAndFlags = kShortString; moveFrom(src); } -#endif UnicodeString::UnicodeString(const UnicodeString& that, int32_t srcStart) { @@ -873,7 +873,7 @@ UnicodeString::doExtract(int32_t start, } int32_t -UnicodeString::extract(UChar *dest, int32_t destCapacity, +UnicodeString::extract(Char16Ptr dest, int32_t destCapacity, UErrorCode &errorCode) const { int32_t len = length(); if(U_SUCCESS(errorCode)) { @@ -1215,10 +1215,10 @@ UnicodeString::unBogus() { } } -const UChar * +const char16_t * UnicodeString::getTerminatedBuffer() { if(!isWritable()) { - return 0; + return nullptr; } UChar *array = getArrayStart(); int32_t len = length(); @@ -1249,14 +1249,14 @@ UnicodeString::getTerminatedBuffer() { array[len] = 0; return array; } else { - return NULL; + return nullptr; } } // setTo() analogous to the readonly-aliasing constructor with the same signature UnicodeString & UnicodeString::setTo(UBool isTerminated, - const UChar *text, + ConstChar16Ptr textPtr, int32_t textLength) { if(fUnion.fFields.fLengthAndFlags & kOpenGetBuffer) { @@ -1264,6 +1264,7 @@ UnicodeString::setTo(UBool isTerminated, return *this; } + const UChar *text = textPtr; if(text == NULL) { // treat as an empty string, do not alias releaseArray(); @@ -1713,14 +1714,14 @@ UnicodeString::doHashCode() const // External Buffer //======================================== -UChar * +char16_t * UnicodeString::getBuffer(int32_t minCapacity) { if(minCapacity>=-1 && cloneArrayIfNeeded(minCapacity)) { fUnion.fFields.fLengthAndFlags|=kOpenGetBuffer; setZeroLength(); return getArrayStart(); } else { - return 0; + return nullptr; } } diff --git a/deps/icu-small/source/common/unistr_case.cpp b/deps/icu-small/source/common/unistr_case.cpp index 1715b6ec66e268..2138d60c01c2d1 100644 --- a/deps/icu-small/source/common/unistr_case.cpp +++ b/deps/icu-small/source/common/unistr_case.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unistr_case.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * @@ -19,14 +19,18 @@ */ #include "unicode/utypes.h" +#include "unicode/brkiter.h" +#include "unicode/casemap.h" +#include "unicode/edits.h" #include "unicode/putil.h" #include "cstring.h" #include "cmemory.h" #include "unicode/ustring.h" #include "unicode/unistr.h" #include "unicode/uchar.h" +#include "uassert.h" +#include "ucasemap_imp.h" #include "uelement.h" -#include "ustr_imp.h" U_NAMESPACE_BEGIN @@ -87,56 +91,123 @@ UnicodeString::doCaseCompare(int32_t start, //======================================== UnicodeString & -UnicodeString::caseMap(const UCaseMap *csm, +UnicodeString::caseMap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM UStringCaseMapper *stringCaseMapper) { if(isEmpty() || !isWritable()) { // nothing to do return *this; } - // We need to allocate a new buffer for the internal string case mapping function. - // This is very similar to how doReplace() keeps the old array pointer - // and deletes the old array itself after it is done. - // In addition, we are forcing cloneArrayIfNeeded() to always allocate a new array. - UChar oldStackBuffer[US_STACKBUF_SIZE]; + UChar oldBuffer[2 * US_STACKBUF_SIZE]; UChar *oldArray; - int32_t oldLength; - - if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) { - // copy the stack buffer contents because it will be overwritten - oldArray = oldStackBuffer; - oldLength = getShortLength(); - u_memcpy(oldStackBuffer, fUnion.fStackFields.fBuffer, oldLength); + int32_t oldLength = length(); + int32_t newLength; + UBool writable = isBufferWritable(); + UErrorCode errorCode = U_ZERO_ERROR; + +#if !UCONFIG_NO_BREAK_ITERATION + // Read-only alias to the original string contents for the titlecasing BreakIterator. + // We cannot set the iterator simply to *this because *this is being modified. + UnicodeString oldString; +#endif + + // Try to avoid heap-allocating a new character array for this string. + 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(); + int32_t capacity; + oldArray = oldBuffer; + u_memcpy(oldBuffer, buffer, oldLength); + if (writable) { + capacity = getCapacity(); + } else { + // Switch from the read-only alias or shared heap buffer to the stack buffer. + if (!cloneArrayIfNeeded(US_STACKBUF_SIZE, US_STACKBUF_SIZE, /* doCopyArray= */ FALSE)) { + return *this; + } + U_ASSERT(fUnion.fFields.fLengthAndFlags & kUsingStackBuffer); + buffer = fUnion.fStackFields.fBuffer; + capacity = US_STACKBUF_SIZE; + } +#if !UCONFIG_NO_BREAK_ITERATION + if (iter != nullptr) { + oldString.setTo(FALSE, oldArray, oldLength); + iter->setText(oldString); + } +#endif + newLength = stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR + buffer, capacity, + oldArray, oldLength, NULL, errorCode); + if (U_SUCCESS(errorCode)) { + setLength(newLength); + return *this; + } else if (errorCode == U_BUFFER_OVERFLOW_ERROR) { + // common overflow handling below + } else { + setToBogus(); + return *this; + } } else { + // Longer string or read-only buffer: + // Collect only changes and then apply them to this string. + // Case mapping often changes only small parts of a string, + // and often does not change its length. oldArray = getArrayStart(); - oldLength = length(); + Edits edits; + UChar replacementChars[200]; +#if !UCONFIG_NO_BREAK_ITERATION + if (iter != nullptr) { + oldString.setTo(FALSE, oldArray, oldLength); + iter->setText(oldString); + } +#endif + stringCaseMapper(caseLocale, options | U_OMIT_UNCHANGED_TEXT, UCASEMAP_BREAK_ITERATOR + replacementChars, UPRV_LENGTHOF(replacementChars), + oldArray, oldLength, &edits, errorCode); + if (U_SUCCESS(errorCode)) { + // Grow the buffer at most once, not for multiple doReplace() calls. + newLength = oldLength + edits.lengthDelta(); + if (newLength > oldLength && !cloneArrayIfNeeded(newLength, newLength)) { + return *this; + } + for (Edits::Iterator ei = edits.getCoarseChangesIterator(); ei.next(errorCode);) { + doReplace(ei.destinationIndex(), ei.oldLength(), + replacementChars, ei.replacementIndex(), ei.newLength()); + } + if (U_FAILURE(errorCode)) { + setToBogus(); + } + return *this; + } else if (errorCode == U_BUFFER_OVERFLOW_ERROR) { + // common overflow handling below + newLength = oldLength + edits.lengthDelta(); + } else { + setToBogus(); + return *this; + } } - int32_t capacity; - if(oldLength <= US_STACKBUF_SIZE) { - capacity = US_STACKBUF_SIZE; - } else { - capacity = oldLength + 20; - } + // Handle buffer overflow, newLength is known. + // We need to allocate a new buffer for the internal string case mapping function. + // This is very similar to how doReplace() keeps the old array pointer + // and deletes the old array itself after it is done. + // In addition, we are forcing cloneArrayIfNeeded() to always allocate a new array. int32_t *bufferToDelete = 0; - if(!cloneArrayIfNeeded(capacity, capacity, FALSE, &bufferToDelete, TRUE)) { + if (!cloneArrayIfNeeded(newLength, newLength, FALSE, &bufferToDelete, TRUE)) { return *this; } - - // Case-map, and if the result is too long, then reallocate and repeat. - UErrorCode errorCode; - int32_t newLength; - do { - errorCode = U_ZERO_ERROR; - newLength = stringCaseMapper(csm, getArrayStart(), getCapacity(), - oldArray, oldLength, &errorCode); - setLength(newLength); - } while(errorCode==U_BUFFER_OVERFLOW_ERROR && cloneArrayIfNeeded(newLength, newLength, FALSE)); - + errorCode = U_ZERO_ERROR; + // No need to iter->setText() again: The case mapper restarts via iter->first(). + newLength = stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR + getArrayStart(), getCapacity(), + oldArray, oldLength, NULL, errorCode); if (bufferToDelete) { uprv_free(bufferToDelete); } - if(U_FAILURE(errorCode)) { + if (U_SUCCESS(errorCode)) { + setLength(newLength); + } else { setToBogus(); } return *this; @@ -144,10 +215,7 @@ UnicodeString::caseMap(const UCaseMap *csm, UnicodeString & UnicodeString::foldCase(uint32_t options) { - UCaseMap csm=UCASEMAP_INITIALIZER; - csm.csp=ucase_getSingleton(); - csm.options=options; - return caseMap(&csm, ustrcase_internalFold); + return caseMap(UCASE_LOC_ROOT, options, UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalFold); } U_NAMESPACE_END diff --git a/deps/icu-small/source/common/unistr_case_locale.cpp b/deps/icu-small/source/common/unistr_case_locale.cpp index a01be5c30b372a..f0f3048d06f517 100644 --- a/deps/icu-small/source/common/unistr_case_locale.cpp +++ b/deps/icu-small/source/common/unistr_case_locale.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: unistr_case_locale.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -19,9 +19,9 @@ #include "unicode/utypes.h" #include "unicode/locid.h" +#include "unicode/ucasemap.h" #include "unicode/unistr.h" -#include "cmemory.h" -#include "ustr_imp.h" +#include "ucasemap_imp.h" U_NAMESPACE_BEGIN @@ -29,44 +29,28 @@ U_NAMESPACE_BEGIN // Write implementation //======================================== -/* - * Set parameters on an empty UCaseMap, for UCaseMap-less API functions. - * Do this fast because it is called with every function call. - */ -static inline void -setTempCaseMap(UCaseMap *csm, const char *locale) { - if(csm->csp==NULL) { - csm->csp=ucase_getSingleton(); - } - if(locale!=NULL && locale[0]==0) { - csm->locale[0]=0; - } else { - ustrcase_setTempCaseMapLocale(csm, locale); - } -} - UnicodeString & UnicodeString::toLower() { - return toLower(Locale::getDefault()); + return caseMap(ustrcase_getCaseLocale(NULL), 0, + UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower); } UnicodeString & UnicodeString::toLower(const Locale &locale) { - UCaseMap csm=UCASEMAP_INITIALIZER; - setTempCaseMap(&csm, locale.getName()); - return caseMap(&csm, ustrcase_internalToLower); + return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0, + UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower); } UnicodeString & UnicodeString::toUpper() { - return toUpper(Locale::getDefault()); + return caseMap(ustrcase_getCaseLocale(NULL), 0, + UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper); } UnicodeString & UnicodeString::toUpper(const Locale &locale) { - UCaseMap csm=UCASEMAP_INITIALIZER; - setTempCaseMap(&csm, locale.getName()); - return caseMap(&csm, ustrcase_internalToUpper); + return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0, + UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper); } U_NAMESPACE_END diff --git a/deps/icu-small/source/common/unistr_cnv.cpp b/deps/icu-small/source/common/unistr_cnv.cpp index a9b44ee424c33f..64d3c16801ccb8 100644 --- a/deps/icu-small/source/common/unistr_cnv.cpp +++ b/deps/icu-small/source/common/unistr_cnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unistr_cnv.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * diff --git a/deps/icu-small/source/common/unistr_props.cpp b/deps/icu-small/source/common/unistr_props.cpp index 533a683928c0bc..691bd085d6a923 100644 --- a/deps/icu-small/source/common/unistr_props.cpp +++ b/deps/icu-small/source/common/unistr_props.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unistr_props.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * diff --git a/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp b/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp index 3d6737cfc5e3d9..4969884b0dc9b9 100644 --- a/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp +++ b/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: unistr_titlecase_brkiter.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:2 * @@ -22,69 +22,34 @@ #if !UCONFIG_NO_BREAK_ITERATION #include "unicode/brkiter.h" -#include "unicode/ubrk.h" +#include "unicode/locid.h" +#include "unicode/ucasemap.h" #include "unicode/unistr.h" -#include "unicode/ustring.h" -#include "cmemory.h" -#include "ustr_imp.h" - -static int32_t U_CALLCONV -unistr_case_internalToTitle(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode) { - ubrk_setText(csm->iter, src, srcLength, pErrorCode); - return ustrcase_internalToTitle(csm, dest, destCapacity, src, srcLength, pErrorCode); -} - -/* - * Set parameters on an empty UCaseMap, for UCaseMap-less API functions. - * Do this fast because it is called with every function call. - */ -static inline void -setTempCaseMap(UCaseMap *csm, const char *locale) { - if(csm->csp==NULL) { - csm->csp=ucase_getSingleton(); - } - if(locale!=NULL && locale[0]==0) { - csm->locale[0]=0; - } else { - ustrcase_setTempCaseMapLocale(csm, locale); - } -} +#include "ucasemap_imp.h" U_NAMESPACE_BEGIN UnicodeString & -UnicodeString::toTitle(BreakIterator *titleIter) { - return toTitle(titleIter, Locale::getDefault(), 0); +UnicodeString::toTitle(BreakIterator *iter) { + return toTitle(iter, Locale::getDefault(), 0); } UnicodeString & -UnicodeString::toTitle(BreakIterator *titleIter, const Locale &locale) { - return toTitle(titleIter, locale, 0); +UnicodeString::toTitle(BreakIterator *iter, const Locale &locale) { + return toTitle(iter, locale, 0); } UnicodeString & -UnicodeString::toTitle(BreakIterator *titleIter, const Locale &locale, uint32_t options) { - UCaseMap csm=UCASEMAP_INITIALIZER; - csm.options=options; - setTempCaseMap(&csm, locale.getName()); - BreakIterator *bi=titleIter; - if(bi==NULL) { - UErrorCode errorCode=U_ZERO_ERROR; - bi=BreakIterator::createWordInstance(locale, errorCode); - if(U_FAILURE(errorCode)) { - setToBogus(); - return *this; +UnicodeString::toTitle(BreakIterator *iter, const Locale &locale, uint32_t options) { + LocalPointer ownedIter; + UErrorCode errorCode = U_ZERO_ERROR; + iter = ustrcase_getTitleBreakIterator(&locale, "", options, iter, ownedIter, errorCode); + if (iter == nullptr) { + setToBogus(); + return *this; } - } - csm.iter=reinterpret_cast(bi); - caseMap(&csm, unistr_case_internalToTitle); - if(titleIter==NULL) { - delete bi; - } - return *this; + caseMap(ustrcase_getCaseLocale(locale.getBaseName()), options, iter, ustrcase_internalToTitle); + return *this; } U_NAMESPACE_END diff --git a/deps/icu-small/source/common/unistrappender.h b/deps/icu-small/source/common/unistrappender.h index 600fd9033585a8..134f31497f1525 100644 --- a/deps/icu-small/source/common/unistrappender.h +++ b/deps/icu-small/source/common/unistrappender.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unorm.cpp b/deps/icu-small/source/common/unorm.cpp index 75aaea9cdfc02b..93f77e66afb40e 100644 --- a/deps/icu-small/source/common/unorm.cpp +++ b/deps/icu-small/source/common/unorm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/unormcmp.cpp b/deps/icu-small/source/common/unormcmp.cpp index b40a10a1385fb4..689b0b53b2d5f5 100644 --- a/deps/icu-small/source/common/unormcmp.cpp +++ b/deps/icu-small/source/common/unormcmp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unormcmp.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -145,7 +145,6 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1, uint32_t options, UErrorCode *pErrorCode) { const Normalizer2Impl *nfcImpl; - const UCaseProps *csp; /* current-level start/limit - s1/s2 as current */ const UChar *start1, *start2, *limit1, *limit2; @@ -183,11 +182,6 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1, } else { nfcImpl=NULL; } - if((options&U_COMPARE_IGNORE_CASE)!=0) { - csp=ucase_getSingleton(); - } else { - csp=NULL; - } if(U_FAILURE(*pErrorCode)) { return 0; } @@ -319,7 +313,7 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1, */ if( level1==0 && (options&U_COMPARE_IGNORE_CASE) && - (length=ucase_toFullFolding(csp, (UChar32)cp1, &p, options))>=0 + (length=ucase_toFullFolding((UChar32)cp1, &p, options))>=0 ) { /* cp1 case-folds to the code point "length" or to p[length] */ if(U_IS_SURROGATE(c1)) { @@ -364,7 +358,7 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1, } if( level2==0 && (options&U_COMPARE_IGNORE_CASE) && - (length=ucase_toFullFolding(csp, (UChar32)cp2, &p, options))>=0 + (length=ucase_toFullFolding((UChar32)cp2, &p, options))>=0 ) { /* cp2 case-folds to the code point "length" or to p[length] */ if(U_IS_SURROGATE(c2)) { diff --git a/deps/icu-small/source/common/unormimp.h b/deps/icu-small/source/common/unormimp.h index c382f38b8beaae..7f280551f7ef8e 100644 --- a/deps/icu-small/source/common/unormimp.h +++ b/deps/icu-small/source/common/unormimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unormimp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uobject.cpp b/deps/icu-small/source/common/uobject.cpp index 37406e4a0dc07a..1133dd9b67aaa6 100644 --- a/deps/icu-small/source/common/uobject.cpp +++ b/deps/icu-small/source/common/uobject.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: uobject.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uposixdefs.h b/deps/icu-small/source/common/uposixdefs.h index 495deea49e3f7c..45ca1233ac731a 100644 --- a/deps/icu-small/source/common/uposixdefs.h +++ b/deps/icu-small/source/common/uposixdefs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: uposixdefs.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -54,22 +54,18 @@ * * z/OS needs this definition for timeval and to get usleep. */ -#if !defined(_XOPEN_SOURCE_EXTENDED) +#if !defined(_XOPEN_SOURCE_EXTENDED) && defined(__TOS_MVS__) # define _XOPEN_SOURCE_EXTENDED 1 #endif -/* - * There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms. - * A compatibility issue exists between turning on _XOPEN_SOURCE_EXTENDED and using - * standard C++ string class. As a result, standard C++ string class needs to be - * turned off for the follwing platforms: - * -AIX/VACPP - * -Solaris/GCC +/** + * Solaris says: + * "...it is invalid to compile an XPG6 or a POSIX.1-2001 application with anything other + * than a c99 or later compiler." + * Apparently C++11 is not "or later". Work around this. */ -#if (U_PLATFORM == U_PF_AIX && !defined(__GNUC__)) || (U_PLATFORM == U_PF_SOLARIS && defined(__GNUC__)) -# if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING) -# define U_HAVE_STD_STRING 0 -# endif +#if defined(__cplusplus) && (defined(sun) || defined(__sun)) && !defined (_STDC_C99) +# define _STDC_C99 #endif #endif /* __UPOSIXDEFS_H__ */ diff --git a/deps/icu-small/source/common/uprops.cpp b/deps/icu-small/source/common/uprops.cpp index 46ceb66d8cf632..ace3c4d6d04652 100644 --- a/deps/icu-small/source/common/uprops.cpp +++ b/deps/icu-small/source/common/uprops.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uprops.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -128,9 +128,8 @@ static UBool changesWhenCasefolded(const BinaryProperty &/*prop*/, UChar32 c, UP } if(c>=0) { /* single code point */ - const UCaseProps *csp=ucase_getSingleton(); const UChar *resultString; - return (UBool)(ucase_toFullFolding(csp, c, &resultString, U_FOLD_CASE_DEFAULT)>=0); + 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]; @@ -207,6 +206,11 @@ static UBool isPOSIX_xdigit(const BinaryProperty &/*prop*/, UChar32 c, UProperty return u_isxdigit(c); } +static UBool isRegionalIndicator(const BinaryProperty &/*prop*/, UChar32 c, UProperty /*which*/) { + // Property starts are a subset of lb=RI etc. + return 0x1F1E6<=c && c<=0x1F1FF; +} + static const BinaryProperty binProps[UCHAR_BINARY_LIMIT]={ /* * column and mask values for binary properties from u_getUnicodeProperties(). @@ -277,6 +281,9 @@ static const BinaryProperty binProps[UCHAR_BINARY_LIMIT]={ { 2, U_MASK(UPROPS_2_EMOJI_PRESENTATION), defaultContains }, { 2, U_MASK(UPROPS_2_EMOJI_MODIFIER), defaultContains }, { 2, U_MASK(UPROPS_2_EMOJI_MODIFIER_BASE), defaultContains }, + { 2, U_MASK(UPROPS_2_EMOJI_COMPONENT), defaultContains }, + { 2, 0, isRegionalIndicator }, + { 1, U_MASK(UPROPS_PREPENDED_CONCATENATION_MARK), defaultContains }, }; U_CAPI UBool U_EXPORT2 @@ -576,14 +583,13 @@ u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *p // case folding and NFKC.) // For the derivation, see Unicode's DerivedNormalizationProps.txt. const Normalizer2 *nfkc=Normalizer2::getNFKCInstance(*pErrorCode); - const UCaseProps *csp=ucase_getSingleton(); if(U_FAILURE(*pErrorCode)) { return 0; } // first: b = NFKC(Fold(a)) UnicodeString folded1String; const UChar *folded1; - int32_t folded1Length=ucase_toFullFolding(csp, c, &folded1, U_FOLD_CASE_DEFAULT); + int32_t folded1Length=ucase_toFullFolding(c, &folded1, U_FOLD_CASE_DEFAULT); if(folded1Length<0) { const Normalizer2Impl *nfkcImpl=Normalizer2Factory::getImpl(nfkc); if(nfkcImpl->getCompQuickCheck(nfkcImpl->getNorm16(c))!=UNORM_NO) { diff --git a/deps/icu-small/source/common/uprops.h b/deps/icu-small/source/common/uprops.h index 63c588088ad1c3..6f67756cd91033 100644 --- a/deps/icu-small/source/common/uprops.h +++ b/deps/icu-small/source/common/uprops.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uprops.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -189,15 +189,15 @@ enum { UPROPS_VARIATION_SELECTOR, UPROPS_PATTERN_SYNTAX, /* new in ICU 3.4 and Unicode 4.1 */ UPROPS_PATTERN_WHITE_SPACE, - UPROPS_RESERVED, /* reserved & unused */ + UPROPS_PREPENDED_CONCATENATION_MARK, // new in ICU 60 and Unicode 10 UPROPS_BINARY_1_TOP /* ==32 - full! */ }; /* * Properties in vector word 2 * Bits - * 31..28 http://www.unicode.org/reports/tr51/#Emoji_Properties - * 27..26 reserved + * 31..27 http://www.unicode.org/reports/tr51/#Emoji_Properties + * 26 reserved * 25..20 Line Break * 19..15 Sentence Break * 14..10 Word Break @@ -205,7 +205,8 @@ enum { * 4.. 0 Decomposition Type */ enum { - UPROPS_2_EMOJI=28, + UPROPS_2_EMOJI_COMPONENT=27, + UPROPS_2_EMOJI, UPROPS_2_EMOJI_PRESENTATION, UPROPS_2_EMOJI_MODIFIER, UPROPS_2_EMOJI_MODIFIER_BASE diff --git a/deps/icu-small/source/common/ures_cnv.c b/deps/icu-small/source/common/ures_cnv.cpp similarity index 92% rename from deps/icu-small/source/common/ures_cnv.c rename to deps/icu-small/source/common/ures_cnv.cpp index a810fc08567144..43515fda282972 100644 --- a/deps/icu-small/source/common/ures_cnv.c +++ b/deps/icu-small/source/common/ures_cnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ures_cnv.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -43,7 +43,7 @@ ures_openU(const UChar *myPath, } else { length=u_strlen(myPath); - if(length>=sizeof(pathBuffer)) { + if(length>=(int32_t)sizeof(pathBuffer)) { *status=U_ILLEGAL_ARGUMENT_ERROR; return NULL; } else if(uprv_isInvariantUString(myPath, length)) { @@ -61,7 +61,7 @@ ures_openU(const UChar *myPath, if(U_FAILURE(*status)) { return NULL; } - if(length>=sizeof(pathBuffer)) { + if(length>=(int32_t)sizeof(pathBuffer)) { /* not NUL-terminated - path too long */ *status=U_ILLEGAL_ARGUMENT_ERROR; return NULL; diff --git a/deps/icu-small/source/common/uresbund.cpp b/deps/icu-small/source/common/uresbund.cpp index 6813645c98b614..c88d9014ec23b7 100644 --- a/deps/icu-small/source/common/uresbund.cpp +++ b/deps/icu-small/source/common/uresbund.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -1083,6 +1083,7 @@ static UResourceBundle *init_resb_result(const ResourceData *rdata, Resource r, pathBuf = (char *)uprv_malloc((uprv_strlen(keyPath)+1)*sizeof(char)); if(pathBuf == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; + ures_close(mainRes); return NULL; } } diff --git a/deps/icu-small/source/common/uresdata.cpp b/deps/icu-small/source/common/uresdata.cpp index f775bcdffb57a7..a0b8d3ba904ad6 100644 --- a/deps/icu-small/source/common/uresdata.cpp +++ b/deps/icu-small/source/common/uresdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * and others. All Rights Reserved. ******************************************************************************* * file name: uresdata.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -758,7 +758,9 @@ res_getTableItemByIndex(const ResourceData *pResData, Resource table, int32_t indexR, const char **key) { uint32_t offset=RES_GET_OFFSET(table); int32_t length; - U_ASSERT(indexR>=0); /* to ensure the index is not negative */ + if (indexR < 0) { + return RES_BOGUS; + } switch(RES_GET_TYPE(table)) { case URES_TABLE: { if (offset != 0) { /* empty if offset==0 */ @@ -836,7 +838,9 @@ UBool icu::ResourceTable::getKeyAndValue(int32_t i, U_CAPI Resource U_EXPORT2 res_getArrayItem(const ResourceData *pResData, Resource array, int32_t indexR) { uint32_t offset=RES_GET_OFFSET(array); - U_ASSERT(indexR>=0); /* to ensure the index is not negative */ + if (indexR < 0) { + return RES_BOGUS; + } switch(RES_GET_TYPE(array)) { case URES_ARRAY: { if (offset!=0) { /* empty if offset==0 */ @@ -923,14 +927,14 @@ res_findResource(const ResourceData *pResData, Resource r, char** path, const ch if(t2 == RES_BOGUS) { /* if we fail to get the resource by key, maybe we got an index */ indexR = uprv_strtol(pathP, &closeIndex, 10); - if(*closeIndex == 0) { + if(indexR >= 0 && *closeIndex == 0) { /* if we indeed have an index, try to get the item by index */ t2 = res_getTableItemByIndex(pResData, t1, indexR, key); - } + } // else t2 is already RES_BOGUS } } else if(URES_IS_ARRAY(type)) { indexR = uprv_strtol(pathP, &closeIndex, 10); - if(*closeIndex == 0) { + if(indexR >= 0 && *closeIndex == 0) { t2 = res_getArrayItem(pResData, t1, indexR); } else { t2 = RES_BOGUS; /* have an array, but don't have a valid index */ diff --git a/deps/icu-small/source/common/uresdata.h b/deps/icu-small/source/common/uresdata.h index ae7d9a817d2b2f..8d845e3dfcfc83 100644 --- a/deps/icu-small/source/common/uresdata.h +++ b/deps/icu-small/source/common/uresdata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: uresdata.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uresimp.h b/deps/icu-small/source/common/uresimp.h index 8339240a276b6f..e4f75c9f115d0e 100644 --- a/deps/icu-small/source/common/uresimp.h +++ b/deps/icu-small/source/common/uresimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ureslocs.h b/deps/icu-small/source/common/ureslocs.h index 85dd8fb4b7f211..f7c3344ef201a8 100644 --- a/deps/icu-small/source/common/ureslocs.h +++ b/deps/icu-small/source/common/ureslocs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/usc_impl.c b/deps/icu-small/source/common/usc_impl.cpp similarity index 98% rename from deps/icu-small/source/common/usc_impl.c rename to deps/icu-small/source/common/usc_impl.cpp index c2b2a3656c4ebb..d69880326a4cbd 100644 --- a/deps/icu-small/source/common/usc_impl.c +++ b/deps/icu-small/source/common/usc_impl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -197,7 +197,7 @@ uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode) return NULL; } - result = uprv_malloc(sizeof (UScriptRun)); + result = (UScriptRun *)uprv_malloc(sizeof (UScriptRun)); if (result == NULL) { *pErrorCode = U_MEMORY_ALLOCATION_ERROR; diff --git a/deps/icu-small/source/common/usc_impl.h b/deps/icu-small/source/common/usc_impl.h index 7c9c5e095052ff..44899649d4c315 100644 --- a/deps/icu-small/source/common/usc_impl.h +++ b/deps/icu-small/source/common/usc_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uscript.c b/deps/icu-small/source/common/uscript.cpp similarity index 98% rename from deps/icu-small/source/common/uscript.c rename to deps/icu-small/source/common/uscript.cpp index 336e185799ab96..83b5f7ef168f7e 100644 --- a/deps/icu-small/source/common/uscript.c +++ b/deps/icu-small/source/common/uscript.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uscript_props.cpp b/deps/icu-small/source/common/uscript_props.cpp index 20c7cdce2ffad1..7998c52c7f02c5 100644 --- a/deps/icu-small/source/common/uscript_props.cpp +++ b/deps/icu-small/source/common/uscript_props.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: uscript_props.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -33,7 +33,7 @@ namespace { const int32_t UNKNOWN = 1 << 21; const int32_t EXCLUSION = 2 << 21; const int32_t LIMITED_USE = 3 << 21; -const int32_t ASPIRATIONAL = 4 << 21; +// st int32_t ASPIRATIONAL = 4 << 21; -- not used any more since Unicode 10 const int32_t RECOMMENDED = 5 << 21; // Bits 31..24: Single-bit flags @@ -71,7 +71,7 @@ const int32_t SCRIPT_PROPS[] = { 0x0EA5 | RECOMMENDED | LB_LETTERS, // Laoo 0x004C | RECOMMENDED | CASED, // Latn 0x0D15 | RECOMMENDED, // Mlym - 0x1826 | ASPIRATIONAL, // Mong + 0x1826 | LIMITED_USE, // Mong 0x1000 | RECOMMENDED | LB_LETTERS, // Mymr 0x168F | EXCLUSION, // Ogam 0x10300 | EXCLUSION, // Ital @@ -84,8 +84,8 @@ const int32_t SCRIPT_PROPS[] = { 0x078C | RECOMMENDED | RTL, // Thaa 0x0E17 | RECOMMENDED | LB_LETTERS, // Thai 0x0F40 | RECOMMENDED, // Tibt - 0x14C0 | ASPIRATIONAL, // Cans - 0xA288 | ASPIRATIONAL | LB_LETTERS, // Yiii + 0x14C0 | LIMITED_USE, // Cans + 0xA288 | LIMITED_USE | LB_LETTERS, // Yiii 0x1703 | EXCLUSION, // Tglg 0x1723 | EXCLUSION, // Hano 0x1743 | EXCLUSION, // Buhd @@ -104,7 +104,7 @@ const int32_t SCRIPT_PROPS[] = { 0x10A00 | EXCLUSION | RTL, // Khar 0xA800 | LIMITED_USE, // Sylo 0x1980 | LIMITED_USE | LB_LETTERS, // Talu - 0x2D30 | ASPIRATIONAL, // Tfng + 0x2D30 | LIMITED_USE, // Tfng 0x103A0 | EXCLUSION, // Xpeo 0x1B05 | LIMITED_USE, // Bali 0x1BC0 | LIMITED_USE, // Batk @@ -136,7 +136,7 @@ const int32_t SCRIPT_PROPS[] = { 0x1036B | EXCLUSION, // Perm 0xA840 | EXCLUSION, // Phag 0x10900 | EXCLUSION | RTL, // Phnx - 0x16F00 | ASPIRATIONAL, // Plrd + 0x16F00 | LIMITED_USE, // Plrd 0, 0, 0, @@ -194,7 +194,7 @@ const int32_t SCRIPT_PROPS[] = { 0, 0, 0x16A4F | EXCLUSION, // Mroo - 0, + 0x1B1C4 | EXCLUSION | LB_LETTERS, // Nshu 0x11183 | EXCLUSION, // Shrd 0x110D0 | EXCLUSION, // Sora 0x11680 | EXCLUSION, // Takr @@ -219,6 +219,9 @@ const int32_t SCRIPT_PROPS[] = { 0x5B57 | RECOMMENDED | LB_LETTERS, // Hanb 0x1112 | RECOMMENDED, // Jamo 0, + 0x11D10 | EXCLUSION, // Gonm + 0x11A5C | EXCLUSION, // Soyo + 0x11A0B | EXCLUSION, // Zanb // End copy-paste from parsescriptmetadata.py }; diff --git a/deps/icu-small/source/common/uset.cpp b/deps/icu-small/source/common/uset.cpp index f15d4a14ab7d81..75ff5ddff52d1a 100644 --- a/deps/icu-small/source/common/uset.cpp +++ b/deps/icu-small/source/common/uset.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uset.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uset_imp.h b/deps/icu-small/source/common/uset_imp.h index 8cb31edfcf779e..5f4a3113d9aaf7 100644 --- a/deps/icu-small/source/common/uset_imp.h +++ b/deps/icu-small/source/common/uset_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uset_imp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uset_props.cpp b/deps/icu-small/source/common/uset_props.cpp index cf772957ee5eac..b68175c1d23b14 100644 --- a/deps/icu-small/source/common/uset_props.cpp +++ b/deps/icu-small/source/common/uset_props.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uset_props.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/usetiter.cpp b/deps/icu-small/source/common/usetiter.cpp index 2be2079c513069..5d5d3c4e3d6200 100644 --- a/deps/icu-small/source/common/usetiter.cpp +++ b/deps/icu-small/source/common/usetiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ushape.cpp b/deps/icu-small/source/common/ushape.cpp index 4913a3ff573ce7..d7886ac06c6b9d 100644 --- a/deps/icu-small/source/common/ushape.cpp +++ b/deps/icu-small/source/common/ushape.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: ushape.cpp - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/usprep.cpp b/deps/icu-small/source/common/usprep.cpp index fb9c18b66bc83e..c4f831be2e4fe2 100644 --- a/deps/icu-small/source/common/usprep.cpp +++ b/deps/icu-small/source/common/usprep.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: usprep.cpp - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ustack.cpp b/deps/icu-small/source/common/ustack.cpp index 1de79ecfe3559c..fb314b0ebe54cd 100644 --- a/deps/icu-small/source/common/ustack.cpp +++ b/deps/icu-small/source/common/ustack.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ustr_cnv.cpp b/deps/icu-small/source/common/ustr_cnv.cpp index 4b845d5adca0e7..951864f4a6c7db 100644 --- a/deps/icu-small/source/common/ustr_cnv.cpp +++ b/deps/icu-small/source/common/ustr_cnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ustr_cnv.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ustr_cnv.h b/deps/icu-small/source/common/ustr_cnv.h index e647356560e95f..12e86ea02f7264 100644 --- a/deps/icu-small/source/common/ustr_cnv.h +++ b/deps/icu-small/source/common/ustr_cnv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ustr_cnv.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/ustr_imp.h b/deps/icu-small/source/common/ustr_imp.h index 21ee6cba624aac..943824fa197645 100644 --- a/deps/icu-small/source/common/ustr_imp.h +++ b/deps/icu-small/source/common/ustr_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ustr_imp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -18,23 +18,7 @@ #define __USTR_IMP_H__ #include "unicode/utypes.h" -#include "unicode/uiter.h" -#include "ucase.h" - -/** Simple declaration to avoid including unicode/ubrk.h. */ -#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR -# define UBRK_TYPEDEF_UBREAK_ITERATOR - typedef struct UBreakIterator UBreakIterator; -#endif - -#ifndef U_COMPARE_IGNORE_CASE -/* see also unorm.h */ -/** - * Option bit for unorm_compare: - * Perform case-insensitive comparison. - */ -#define U_COMPARE_IGNORE_CASE 0x10000 -#endif +#include "unicode/utf8.h" /** * Internal option for unorm_cmpEquivFold() for strncmp style. @@ -53,211 +37,6 @@ uprv_strCompare(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, UBool strncmpStyle, UBool codePointOrder); -/** - * Internal API, used by u_strcasecmp() etc. - * Compare strings case-insensitively, - * in code point order or code unit order. - */ -U_CFUNC int32_t -u_strcmpFold(const UChar *s1, int32_t length1, - const UChar *s2, int32_t length2, - uint32_t options, - UErrorCode *pErrorCode); - -/** - * Interanl API, used for detecting length of - * shared prefix case-insensitively. - * @param s1 input string 1 - * @param length1 length of string 1, or -1 (NULL terminated) - * @param s2 input string 2 - * @param length2 length of string 2, or -1 (NULL terminated) - * @param options compare options - * @param matchLen1 (output) length of partial prefix match in s1 - * @param matchLen2 (output) length of partial prefix match in s2 - * @param pErrorCode receives error status - */ -U_CAPI void -u_caseInsensitivePrefixMatch(const UChar *s1, int32_t length1, - const UChar *s2, int32_t length2, - uint32_t options, - int32_t *matchLen1, int32_t *matchLen2, - UErrorCode *pErrorCode); - -/** - * Are the Unicode properties loaded? - * This must be used before internal functions are called that do - * not perform this check. - * Generate a debug assertion failure if data is not loaded. - */ -U_CFUNC UBool -uprv_haveProperties(UErrorCode *pErrorCode); - -/** - * Load the Unicode property data. - * Intended primarily for use from u_init(). - * Has no effect if property data is already loaded. - * NOT thread safe. - */ -/*U_CFUNC int8_t -uprv_loadPropsData(UErrorCode *errorCode);*/ - -/* - * Internal string casing functions implementing - * ustring.h/ustrcase.c and UnicodeString case mapping functions. - */ - -struct UCaseMap { - const UCaseProps *csp; -#if !UCONFIG_NO_BREAK_ITERATION - UBreakIterator *iter; /* We adopt the iterator, so we own it. */ -#endif - char locale[32]; - int32_t locCache; - uint32_t options; -}; - -#ifndef __UCASEMAP_H__ -typedef struct UCaseMap UCaseMap; -#endif - -#if UCONFIG_NO_BREAK_ITERATION -# define UCASEMAP_INITIALIZER { NULL, { 0 }, 0, 0 } -#else -# define UCASEMAP_INITIALIZER { NULL, NULL, { 0 }, 0, 0 } -#endif - -U_CFUNC void -ustrcase_setTempCaseMapLocale(UCaseMap *csm, const char *locale); - -#ifndef U_STRING_CASE_MAPPER_DEFINED -#define U_STRING_CASE_MAPPER_DEFINED - -/** - * String case mapping function type, used by ustrcase_map(). - * All error checking must be done. - * The UCaseMap must be fully initialized, with locale and/or iter set as needed. - * src and dest must not overlap. - */ -typedef int32_t U_CALLCONV -UStringCaseMapper(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode); - -#endif - -/** Implements UStringCaseMapper. */ -U_CFUNC int32_t U_CALLCONV -ustrcase_internalToLower(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode); - -/** Implements UStringCaseMapper. */ -U_CFUNC int32_t U_CALLCONV -ustrcase_internalToUpper(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode); - -#if !UCONFIG_NO_BREAK_ITERATION - -/** Implements UStringCaseMapper. */ -U_CFUNC int32_t U_CALLCONV -ustrcase_internalToTitle(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode); - -#endif - -/** Implements UStringCaseMapper. */ -U_CFUNC int32_t U_CALLCONV -ustrcase_internalFold(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode); - -/** - * Implements argument checking and buffer handling - * for string case mapping as a common function. - */ -U_CFUNC int32_t -ustrcase_map(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UStringCaseMapper *stringCaseMapper, - UErrorCode *pErrorCode); - -/** - * UTF-8 string case mapping function type, used by ucasemap_mapUTF8(). - * UTF-8 version of UStringCaseMapper. - * All error checking must be done. - * The UCaseMap must be fully initialized, with locale and/or iter set as needed. - * src and dest must not overlap. - */ -typedef int32_t U_CALLCONV -UTF8CaseMapper(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode); - -/** Implements UTF8CaseMapper. */ -U_CFUNC int32_t U_CALLCONV -ucasemap_internalUTF8ToTitle(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - UErrorCode *pErrorCode); - -/** - * Implements argument checking and buffer handling - * for UTF-8 string case mapping as a common function. - */ -U_CFUNC int32_t -ucasemap_mapUTF8(const UCaseMap *csm, - uint8_t *dest, int32_t destCapacity, - const uint8_t *src, int32_t srcLength, - UTF8CaseMapper *stringCaseMapper, - UErrorCode *pErrorCode); - -#ifdef __cplusplus - -U_NAMESPACE_BEGIN -namespace GreekUpper { - -// Data bits. -static const uint32_t UPPER_MASK = 0x3ff; -static const uint32_t HAS_VOWEL = 0x1000; -static const uint32_t HAS_YPOGEGRAMMENI = 0x2000; -static const uint32_t HAS_ACCENT = 0x4000; -static const uint32_t HAS_DIALYTIKA = 0x8000; -// Further bits during data building and processing, not stored in the data map. -static const uint32_t HAS_COMBINING_DIALYTIKA = 0x10000; -static const uint32_t HAS_OTHER_GREEK_DIACRITIC = 0x20000; - -static const uint32_t HAS_VOWEL_AND_ACCENT = HAS_VOWEL | HAS_ACCENT; -static const uint32_t HAS_VOWEL_AND_ACCENT_AND_DIALYTIKA = - HAS_VOWEL_AND_ACCENT | HAS_DIALYTIKA; -static const uint32_t HAS_EITHER_DIALYTIKA = HAS_DIALYTIKA | HAS_COMBINING_DIALYTIKA; - -// State bits. -static const uint32_t AFTER_CASED = 1; -static const uint32_t AFTER_VOWEL_WITH_ACCENT = 2; - -uint32_t getLetterData(UChar32 c); - -/** - * Returns a non-zero value for each of the Greek combining diacritics - * listed in The Unicode Standard, version 8, chapter 7.2 Greek, - * plus some perispomeni look-alikes. - */ -uint32_t getDiacriticData(UChar32 c); - -} // namespace GreekUpper -U_NAMESPACE_END - -#endif // __cplusplus - U_CAPI int32_t U_EXPORT2 ustr_hashUCharsN(const UChar *str, int32_t length); @@ -303,4 +82,62 @@ u_terminateUChar32s(UChar32 *dest, int32_t destCapacity, int32_t length, UErrorC U_CAPI int32_t U_EXPORT2 u_terminateWChars(wchar_t *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode); +/** + * Counts the bytes of any whole valid sequence for a UTF-8 lead byte. + * Returns 1 for ASCII 0..0x7f. + * Returns 0 for 0x80..0xc1 as well as for 0xf5..0xff. + * leadByte might be evaluated multiple times. + * + * @param leadByte The first byte of a UTF-8 sequence. Must be 0..0xff. + * @return 0..4 + */ +#define U8_COUNT_BYTES(leadByte) \ + (U8_IS_SINGLE(leadByte) ? 1 : U8_COUNT_BYTES_NON_ASCII(leadByte)) + +/** + * Counts the bytes of any whole valid sequence for a UTF-8 lead byte. + * Returns 0 for 0x00..0xc1 as well as for 0xf5..0xff. + * leadByte might be evaluated multiple times. + * + * @param leadByte The first byte of a UTF-8 sequence. Must be 0..0xff. + * @return 0 or 2..4 + */ +#define U8_COUNT_BYTES_NON_ASCII(leadByte) \ + (U8_IS_LEAD(leadByte) ? ((uint8_t)(leadByte)>=0xe0)+((uint8_t)(leadByte)>=0xf0)+2 : 0) + +#ifdef __cplusplus + +U_NAMESPACE_BEGIN + +class UTF8 { +public: + UTF8() = delete; // all static + + /** + * Is t a valid UTF-8 trail byte? + * + * @param prev Must be the preceding lead byte if i==1 and length>=3; + * otherwise ignored. + * @param t The i-th byte following the lead byte. + * @param i The index (1..3) of byte t in the byte sequence. 0 1) { + return U8_IS_TRAIL(t); + } else if (length == 3) { + return U8_IS_VALID_LEAD3_AND_T1(prev, t); + } else { // length == 4 + return U8_IS_VALID_LEAD4_AND_T1(prev, t); + } + } +}; + +U_NAMESPACE_END + +#endif // __cplusplus + #endif diff --git a/deps/icu-small/source/common/ustr_titlecase_brkiter.cpp b/deps/icu-small/source/common/ustr_titlecase_brkiter.cpp index 63808776199cc4..89888cf336b0e9 100644 --- a/deps/icu-small/source/common/ustr_titlecase_brkiter.cpp +++ b/deps/icu-small/source/common/ustr_titlecase_brkiter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ustr_titlecase_brkiter.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -22,32 +22,177 @@ #if !UCONFIG_NO_BREAK_ITERATION #include "unicode/brkiter.h" +#include "unicode/casemap.h" +#include "unicode/chariter.h" +#include "unicode/localpointer.h" #include "unicode/ubrk.h" #include "unicode/ucasemap.h" +#include "unicode/utext.h" #include "cmemory.h" +#include "uassert.h" #include "ucase.h" -#include "ustr_imp.h" +#include "ucasemap_imp.h" -/* functions available in the common library (for unistr_case.cpp) */ +U_NAMESPACE_BEGIN -/* - * Set parameters on an empty UCaseMap, for UCaseMap-less API functions. - * Do this fast because it is called with every function call. - * Duplicate of the same function in ustrcase.cpp, to keep it inline. +/** + * Whole-string BreakIterator. + * Titlecasing only calls setText(), first(), and next(). + * We implement the rest only to satisfy the abstract interface. */ -static inline void -setTempCaseMap(UCaseMap *csm, const char *locale) { - if(csm->csp==NULL) { - csm->csp=ucase_getSingleton(); +class WholeStringBreakIterator : public BreakIterator { +public: + WholeStringBreakIterator() : BreakIterator(), length(0) {} + ~WholeStringBreakIterator() U_OVERRIDE; + UBool operator==(const BreakIterator&) const U_OVERRIDE; + BreakIterator *clone() const U_OVERRIDE; + static UClassID U_EXPORT2 getStaticClassID(); + UClassID getDynamicClassID() const U_OVERRIDE; + CharacterIterator &getText() const U_OVERRIDE; + UText *getUText(UText *fillIn, UErrorCode &errorCode) const U_OVERRIDE; + void setText(const UnicodeString &text) U_OVERRIDE; + void setText(UText *text, UErrorCode &errorCode) U_OVERRIDE; + void adoptText(CharacterIterator* it) U_OVERRIDE; + int32_t first() U_OVERRIDE; + int32_t last() U_OVERRIDE; + int32_t previous() U_OVERRIDE; + int32_t next() U_OVERRIDE; + int32_t current() const U_OVERRIDE; + int32_t following(int32_t offset) U_OVERRIDE; + int32_t preceding(int32_t offset) U_OVERRIDE; + UBool isBoundary(int32_t offset) U_OVERRIDE; + int32_t next(int32_t n) U_OVERRIDE; + BreakIterator *createBufferClone(void *stackBuffer, int32_t &BufferSize, + UErrorCode &errorCode) U_OVERRIDE; + BreakIterator &refreshInputText(UText *input, UErrorCode &errorCode) U_OVERRIDE; + +private: + int32_t length; +}; + +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(WholeStringBreakIterator) + +WholeStringBreakIterator::~WholeStringBreakIterator() {} +UBool WholeStringBreakIterator::operator==(const BreakIterator&) const { return FALSE; } +BreakIterator *WholeStringBreakIterator::clone() const { return nullptr; } + +CharacterIterator &WholeStringBreakIterator::getText() const { + U_ASSERT(FALSE); // really should not be called + // Returns a null reference. + // Otherwise we would have to define a dummy CharacterIterator, + // and either have it as a field and const_cast it to a non-const reference, + // or have it via a pointer and return a reference to that. + CharacterIterator *none = nullptr; + return *none; +} +UText *WholeStringBreakIterator::getUText(UText * /*fillIn*/, UErrorCode &errorCode) const { + if (U_SUCCESS(errorCode)) { + errorCode = U_UNSUPPORTED_ERROR; } - if(locale!=NULL && locale[0]==0) { - csm->locale[0]=0; - } else { - ustrcase_setTempCaseMapLocale(csm, locale); + return nullptr; +} + +void WholeStringBreakIterator::setText(const UnicodeString &text) { + length = text.length(); +} +void WholeStringBreakIterator::setText(UText *text, UErrorCode &errorCode) { + if (U_SUCCESS(errorCode)) { + int64_t length64 = utext_nativeLength(text); + if (length64 <= INT32_MAX) { + length = (int32_t)length64; + } else { + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; + } } } +void WholeStringBreakIterator::adoptText(CharacterIterator* it) { + U_ASSERT(FALSE); // should not be called + length = it->getLength(); + delete it; +} -/* public API functions */ +int32_t WholeStringBreakIterator::first() { return 0; } +int32_t WholeStringBreakIterator::last() { return length; } +int32_t WholeStringBreakIterator::previous() { return 0; } +int32_t WholeStringBreakIterator::next() { return length; } +int32_t WholeStringBreakIterator::current() const { return 0; } +int32_t WholeStringBreakIterator::following(int32_t /*offset*/) { return length; } +int32_t WholeStringBreakIterator::preceding(int32_t /*offset*/) { return 0; } +UBool WholeStringBreakIterator::isBoundary(int32_t /*offset*/) { return FALSE; } +int32_t WholeStringBreakIterator::next(int32_t /*n*/) { return length; } + +BreakIterator *WholeStringBreakIterator::createBufferClone( + void * /*stackBuffer*/, int32_t & /*BufferSize*/, UErrorCode &errorCode) { + if (U_SUCCESS(errorCode)) { + errorCode = U_UNSUPPORTED_ERROR; + } + return nullptr; +} +BreakIterator &WholeStringBreakIterator::refreshInputText( + UText * /*input*/, UErrorCode &errorCode) { + if (U_SUCCESS(errorCode)) { + errorCode = U_UNSUPPORTED_ERROR; + } + return *this; +} + +U_CFUNC +BreakIterator *ustrcase_getTitleBreakIterator( + const Locale *locale, const char *locID, uint32_t options, BreakIterator *iter, + LocalPointer &ownedIter, UErrorCode &errorCode) { + if (U_FAILURE(errorCode)) { return nullptr; } + options &= U_TITLECASE_ITERATOR_MASK; + if (options != 0 && iter != nullptr) { + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + return nullptr; + } + if (iter == nullptr) { + switch (options) { + case 0: + iter = BreakIterator::createWordInstance( + locale != nullptr ? *locale : Locale(locID), errorCode); + break; + case U_TITLECASE_WHOLE_STRING: + iter = new WholeStringBreakIterator(); + if (iter == nullptr) { + errorCode = U_MEMORY_ALLOCATION_ERROR; + } + break; + case U_TITLECASE_SENTENCES: + iter = BreakIterator::createSentenceInstance( + locale != nullptr ? *locale : Locale(locID), errorCode); + break; + default: + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + break; + } + ownedIter.adoptInstead(iter); + } + return iter; +} + +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, + UErrorCode &errorCode) { + LocalPointer ownedIter; + iter = ustrcase_getTitleBreakIterator(nullptr, locale, options, iter, ownedIter, errorCode); + if(iter==NULL) { + return 0; + } + UnicodeString s(srcLength<0, src, srcLength); + iter->setText(s); + return ustrcase_map( + ustrcase_getCaseLocale(locale), options, iter, + dest, destCapacity, + src, srcLength, + ustrcase_internalToTitle, edits, errorCode); +} + +U_NAMESPACE_END + +U_NAMESPACE_USE U_CAPI int32_t U_EXPORT2 u_strToTitle(UChar *dest, int32_t destCapacity, @@ -55,22 +200,20 @@ u_strToTitle(UChar *dest, int32_t destCapacity, UBreakIterator *titleIter, const char *locale, UErrorCode *pErrorCode) { - UCaseMap csm=UCASEMAP_INITIALIZER; - setTempCaseMap(&csm, locale); - if(titleIter!=NULL) { - ubrk_setText(csm.iter=titleIter, src, srcLength, pErrorCode); - } else { - csm.iter=ubrk_open(UBRK_WORD, csm.locale, src, srcLength, pErrorCode); + LocalPointer ownedIter; + BreakIterator *iter = ustrcase_getTitleBreakIterator( + nullptr, locale, 0, reinterpret_cast(titleIter), + ownedIter, *pErrorCode); + if (iter == nullptr) { + return 0; } - int32_t length=ustrcase_map( - &csm, + UnicodeString s(srcLength<0, src, srcLength); + iter->setText(s); + return ustrcase_mapWithOverlap( + ustrcase_getCaseLocale(locale), 0, iter, dest, destCapacity, src, srcLength, - ustrcase_internalToTitle, pErrorCode); - if(titleIter==NULL && csm.iter!=NULL) { - ubrk_close(csm.iter); - } - return length; + ustrcase_internalToTitle, *pErrorCode); } U_CAPI int32_t U_EXPORT2 @@ -78,16 +221,25 @@ ucasemap_toTitle(UCaseMap *csm, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode) { - if(csm->iter!=NULL) { - ubrk_setText(csm->iter, src, srcLength, pErrorCode); - } else { - csm->iter=ubrk_open(UBRK_WORD, csm->locale, src, srcLength, pErrorCode); + if (U_FAILURE(*pErrorCode)) { + return 0; + } + if (csm->iter == NULL) { + LocalPointer ownedIter; + BreakIterator *iter = ustrcase_getTitleBreakIterator( + nullptr, csm->locale, csm->options, nullptr, ownedIter, *pErrorCode); + if (iter == nullptr) { + return 0; + } + csm->iter = ownedIter.orphan(); } + UnicodeString s(srcLength<0, src, srcLength); + csm->iter->setText(s); return ustrcase_map( - csm, + csm->caseLocale, csm->options, csm->iter, dest, destCapacity, src, srcLength, - ustrcase_internalToTitle, pErrorCode); + ustrcase_internalToTitle, NULL, *pErrorCode); } #endif // !UCONFIG_NO_BREAK_ITERATION diff --git a/deps/icu-small/source/common/ustr_wcs.cpp b/deps/icu-small/source/common/ustr_wcs.cpp index 572e41290f59f8..8b6e99221ee253 100644 --- a/deps/icu-small/source/common/ustr_wcs.cpp +++ b/deps/icu-small/source/common/ustr_wcs.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ustr_wcs.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -254,7 +254,7 @@ u_strToWCS(wchar_t *dest, srcLength = u_strlen(src); } if(0 < srcLength && srcLength <= destCapacity){ - u_memcpy(dest, src, srcLength); + u_memcpy((UChar *)dest, src, srcLength); } if(pDestLength){ *pDestLength = srcLength; @@ -509,7 +509,7 @@ u_strFromWCS(UChar *dest, srcLength = u_strlen((const UChar *)src); } if(0 < srcLength && srcLength <= destCapacity){ - u_memcpy(dest, src, srcLength); + u_memcpy(dest, (const UChar *)src, srcLength); } if(pDestLength){ *pDestLength = srcLength; diff --git a/deps/icu-small/source/common/ustrcase.cpp b/deps/icu-small/source/common/ustrcase.cpp index be5c988bd10804..b1beb34277896c 100644 --- a/deps/icu-small/source/common/ustrcase.cpp +++ b/deps/icu-small/source/common/ustrcase.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ustrcase.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -22,6 +22,9 @@ #include "unicode/utypes.h" #include "unicode/brkiter.h" +#include "unicode/casemap.h" +#include "unicode/edits.h" +#include "unicode/stringoptions.h" #include "unicode/ustring.h" #include "unicode/ucasemap.h" #include "unicode/ubrk.h" @@ -29,9 +32,30 @@ #include "unicode/utf16.h" #include "cmemory.h" #include "ucase.h" +#include "ucasemap_imp.h" #include "ustr_imp.h" #include "uassert.h" +U_NAMESPACE_BEGIN + +namespace { + +int32_t checkOverflowAndEditsError(int32_t destIndex, int32_t destCapacity, + Edits *edits, UErrorCode &errorCode) { + if (U_SUCCESS(errorCode)) { + if (destIndex > destCapacity) { + errorCode = U_BUFFER_OVERFLOW_ERROR; + } else if (edits != NULL) { + edits->copyErrorTo(errorCode); + } + } + return destIndex; +} + +} // namespace + +U_NAMESPACE_END + U_NAMESPACE_USE /* string casing ------------------------------------------------------------ */ @@ -39,21 +63,43 @@ U_NAMESPACE_USE /* Appends a full case mapping result, see UCASE_MAX_STRING_LENGTH. */ static inline int32_t appendResult(UChar *dest, int32_t destIndex, int32_t destCapacity, - int32_t result, const UChar *s) { + int32_t result, const UChar *s, + int32_t cpLength, uint32_t options, icu::Edits *edits) { UChar32 c; int32_t length; /* decode the result */ if(result<0) { /* (not) original code point */ + if(edits!=NULL) { + edits->addUnchanged(cpLength); + } + if(options & U_OMIT_UNCHANGED_TEXT) { + return destIndex; + } c=~result; - length=U16_LENGTH(c); - } else if(result<=UCASE_MAX_STRING_LENGTH) { - c=U_SENTINEL; - length=result; + if(destIndexaddReplace(cpLength, 1); + } + return destIndex; + } else { + c=result; + length=U16_LENGTH(c); + } + if(edits!=NULL) { + edits->addReplace(cpLength, length); + } } if(length>(INT32_MAX-destIndex)) { return -1; // integer overflow @@ -99,9 +145,15 @@ appendUChar(UChar *dest, int32_t destIndex, int32_t destCapacity, UChar c) { } static inline int32_t -appendString(UChar *dest, int32_t destIndex, int32_t destCapacity, - const UChar *s, int32_t length) { +appendUnchanged(UChar *dest, int32_t destIndex, int32_t destCapacity, + const UChar *s, int32_t length, uint32_t options, icu::Edits *edits) { if(length>0) { + if(edits!=NULL) { + edits->addUnchanged(length); + } + if(options & U_OMIT_UNCHANGED_TEXT) { + return destIndex; + } if(length>(INT32_MAX-destIndex)) { return -1; // integer overflow } @@ -150,123 +202,101 @@ utf16_caseContextIterator(void *context, int8_t dir) { * context [0..srcLength[ into account. */ static int32_t -_caseMap(const UCaseMap *csm, UCaseMapFull *map, +_caseMap(int32_t caseLocale, uint32_t options, UCaseMapFull *map, UChar *dest, int32_t destCapacity, const UChar *src, UCaseContext *csc, int32_t srcStart, int32_t srcLimit, - UErrorCode *pErrorCode) { - const UChar *s; - UChar32 c, c2 = 0; - int32_t srcIndex, destIndex; - int32_t locCache; - - locCache=csm->locCache; - + icu::Edits *edits, + UErrorCode &errorCode) { /* case mapping loop */ - srcIndex=srcStart; - destIndex=0; + int32_t srcIndex=srcStart; + int32_t destIndex=0; while(srcIndexcpStart=srcIndex; + int32_t cpStart; + csc->cpStart=cpStart=srcIndex; + UChar32 c; U16_NEXT(src, srcIndex, srcLimit, c); csc->cpLimit=srcIndex; - c=map(csm->csp, c, utf16_caseContextIterator, csc, &s, csm->locale, &locCache); - if((destIndexdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } return destIndex; } #if !UCONFIG_NO_BREAK_ITERATION U_CFUNC int32_t U_CALLCONV -ustrcase_internalToTitle(const UCaseMap *csm, +ustrcase_internalToTitle(int32_t caseLocale, uint32_t options, BreakIterator *iter, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode) { - const UChar *s; - UChar32 c; - int32_t prev, titleStart, titleLimit, idx, destIndex; - UBool isFirstIndex; - - if(U_FAILURE(*pErrorCode)) { + icu::Edits *edits, + UErrorCode &errorCode) { + if (!ustrcase_checkTitleAdjustmentOptions(options, errorCode)) { return 0; } - // Use the C++ abstract base class to minimize dependencies. - // TODO: Change UCaseMap.iter to store a BreakIterator directly. - BreakIterator *bi=reinterpret_cast(csm->iter); - /* set up local variables */ - int32_t locCache=csm->locCache; UCaseContext csc=UCASECONTEXT_INITIALIZER; csc.p=(void *)src; csc.limit=srcLength; - destIndex=0; - prev=0; - isFirstIndex=TRUE; + int32_t destIndex=0; + int32_t prev=0; + UBool isFirstIndex=TRUE; /* titlecasing loop */ while(prevfirst(); + index=iter->first(); } else { - idx=bi->next(); + index=iter->next(); } - if(idx==UBRK_DONE || idx>srcLength) { - idx=srcLength; + if(index==UBRK_DONE || index>srcLength) { + index=srcLength; } /* - * Unicode 4 & 5 section 3.13 Default Case Operations: - * - * R3 toTitlecase(X): Find the word boundaries based on Unicode Standard Annex - * #29, "Text Boundaries." Between each pair of word boundaries, find the first - * cased character F. If F exists, map F to default_title(F); then map each - * subsequent character C to default_lower(C). - * - * In this implementation, segment [prev..index[ into 3 parts: - * a) uncased characters (copy as-is) [prev..titleStart[ - * b) first case letter (titlecase) [titleStart..titleLimit[ + * Segment [prev..index[ into 3 parts: + * a) skipped characters (copy as-is) [prev..titleStart[ + * b) first letter (titlecase) [titleStart..titleLimit[ * c) subsequent characters (lowercase) [titleLimit..index[ */ - if(prevoptions&U_TITLECASE_NO_BREAK_ADJUSTMENT)==0 && UCASE_NONE==ucase_getType(csm->csp, c)) { - /* Adjust the titlecasing index (titleStart) to the next cased character. */ - for(;;) { + if(prevcsp, c)) { - break; /* cased letter at [titleStart..titleLimit[ */ - } + U16_NEXT(src, titleLimit, index, c); } - destIndex=appendString(dest, destIndex, destCapacity, src+prev, titleStart-prev); - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; + if (prev < titleStart) { + destIndex=appendUnchanged(dest, destIndex, destCapacity, + src+prev, titleStart-prev, options, edits); + if(destIndex<0) { + errorCode=U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } } } @@ -274,48 +304,64 @@ ustrcase_internalToTitle(const UCaseMap *csm, /* titlecase c which is from [titleStart..titleLimit[ */ csc.cpStart=titleStart; csc.cpLimit=titleLimit; - c=ucase_toFullTitle(csm->csp, c, utf16_caseContextIterator, &csc, &s, csm->locale, &locCache); - destIndex=appendResult(dest, destIndex, destCapacity, c, s); + const UChar *s; + c=ucase_toFullTitle(c, utf16_caseContextIterator, &csc, &s, caseLocale); + destIndex=appendResult(dest, destIndex, destCapacity, c, s, + titleLimit-titleStart, options, edits); if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; + errorCode=U_INDEX_OUTOFBOUNDS_ERROR; return 0; } /* Special case Dutch IJ titlecasing */ - if (titleStart+1 < idx && - ucase_getCaseLocale(csm->locale,&locCache) == UCASE_LOC_DUTCH && - (src[titleStart] == 0x0049 || src[titleStart] == 0x0069) && - (src[titleStart+1] == 0x004A || src[titleStart+1] == 0x006A)) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x004A); - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; + if (titleStart+1 < index && + caseLocale == UCASE_LOC_DUTCH && + (src[titleStart] == 0x0049 || src[titleStart] == 0x0069)) { + if (src[titleStart+1] == 0x006A) { + destIndex=appendUChar(dest, destIndex, destCapacity, 0x004A); + if(destIndex<0) { + errorCode=U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + if(edits!=NULL) { + edits->addReplace(1, 1); + } + titleLimit++; + } else if (src[titleStart+1] == 0x004A) { + // Keep the capital J from getting lowercased. + destIndex=appendUnchanged(dest, destIndex, destCapacity, + src+titleStart+1, 1, options, edits); + if(destIndex<0) { + errorCode=U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + titleLimit++; } - titleLimit++; } /* lowercase [titleLimit..index[ */ - if(titleLimitoptions&U_TITLECASE_NO_LOWERCASE)==0) { + if(titleLimitdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } - return destIndex; + return checkOverflowAndEditsError(destIndex, destCapacity, edits, errorCode); } #endif // !UCONFIG_NO_BREAK_ITERATION @@ -791,11 +834,11 @@ uint32_t getDiacriticData(UChar32 c) { } } -UBool isFollowedByCasedLetter(const UCaseProps *csp, const UChar *s, int32_t i, int32_t length) { +UBool isFollowedByCasedLetter(const UChar *s, int32_t i, int32_t length) { while (i < length) { UChar32 c; U16_NEXT(s, i, length, c); - int32_t type = ucase_getTypeOrIgnorable(csp, c); + int32_t type = ucase_getTypeOrIgnorable(c); if ((type & UCASE_IGNORABLE) != 0) { // Case-ignorable, continue with the loop. } else if (type != UCASE_NONE) { @@ -813,11 +856,11 @@ UBool isFollowedByCasedLetter(const UCaseProps *csp, const UChar *s, int32_t i, * for each character. * TODO: Try to re-consolidate one way or another with the non-Greek function. */ -int32_t toUpper(const UCaseMap *csm, +int32_t toUpper(uint32_t options, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode) { - int32_t locCache = UCASE_LOC_GREEK; + Edits *edits, + UErrorCode &errorCode) { int32_t destIndex=0; uint32_t state = 0; for (int32_t i = 0; i < srcLength;) { @@ -825,7 +868,7 @@ int32_t toUpper(const UCaseMap *csm, UChar32 c; U16_NEXT(src, nextIndex, srcLength, c); uint32_t nextState = 0; - int32_t type = ucase_getTypeOrIgnorable(csm->csp, c); + int32_t type = ucase_getTypeOrIgnorable(c); if ((type & UCASE_IGNORABLE) != 0) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -872,7 +915,7 @@ int32_t toUpper(const UCaseMap *csm, (data & HAS_ACCENT) != 0 && numYpogegrammeni == 0 && (state & AFTER_CASED) == 0 && - !isFollowedByCasedLetter(csm->csp, src, nextIndex, srcLength)) { + !isFollowedByCasedLetter(src, nextIndex, srcLength)) { // Keep disjunctive "or" with (only) a tonos. // We use the same "word boundary" conditions as for the Final_Sigma test. if (i == nextIndex) { @@ -890,43 +933,69 @@ int32_t toUpper(const UCaseMap *csm, data &= ~HAS_EITHER_DIALYTIKA; } } - destIndex=appendUChar(dest, destIndex, destCapacity, (UChar)upper); - if (destIndex >= 0 && (data & HAS_EITHER_DIALYTIKA) != 0) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x308); // restore or add a dialytika - } - if (destIndex >= 0 && addTonos) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x301); - } - while (destIndex >= 0 && numYpogegrammeni > 0) { - destIndex=appendUChar(dest, destIndex, destCapacity, 0x399); - --numYpogegrammeni; - } - if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; - return 0; - } - } else { - const UChar *s; - UChar32 c2 = 0; - c=ucase_toFullUpper(csm->csp, c, NULL, NULL, &s, csm->locale, &locCache); - if((destIndex 0; + int32_t i2 = i + 1; + if ((data & HAS_EITHER_DIALYTIKA) != 0) { + change |= i2 >= nextIndex || src[i2] != 0x308; + ++i2; + } + if (addTonos) { + change |= i2 >= nextIndex || src[i2] != 0x301; + ++i2; + } + int32_t oldLength = nextIndex - i; + int32_t newLength = (i2 - i) + numYpogegrammeni; + change |= oldLength != newLength; + if (change) { + if (edits != NULL) { + edits->addReplace(oldLength, newLength); + } + } else { + if (edits != NULL) { + edits->addUnchanged(oldLength); + } + // Write unchanged text? + change = (options & U_OMIT_UNCHANGED_TEXT) == 0; + } + } + + if (change) { + destIndex=appendUChar(dest, destIndex, destCapacity, (UChar)upper); + if (destIndex >= 0 && (data & HAS_EITHER_DIALYTIKA) != 0) { + destIndex=appendUChar(dest, destIndex, destCapacity, 0x308); // restore or add a dialytika + } + if (destIndex >= 0 && addTonos) { + destIndex=appendUChar(dest, destIndex, destCapacity, 0x301); + } + while (destIndex >= 0 && numYpogegrammeni > 0) { + destIndex=appendUChar(dest, destIndex, destCapacity, 0x399); + --numYpogegrammeni; + } if(destIndex<0) { - *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; + errorCode=U_INDEX_OUTOFBOUNDS_ERROR; return 0; } } + } else { + const UChar *s; + c=ucase_toFullUpper(c, NULL, NULL, &s, UCASE_LOC_GREEK); + destIndex = appendResult(dest, destIndex, destCapacity, c, s, + nextIndex - i, options, edits); + if (destIndex < 0) { + errorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } } i = nextIndex; state = nextState; } - if(destIndex>destCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } return destIndex; } @@ -936,94 +1005,128 @@ U_NAMESPACE_END /* functions available in the common library (for unistr_case.cpp) */ U_CFUNC int32_t U_CALLCONV -ustrcase_internalToLower(const UCaseMap *csm, +ustrcase_internalToLower(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode) { + icu::Edits *edits, + UErrorCode &errorCode) { UCaseContext csc=UCASECONTEXT_INITIALIZER; csc.p=(void *)src; csc.limit=srcLength; - return _caseMap( - csm, ucase_toFullLower, + int32_t destIndex = _caseMap( + caseLocale, options, ucase_toFullLower, dest, destCapacity, src, &csc, 0, srcLength, - pErrorCode); + edits, errorCode); + return checkOverflowAndEditsError(destIndex, destCapacity, edits, errorCode); } U_CFUNC int32_t U_CALLCONV -ustrcase_internalToUpper(const UCaseMap *csm, +ustrcase_internalToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode) { - int32_t locCache = csm->locCache; - if (ucase_getCaseLocale(csm->locale, &locCache) == UCASE_LOC_GREEK) { - return GreekUpper::toUpper(csm, dest, destCapacity, src, srcLength, pErrorCode); + icu::Edits *edits, + UErrorCode &errorCode) { + int32_t destIndex; + if (caseLocale == UCASE_LOC_GREEK) { + destIndex = GreekUpper::toUpper(options, dest, destCapacity, + src, srcLength, edits, errorCode); + } else { + UCaseContext csc=UCASECONTEXT_INITIALIZER; + csc.p=(void *)src; + csc.limit=srcLength; + destIndex = _caseMap( + caseLocale, options, ucase_toFullUpper, + dest, destCapacity, + src, &csc, 0, srcLength, + edits, errorCode); } - UCaseContext csc=UCASECONTEXT_INITIALIZER; - csc.p=(void *)src; - csc.limit=srcLength; - return _caseMap( - csm, ucase_toFullUpper, - dest, destCapacity, - src, &csc, 0, srcLength, - pErrorCode); + return checkOverflowAndEditsError(destIndex, destCapacity, edits, errorCode); } -static int32_t -ustr_foldCase(const UCaseProps *csp, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - uint32_t options, - UErrorCode *pErrorCode) { - int32_t srcIndex, destIndex; - - const UChar *s; - UChar32 c, c2 = 0; - +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, + icu::Edits *edits, + UErrorCode &errorCode) { /* case mapping loop */ - srcIndex=destIndex=0; - while(srcIndexdestCapacity) { - *pErrorCode=U_BUFFER_OVERFLOW_ERROR; - } - return destIndex; -} - -U_CFUNC int32_t U_CALLCONV -ustrcase_internalFold(const UCaseMap *csm, - UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - UErrorCode *pErrorCode) { - return ustr_foldCase(csm->csp, dest, destCapacity, src, srcLength, csm->options, pErrorCode); + return checkOverflowAndEditsError(destIndex, destCapacity, edits, errorCode); } U_CFUNC int32_t -ustrcase_map(const UCaseMap *csm, +ustrcase_map(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UStringCaseMapper *stringCaseMapper, - UErrorCode *pErrorCode) { + icu::Edits *edits, + UErrorCode &errorCode) { + int32_t destLength; + + /* check argument values */ + if(U_FAILURE(errorCode)) { + return 0; + } + if( destCapacity<0 || + (dest==NULL && destCapacity>0) || + src==NULL || + srcLength<-1 + ) { + errorCode=U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + + /* get the string length */ + if(srcLength==-1) { + srcLength=u_strlen(src); + } + + /* check for overlapping source and destination */ + if( dest!=NULL && + ((src>=dest && src<(dest+destCapacity)) || + (dest>=src && dest<(src+srcLength))) + ) { + errorCode=U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + + if (edits != nullptr && (options & U_EDITS_NO_RESET) == 0) { + edits->reset(); + } + destLength=stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR + dest, destCapacity, src, srcLength, edits, errorCode); + return u_terminateUChars(dest, destCapacity, destLength, &errorCode); +} + +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, + UStringCaseMapper *stringCaseMapper, + UErrorCode &errorCode) { UChar buffer[300]; UChar *temp; int32_t destLength; /* check argument values */ - if(U_FAILURE(*pErrorCode)) { + if(U_FAILURE(errorCode)) { return 0; } if( destCapacity<0 || @@ -1031,7 +1134,7 @@ ustrcase_map(const UCaseMap *csm, src==NULL || srcLength<-1 ) { - *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; + errorCode=U_ILLEGAL_ARGUMENT_ERROR; return 0; } @@ -1053,7 +1156,7 @@ ustrcase_map(const UCaseMap *csm, /* allocate a buffer */ temp=(UChar *)uprv_malloc(destCapacity*U_SIZEOF_UCHAR); if(temp==NULL) { - *pErrorCode=U_MEMORY_ALLOCATION_ERROR; + errorCode=U_MEMORY_ALLOCATION_ERROR; return 0; } } @@ -1061,21 +1164,19 @@ ustrcase_map(const UCaseMap *csm, temp=dest; } - destLength=stringCaseMapper(csm, temp, destCapacity, src, srcLength, pErrorCode); + destLength=stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR + temp, destCapacity, src, srcLength, NULL, errorCode); if(temp!=dest) { /* copy the result string to the destination buffer */ - if(destLength>0) { - int32_t copyLength= destLength<=destCapacity ? destLength : destCapacity; - if(copyLength>0) { - u_memmove(dest, temp, copyLength); - } + if (U_SUCCESS(errorCode) && 0 < destLength && destLength <= destCapacity) { + u_memmove(dest, temp, destLength); } if(temp!=buffer) { uprv_free(temp); } } - return u_terminateUChars(dest, destCapacity, destLength, pErrorCode); + return u_terminateUChars(dest, destCapacity, destLength, &errorCode); } /* public API functions */ @@ -1085,16 +1186,29 @@ u_strFoldCase(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, uint32_t options, UErrorCode *pErrorCode) { - UCaseMap csm=UCASEMAP_INITIALIZER; - csm.csp=ucase_getSingleton(); - csm.options=options; + return ustrcase_mapWithOverlap( + UCASE_LOC_ROOT, options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ustrcase_internalFold, *pErrorCode); +} + +U_NAMESPACE_BEGIN + +int32_t CaseMap::fold( + uint32_t options, + const UChar *src, int32_t srcLength, + UChar *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode) { return ustrcase_map( - &csm, + UCASE_LOC_ROOT, options, UCASEMAP_BREAK_ITERATOR_NULL dest, destCapacity, src, srcLength, - ustrcase_internalFold, pErrorCode); + ustrcase_internalFold, edits, errorCode); } +U_NAMESPACE_END + /* case-insensitive string comparisons -------------------------------------- */ /* @@ -1134,8 +1248,6 @@ static int32_t _cmpFold( UErrorCode *pErrorCode) { int32_t cmpRes = 0; - const UCaseProps *csp; - /* current-level start/limit - s1/s2 as current */ const UChar *start1, *start2, *limit1, *limit2; @@ -1167,7 +1279,6 @@ static int32_t _cmpFold( * assume that at least the option U_COMPARE_IGNORE_CASE is set * otherwise this function would have to behave exactly as uprv_strCompare() */ - csp=ucase_getSingleton(); if(U_FAILURE(*pErrorCode)) { return 0; } @@ -1349,7 +1460,7 @@ static int32_t _cmpFold( */ if( level1==0 && - (length=ucase_toFullFolding(csp, (UChar32)cp1, &p, options))>=0 + (length=ucase_toFullFolding((UChar32)cp1, &p, options))>=0 ) { /* cp1 case-folds to the code point "length" or to p[length] */ if(U_IS_SURROGATE(c1)) { @@ -1395,7 +1506,7 @@ static int32_t _cmpFold( } if( level2==0 && - (length=ucase_toFullFolding(csp, (UChar32)cp2, &p, options))>=0 + (length=ucase_toFullFolding((UChar32)cp2, &p, options))>=0 ) { /* cp2 case-folds to the code point "length" or to p[length] */ if(U_IS_SURROGATE(c2)) { diff --git a/deps/icu-small/source/common/ustrcase_locale.cpp b/deps/icu-small/source/common/ustrcase_locale.cpp index 78f4bbd7a2fe7f..2ecd24f03ec02e 100644 --- a/deps/icu-small/source/common/ustrcase_locale.cpp +++ b/deps/icu-small/source/common/ustrcase_locale.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ustrcase_locale.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -18,66 +18,24 @@ */ #include "unicode/utypes.h" +#include "uassert.h" +#include "unicode/brkiter.h" +#include "unicode/casemap.h" #include "unicode/ucasemap.h" #include "unicode/uloc.h" #include "unicode/ustring.h" #include "ucase.h" -#include "ustr_imp.h" +#include "ucasemap_imp.h" -U_CFUNC void -ustrcase_setTempCaseMapLocale(UCaseMap *csm, const char *locale) { - /* - * We could call ucasemap_setLocale(), but here we really only care about - * the initial language subtag, we need not return the real string via - * ucasemap_getLocale(), and we don't care about only getting "x" from - * "x-some-thing" etc. - * - * We ignore locales with a longer-than-3 initial subtag. - * - * We also do not fill in the locCache because it is rarely used, - * and not worth setting unless we reuse it for many case mapping operations. - * (That's why UCaseMap was created.) - */ - int i; - char c; - - /* the internal functions require locale!=NULL */ - if(locale==NULL) { - // Do not call uprv_getDefaultLocaleID() because that does not see - // changes to the default locale via uloc_setDefault(). - // It would also be inefficient if used frequently because uprv_getDefaultLocaleID() - // does not cache the locale ID. - // - // Unfortunately, uloc_getDefault() has many dependencies. - // We only care about a small set of language subtags, - // and we do not need the locale ID to be canonicalized. - // - // Best is to not call case mapping functions with a NULL locale ID. - locale=uloc_getDefault(); - } - for(i=0; i<4 && (c=locale[i])!=0 && c!='-' && c!='_'; ++i) { - csm->locale[i]=c; - } - if(i<=3) { - csm->locale[i]=0; /* Up to 3 non-separator characters. */ - } else { - csm->locale[0]=0; /* Longer-than-3 initial subtag: Ignore. */ - } -} - -/* - * Set parameters on an empty UCaseMap, for UCaseMap-less API functions. - * Do this fast because it is called with every function call. - */ -static inline void -setTempCaseMap(UCaseMap *csm, const char *locale) { - if(csm->csp==NULL) { - csm->csp=ucase_getSingleton(); +U_CFUNC int32_t +ustrcase_getCaseLocale(const char *locale) { + if (locale == NULL) { + locale = uloc_getDefault(); } - if(locale!=NULL && locale[0]==0) { - csm->locale[0]=0; + if (*locale == 0) { + return UCASE_LOC_ROOT; } else { - ustrcase_setTempCaseMapLocale(csm, locale); + return ucase_getCaseLocale(locale); } } @@ -88,13 +46,11 @@ u_strToLower(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode) { - UCaseMap csm=UCASEMAP_INITIALIZER; - setTempCaseMap(&csm, locale); - return ustrcase_map( - &csm, + return ustrcase_mapWithOverlap( + ustrcase_getCaseLocale(locale), 0, UCASEMAP_BREAK_ITERATOR_NULL dest, destCapacity, src, srcLength, - ustrcase_internalToLower, pErrorCode); + ustrcase_internalToLower, *pErrorCode); } U_CAPI int32_t U_EXPORT2 @@ -102,11 +58,37 @@ u_strToUpper(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode) { - UCaseMap csm=UCASEMAP_INITIALIZER; - setTempCaseMap(&csm, locale); + return ustrcase_mapWithOverlap( + ustrcase_getCaseLocale(locale), 0, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ustrcase_internalToUpper, *pErrorCode); +} + +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, + UErrorCode &errorCode) { + return ustrcase_map( + ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL + dest, destCapacity, + src, srcLength, + ustrcase_internalToLower, edits, errorCode); +} + +int32_t CaseMap::toUpper( + const char *locale, uint32_t options, + const UChar *src, int32_t srcLength, + UChar *dest, int32_t destCapacity, Edits *edits, + UErrorCode &errorCode) { return ustrcase_map( - &csm, + ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL dest, destCapacity, src, srcLength, - ustrcase_internalToUpper, pErrorCode); + ustrcase_internalToUpper, edits, errorCode); } + +U_NAMESPACE_END diff --git a/deps/icu-small/source/common/ustrenum.cpp b/deps/icu-small/source/common/ustrenum.cpp index 699ce32cfef242..8be79c98999256 100644 --- a/deps/icu-small/source/common/ustrenum.cpp +++ b/deps/icu-small/source/common/ustrenum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ustrenum.h b/deps/icu-small/source/common/ustrenum.h index 868fddcb53527d..582727cd1f742b 100644 --- a/deps/icu-small/source/common/ustrenum.h +++ b/deps/icu-small/source/common/ustrenum.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ustrfmt.c b/deps/icu-small/source/common/ustrfmt.cpp similarity index 96% rename from deps/icu-small/source/common/ustrfmt.c rename to deps/icu-small/source/common/ustrfmt.cpp index c7805d8d2a3062..1a9b15a59febce 100644 --- a/deps/icu-small/source/common/ustrfmt.c +++ b/deps/icu-small/source/common/ustrfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ustrfmt.h b/deps/icu-small/source/common/ustrfmt.h index 3cc3d69add5e05..53eb0557e45a18 100644 --- a/deps/icu-small/source/common/ustrfmt.h +++ b/deps/icu-small/source/common/ustrfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/ustring.cpp b/deps/icu-small/source/common/ustring.cpp index 8361fe37077fbd..a1a51f4b1e1734 100644 --- a/deps/icu-small/source/common/ustring.cpp +++ b/deps/icu-small/source/common/ustring.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -19,6 +19,7 @@ #include "unicode/utypes.h" #include "unicode/putil.h" +#include "unicode/uchar.h" #include "unicode/ustring.h" #include "unicode/utf16.h" #include "cstring.h" diff --git a/deps/icu-small/source/common/ustrtrns.cpp b/deps/icu-small/source/common/ustrtrns.cpp index b61d771fafcdc2..583ec63c323aee 100644 --- a/deps/icu-small/source/common/ustrtrns.cpp +++ b/deps/icu-small/source/common/ustrtrns.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -256,152 +256,6 @@ u_strToUTF32(UChar32 *dest, pErrorCode); } -/* for utf8_nextCharSafeBodyTerminated() */ -static const UChar32 -utf8_minLegal[4]={ 0, 0x80, 0x800, 0x10000 }; - -/* - * Version of utf8_nextCharSafeBody() with the following differences: - * - checks for NUL termination instead of length - * - works with pointers instead of indexes - * - always strict (strict==-1) - * - * *ps points to after the lead byte and will be moved to after the last trail byte. - * c is the lead byte. - * @return the code point, or U_SENTINEL - */ -static UChar32 -utf8_nextCharSafeBodyTerminated(const uint8_t **ps, UChar32 c) { - const uint8_t *s=*ps; - uint8_t trail, illegal=0; - uint8_t count=U8_COUNT_TRAIL_BYTES(c); - U_ASSERT(count<6); - U8_MASK_LEAD_BYTE((c), count); - /* count==0 for illegally leading trail bytes and the illegal bytes 0xfe and 0xff */ - switch(count) { - /* each branch falls through to the next one */ - case 5: - case 4: - /* count>=4 is always illegal: no more than 3 trail bytes in Unicode's UTF-8 */ - illegal=1; - break; - case 3: - trail=(uint8_t)(*s++ - 0x80); - c=(c<<6)|trail; - if(trail>0x3f || c>=0x110) { - /* not a trail byte, or code point>0x10ffff (outside Unicode) */ - illegal=1; - break; - } - U_FALLTHROUGH; - case 2: - trail=(uint8_t)(*s++ - 0x80); - if(trail>0x3f) { - /* not a trail byte */ - illegal=1; - break; - } - c=(c<<6)|trail; - U_FALLTHROUGH; - case 1: - trail=(uint8_t)(*s++ - 0x80); - if(trail>0x3f) { - /* not a trail byte */ - illegal=1; - } - c=(c<<6)|trail; - break; - case 0: - return U_SENTINEL; - /* no default branch to optimize switch() - all values are covered */ - } - - /* correct sequence - all trail bytes have (b7..b6)==(10)? */ - /* illegal is also set if count>=4 */ - if(illegal || c0 && U8_IS_TRAIL(*s)) { - ++s; - --count; - } - c=U_SENTINEL; - } - *ps=s; - return c; -} - -/* - * Version of utf8_nextCharSafeBody() with the following differences: - * - works with pointers instead of indexes - * - always strict (strict==-1) - * - * *ps points to after the lead byte and will be moved to after the last trail byte. - * c is the lead byte. - * @return the code point, or U_SENTINEL - */ -static UChar32 -utf8_nextCharSafeBodyPointer(const uint8_t **ps, const uint8_t *limit, UChar32 c) { - const uint8_t *s=*ps; - uint8_t trail, illegal=0; - uint8_t count=U8_COUNT_TRAIL_BYTES(c); - if((limit-s)>=count) { - U8_MASK_LEAD_BYTE((c), count); - /* count==0 for illegally leading trail bytes and the illegal bytes 0xfe and 0xff */ - switch(count) { - /* each branch falls through to the next one */ - case 5: - case 4: - /* count>=4 is always illegal: no more than 3 trail bytes in Unicode's UTF-8 */ - illegal=1; - break; - case 3: - trail=*s++; - c=(c<<6)|(trail&0x3f); - if(c<0x110) { - illegal|=(trail&0xc0)^0x80; - } else { - /* code point>0x10ffff, outside Unicode */ - illegal=1; - break; - } - U_FALLTHROUGH; - case 2: - trail=*s++; - c=(c<<6)|(trail&0x3f); - illegal|=(trail&0xc0)^0x80; - U_FALLTHROUGH; - case 1: - trail=*s++; - c=(c<<6)|(trail&0x3f); - illegal|=(trail&0xc0)^0x80; - break; - case 0: - return U_SENTINEL; - /* no default branch to optimize switch() - all values are covered */ - } - } else { - illegal=1; /* too few bytes left */ - } - - /* correct sequence - all trail bytes have (b7..b6)==(10)? */ - /* illegal is also set if count>=4 */ - U_ASSERT(illegal || count0 && s 0) || subchar > 0x10ffff || U_IS_SURROGATE(subchar) @@ -434,7 +279,10 @@ u_strFromUTF8WithSub(UChar *dest, if(pNumSubstitutions!=NULL) { *pNumSubstitutions=0; } - numSubstitutions=0; + UChar *pDest = dest; + UChar *pDestLimit = dest+destCapacity; + int32_t reqLength = 0; + int32_t numSubstitutions=0; /* * Inline processing of UTF-8 byte sequences: @@ -455,95 +303,81 @@ u_strFromUTF8WithSub(UChar *dest, * The code explicitly checks for NULs only in the lead byte position. * A NUL byte in the trail byte position fails the trail byte range check anyway. */ - while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) { - if(ch <= 0x7f){ - *pDest++=(UChar)ch; - ++pSrc; + int32_t i; + UChar32 c; + for(i = 0; (c = (uint8_t)src[i]) != 0 && (pDest < pDestLimit);) { + // modified copy of U8_NEXT() + ++i; + if(U8_IS_SINGLE(c)) { + *pDest++=(UChar)c; } else { - if(ch > 0xe0) { - if( /* handle U+1000..U+CFFF inline */ - ch <= 0xec && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f && - (t2 = (uint8_t)(pSrc[2] - 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); - pSrc += 3; - continue; - } - } else if(ch < 0xe0) { - if( /* handle U+0080..U+07FF inline */ - ch >= 0xc2 && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f - ) { - *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1); - pSrc += 2; - continue; - } - } - - /* function call for "complicated" and error cases */ - ++pSrc; /* continue after the lead byte */ - ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch); - if(ch<0 && (++numSubstitutions, ch = subchar) < 0) { - *pErrorCode = U_INVALID_CHAR_FOUND; - return NULL; - } else if(ch<=0xFFFF) { - *(pDest++)=(UChar)ch; + uint8_t __t1, __t2; + if( /* handle U+0800..U+FFFF inline */ + (0xe0<=(c) && (c)<0xf0) && + U8_IS_VALID_LEAD3_AND_T1((c), src[i]) && + (__t2=src[(i)+1]-0x80)<=0x3f) { + *pDest++ = (((c)&0xf)<<12)|((src[i]&0x3f)<<6)|__t2; + i+=2; + } else if( /* handle U+0080..U+07FF inline */ + ((c)<0xe0 && (c)>=0xc2) && + (__t1=src[i]-0x80)<=0x3f) { + *pDest++ = (((c)&0x1f)<<6)|__t1; + ++(i); } else { - *(pDest++)=U16_LEAD(ch); - if(pDest 0xe0) { - if( /* handle U+1000..U+CFFF inline */ - ch <= 0xec && - (uint8_t)(pSrc[1] - 0x80) <= 0x3f && - (uint8_t)(pSrc[2] - 0x80) <= 0x3f - ) { - ++reqLength; - pSrc += 3; - continue; - } - } else if(ch < 0xe0) { - if( /* handle U+0080..U+07FF inline */ - ch >= 0xc2 && - (uint8_t)(pSrc[1] - 0x80) <= 0x3f - ) { - ++reqLength; - pSrc += 2; - continue; + uint8_t __t1, __t2; + if( /* handle U+0800..U+FFFF inline */ + (0xe0<=(c) && (c)<0xf0) && + U8_IS_VALID_LEAD3_AND_T1((c), src[i]) && + (__t2=src[(i)+1]-0x80)<=0x3f) { + ++reqLength; + i+=2; + } else if( /* handle U+0080..U+07FF inline */ + ((c)<0xe0 && (c)>=0xc2) && + (__t1=src[i]-0x80)<=0x3f) { + ++reqLength; + ++(i); + } else { + /* function call for "complicated" and error cases */ + (c)=utf8_nextCharSafeBody((const uint8_t *)src, &(i), -1, c, -1); + if(c<0 && (++numSubstitutions, c = subchar) < 0) { + *pErrorCode = U_INVALID_CHAR_FOUND; + return NULL; } + reqLength += U16_LENGTH(c); } - - /* function call for "complicated" and error cases */ - ++pSrc; /* continue after the lead byte */ - ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch); - if(ch<0 && (++numSubstitutions, ch = subchar) < 0) { - *pErrorCode = U_INVALID_CHAR_FOUND; - return NULL; - } - reqLength += U16_LENGTH(ch); } } } else /* srcLength >= 0 */ { - const uint8_t *pSrcLimit = pSrc + srcLength; - int32_t count; - - /* Faster loop without ongoing checking for pSrcLimit and pDestLimit. */ + /* Faster loop without ongoing checking for srcLength and pDestLimit. */ + int32_t i = 0; + UChar32 c; for(;;) { /* * Each iteration of the inner loop progresses by at most 3 UTF-8 @@ -551,10 +385,10 @@ u_strFromUTF8WithSub(UChar *dest, * For supplementary code points (4 & 2), which are rare, * there is an additional adjustment. */ - count = (int32_t)(pDestLimit - pDest); - srcLength = (int32_t)((pSrcLimit - pSrc) / 3); - if(count > srcLength) { - count = srcLength; /* min(remaining dest, remaining src/3) */ + int32_t count = (int32_t)(pDestLimit - pDest); + int32_t count2 = (srcLength - i) / 3; + if(count > count2) { + count = count2; /* min(remaining dest, remaining src/3) */ } if(count < 3) { /* @@ -565,147 +399,123 @@ u_strFromUTF8WithSub(UChar *dest, } do { - ch = *pSrc; - if(ch <= 0x7f){ - *pDest++=(UChar)ch; - ++pSrc; + // modified copy of U8_NEXT() + c = (uint8_t)src[i++]; + if(U8_IS_SINGLE(c)) { + *pDest++=(UChar)c; } else { - if(ch > 0xe0) { - if( /* handle U+1000..U+CFFF inline */ - ch <= 0xec && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f && - (t2 = (uint8_t)(pSrc[2] - 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); - pSrc += 3; - continue; - } - } else if(ch < 0xe0) { - if( /* handle U+0080..U+07FF inline */ - ch >= 0xc2 && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f - ) { - *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1); - pSrc += 2; - continue; + uint8_t __t1, __t2; + if( /* handle U+0800..U+FFFF inline */ + (0xe0<=(c) && (c)<0xf0) && + ((i)+1)=0xc2) && + ((i)!=srcLength) && + (__t1=src[i]-0x80)<=0x3f) { + *pDest++ = (((c)&0x1f)<<6)|__t1; + ++(i); + } else { + if(c >= 0xf0 || subchar > 0xffff) { + // We may read up to four bytes and write up to two UChars, + // which we didn't account for with computing count, + // so we adjust it here. + if(--count == 0) { + --i; // back out byte c + break; + } } - } - if(ch >= 0xf0 || subchar > 0xffff) { - /* - * We may read up to six bytes and write up to two UChars, - * which we didn't account for with computing count, - * so we adjust it here. - */ - if(--count == 0) { - break; + /* function call for "complicated" and error cases */ + (c)=utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, c, -1); + if(c<0 && (++numSubstitutions, c = subchar) < 0) { + *pErrorCode = U_INVALID_CHAR_FOUND; + return NULL; + } else if(c<=0xFFFF) { + *(pDest++)=(UChar)c; + } else { + *(pDest++)=U16_LEAD(c); + *(pDest++)=U16_TRAIL(c); } } - - /* function call for "complicated" and error cases */ - ++pSrc; /* continue after the lead byte */ - ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch); - if(ch<0 && (++numSubstitutions, ch = subchar) < 0){ - *pErrorCode = U_INVALID_CHAR_FOUND; - return NULL; - }else if(ch<=0xFFFF){ - *(pDest++)=(UChar)ch; - }else{ - *(pDest++)=U16_LEAD(ch); - *(pDest++)=U16_TRAIL(ch); - } } } while(--count > 0); } - while((pSrc 0xe0) { - if( /* handle U+1000..U+CFFF inline */ - ch <= 0xec && - ((pSrcLimit - pSrc) >= 3) && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f && - (t2 = (uint8_t)(pSrc[2] - 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); - pSrc += 3; - continue; - } - } else if(ch < 0xe0) { - if( /* handle U+0080..U+07FF inline */ - ch >= 0xc2 && - ((pSrcLimit - pSrc) >= 2) && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f - ) { - *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1); - pSrc += 2; - continue; - } - } - - /* function call for "complicated" and error cases */ - ++pSrc; /* continue after the lead byte */ - ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch); - if(ch<0 && (++numSubstitutions, ch = subchar) < 0){ - *pErrorCode = U_INVALID_CHAR_FOUND; - return NULL; - }else if(ch<=0xFFFF){ - *(pDest++)=(UChar)ch; - }else{ - *(pDest++)=U16_LEAD(ch); - if(pDest=0xc2) && + ((i)!=srcLength) && + (__t1=src[i]-0x80)<=0x3f) { + *pDest++ = (((c)&0x1f)<<6)|__t1; + ++(i); + } else { + /* function call for "complicated" and error cases */ + (c)=utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, c, -1); + if(c<0 && (++numSubstitutions, c = subchar) < 0) { + *pErrorCode = U_INVALID_CHAR_FOUND; + return NULL; + } else if(c<=0xFFFF) { + *(pDest++)=(UChar)c; + } else { + *(pDest++)=U16_LEAD(c); + if(pDest 0xe0) { - if( /* handle U+1000..U+CFFF inline */ - ch <= 0xec && - ((pSrcLimit - pSrc) >= 3) && - (uint8_t)(pSrc[1] - 0x80) <= 0x3f && - (uint8_t)(pSrc[2] - 0x80) <= 0x3f - ) { - reqLength++; - pSrc += 3; - continue; - } - } else if(ch < 0xe0) { - if( /* handle U+0080..U+07FF inline */ - ch >= 0xc2 && - ((pSrcLimit - pSrc) >= 2) && - (uint8_t)(pSrc[1] - 0x80) <= 0x3f - ) { - reqLength++; - pSrc += 2; - continue; + uint8_t __t1, __t2; + if( /* handle U+0800..U+FFFF inline */ + (0xe0<=(c) && (c)<0xf0) && + ((i)+1)=0xc2) && + ((i)!=srcLength) && + (__t1=src[i]-0x80)<=0x3f) { + ++reqLength; + ++(i); + } else { + /* function call for "complicated" and error cases */ + (c)=utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, c, -1); + if(c<0 && (++numSubstitutions, c = subchar) < 0) { + *pErrorCode = U_INVALID_CHAR_FOUND; + return NULL; } + reqLength += U16_LENGTH(c); } - - /* function call for "complicated" and error cases */ - ++pSrc; /* continue after the lead byte */ - ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch); - if(ch<0 && (++numSubstitutions, ch = subchar) < 0){ - *pErrorCode = U_INVALID_CHAR_FOUND; - return NULL; - } - reqLength+=U16_LENGTH(ch); } } } @@ -753,7 +563,7 @@ u_strFromUTF8Lenient(UChar *dest, uint8_t* pSrc = (uint8_t*) src; /* args check */ - if(pErrorCode==NULL || U_FAILURE(*pErrorCode)){ + if(U_FAILURE(*pErrorCode)){ return NULL; } @@ -994,7 +804,7 @@ u_strToUTF8WithSub(char *dest, int32_t numSubstitutions; /* args check */ - if(pErrorCode==NULL || U_FAILURE(*pErrorCode)){ + if(U_FAILURE(*pErrorCode)){ return NULL; } @@ -1266,18 +1076,8 @@ u_strFromJavaModifiedUTF8WithSub( int32_t srcLength, UChar32 subchar, int32_t *pNumSubstitutions, UErrorCode *pErrorCode) { - UChar *pDest = dest; - UChar *pDestLimit = dest+destCapacity; - UChar32 ch; - int32_t reqLength = 0; - const uint8_t* pSrc = (const uint8_t*) src; - const uint8_t *pSrcLimit; - int32_t count; - uint8_t t1, t2; /* trail bytes */ - int32_t numSubstitutions; - /* args check */ - if(U_FAILURE(*pErrorCode)){ + if(U_FAILURE(*pErrorCode)) { return NULL; } if( (src==NULL && srcLength!=0) || srcLength < -1 || @@ -1291,18 +1091,22 @@ u_strFromJavaModifiedUTF8WithSub( if(pNumSubstitutions!=NULL) { *pNumSubstitutions=0; } - numSubstitutions=0; + UChar *pDest = dest; + UChar *pDestLimit = dest+destCapacity; + int32_t reqLength = 0; + int32_t numSubstitutions=0; if(srcLength < 0) { /* * Transform a NUL-terminated ASCII string. * Handle non-ASCII strings with slower code. */ - while(((ch = *pSrc) != 0) && ch <= 0x7f && (pDest < pDestLimit)) { - *pDest++=(UChar)ch; - ++pSrc; + UChar32 c; + while(((c = (uint8_t)*src) != 0) && c <= 0x7f && (pDest < pDestLimit)) { + *pDest++=(UChar)c; + ++src; } - if(ch == 0) { + if(c == 0) { reqLength=(int32_t)(pDest - dest); if(pDestLength) { *pDestLength = reqLength; @@ -1312,33 +1116,38 @@ u_strFromJavaModifiedUTF8WithSub( u_terminateUChars(dest, destCapacity, reqLength, pErrorCode); return dest; } - srcLength = uprv_strlen((const char *)pSrc); + srcLength = static_cast(uprv_strlen(src)); } - /* Faster loop without ongoing checking for pSrcLimit and pDestLimit. */ - pSrcLimit = (pSrc == NULL) ? NULL : pSrc + srcLength; + /* Faster loop without ongoing checking for srcLength and pDestLimit. */ + UChar32 ch; + uint8_t t1, t2; + int32_t i = 0; for(;;) { - count = (int32_t)(pDestLimit - pDest); - srcLength = (int32_t)(pSrcLimit - pSrc); - if(count >= srcLength && srcLength > 0 && *pSrc <= 0x7f) { + int32_t count = (int32_t)(pDestLimit - pDest); + int32_t count2 = srcLength - i; + if(count >= count2 && srcLength > 0 && U8_IS_SINGLE(*src)) { /* fast ASCII loop */ - const uint8_t *prevSrc = pSrc; - int32_t delta; - while(pSrc < pSrcLimit && (ch = *pSrc) <= 0x7f) { - *pDest++=(UChar)ch; - ++pSrc; + int32_t start = i; + uint8_t b; + while(i < srcLength && U8_IS_SINGLE(b = src[i])) { + *pDest++=b; + ++i; } - delta = (int32_t)(pSrc - prevSrc); + int32_t delta = i - start; count -= delta; - srcLength -= delta; + count2 -= delta; } /* * Each iteration of the inner loop progresses by at most 3 UTF-8 * bytes and one UChar. */ - srcLength /= 3; - if(count > srcLength) { - count = srcLength; /* min(remaining dest, remaining src/3) */ + if(subchar > 0xFFFF) { + break; + } + count2 /= 3; + if(count > count2) { + count = count2; /* min(remaining dest, remaining src/3) */ } if(count < 3) { /* @@ -1348,29 +1157,28 @@ u_strFromJavaModifiedUTF8WithSub( break; } do { - ch = *pSrc; - if(ch <= 0x7f){ + ch = (uint8_t)src[i++]; + if(U8_IS_SINGLE(ch)) { *pDest++=(UChar)ch; - ++pSrc; } else { if(ch >= 0xe0) { if( /* handle U+0000..U+FFFF inline */ ch <= 0xef && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f && - (t2 = (uint8_t)(pSrc[2] - 0x80)) <= 0x3f + (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); - pSrc += 3; + i += 2; continue; } } else { if( /* handle U+0000..U+07FF inline */ ch >= 0xc0 && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f + (t1 = (uint8_t)(src[i] - 0x80)) <= 0x3f ) { *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1); - pSrc += 2; + ++i; continue; } } @@ -1383,49 +1191,43 @@ u_strFromJavaModifiedUTF8WithSub( * We need to write two UChars, adjusted count for that, * and ran out of space. */ + --i; // back out byte ch break; } else { /* function call for error cases */ - ++pSrc; /* continue after the lead byte */ - utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch); + utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1); ++numSubstitutions; - if(subchar<=0xFFFF) { - *(pDest++)=(UChar)subchar; - } else { - *(pDest++)=U16_LEAD(subchar); - *(pDest++)=U16_TRAIL(subchar); - } + *(pDest++)=(UChar)subchar; } } } while(--count > 0); } - while((pSrc= 0xe0) { if( /* handle U+0000..U+FFFF inline */ ch <= 0xef && - ((pSrcLimit - pSrc) >= 3) && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f && - (t2 = (uint8_t)(pSrc[2] - 0x80)) <= 0x3f + (i+1) < srcLength && + (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); - pSrc += 3; + i += 2; continue; } } else { if( /* handle U+0000..U+07FF inline */ ch >= 0xc0 && - ((pSrcLimit - pSrc) >= 2) && - (t1 = (uint8_t)(pSrc[1] - 0x80)) <= 0x3f + i < srcLength && + (t1 = (uint8_t)(src[i] - 0x80)) <= 0x3f ) { *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1); - pSrc += 2; + ++i; continue; } } @@ -1435,8 +1237,7 @@ u_strFromJavaModifiedUTF8WithSub( return NULL; } else { /* function call for error cases */ - ++pSrc; /* continue after the lead byte */ - utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch); + utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1); ++numSubstitutions; if(subchar<=0xFFFF) { *(pDest++)=(UChar)subchar; @@ -1453,32 +1254,31 @@ u_strFromJavaModifiedUTF8WithSub( } } - /* do not fill the dest buffer just count the UChars needed */ - while(pSrc < pSrcLimit){ - ch = *pSrc; - if(ch <= 0x7f) { + /* Pre-flight the rest of the string. */ + while(i < srcLength) { + ch = (uint8_t)src[i++]; + if(U8_IS_SINGLE(ch)) { reqLength++; - ++pSrc; } else { if(ch >= 0xe0) { if( /* handle U+0000..U+FFFF inline */ ch <= 0xef && - ((pSrcLimit - pSrc) >= 3) && - (uint8_t)(pSrc[1] - 0x80) <= 0x3f && - (uint8_t)(pSrc[2] - 0x80) <= 0x3f + (i+1) < srcLength && + (uint8_t)(src[i] - 0x80) <= 0x3f && + (uint8_t)(src[i+1] - 0x80) <= 0x3f ) { reqLength++; - pSrc += 3; + i += 2; continue; } } else { if( /* handle U+0000..U+07FF inline */ ch >= 0xc0 && - ((pSrcLimit - pSrc) >= 2) && - (uint8_t)(pSrc[1] - 0x80) <= 0x3f + i < srcLength && + (uint8_t)(src[i] - 0x80) <= 0x3f ) { reqLength++; - pSrc += 2; + ++i; continue; } } @@ -1488,8 +1288,7 @@ u_strFromJavaModifiedUTF8WithSub( return NULL; } else { /* function call for error cases */ - ++pSrc; /* continue after the lead byte */ - utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch); + utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1); ++numSubstitutions; reqLength+=U16_LENGTH(ch); } diff --git a/deps/icu-small/source/common/utext.cpp b/deps/icu-small/source/common/utext.cpp index a89e7a62b56366..6f3806f27db3f0 100644 --- a/deps/icu-small/source/common/utext.cpp +++ b/deps/icu-small/source/common/utext.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utext.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -847,9 +847,11 @@ U_CDECL_END //------------------------------------------------------------------------------ // Chunk size. -// Must be less than 85, because of byte mapping from UChar indexes to native indexes. +// 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 // 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). // enum { UTF8_TEXT_CHUNK_SIZE=32 }; @@ -1032,6 +1034,7 @@ utf8TextAccess(UText *ut, int64_t index, UBool forward) { // Requested index is in this buffer. u8b = (UTF8Buf *)ut->p; // the current buffer mapIndex = ix - u8b->toUCharsMapStart; + U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars)); ut->chunkOffset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx; return TRUE; @@ -1298,6 +1301,10 @@ utf8TextAccess(UText *ut, int64_t index, UBool forward) { // Can only do this if the incoming index is somewhere in the interior of the string. // If index is at the end, there is no character there to look at. if (ix != ut->b) { + // Note: this function will only move the index back if it is on a trail byte + // and there is a preceding lead byte and the sequence from the lead + // through this trail could be part of a valid UTF-8 sequence + // Otherwise the index remains unchanged. U8_SET_CP_START(s8, 0, ix); } @@ -1311,7 +1318,10 @@ utf8TextAccess(UText *ut, int64_t index, UBool forward) { UChar *buf = u8b->buf; uint8_t *mapToNative = u8b->mapToNative; uint8_t *mapToUChars = u8b->mapToUChars; - int32_t toUCharsMapStart = ix - (UTF8_TEXT_CHUNK_SIZE*3 + 1); + int32_t toUCharsMapStart = ix - sizeof(UTF8Buf::mapToUChars) + 1; + // Note that toUCharsMapStart can be negative. Happens when the remaining + // text from current position to the beginning is less than the buffer size. + // + 1 because mapToUChars must have a slot at the end for the bufNativeLimit entry. int32_t destIx = UTF8_TEXT_CHUNK_SIZE+2; // Start in the overflow region // at end of buffer to leave room // for a surrogate pair at the @@ -1338,6 +1348,7 @@ utf8TextAccess(UText *ut, int64_t index, UBool forward) { if (c<0x80) { // Special case ASCII range for speed. buf[destIx] = (UChar)c; + U_ASSERT(toUCharsMapStart <= srcIx); mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx; mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart); } else { @@ -1367,6 +1378,7 @@ utf8TextAccess(UText *ut, int64_t index, UBool forward) { do { mapToUChars[sIx-- - toUCharsMapStart] = (uint8_t)destIx; } while (sIx >= srcIx); + U_ASSERT(toUCharsMapStart <= (srcIx+1)); // Set native indexing limit to be the current position. // We are processing a non-ascii, non-native-indexing char now; @@ -1541,6 +1553,7 @@ utf8TextMapIndexToUTF16(const UText *ut, int64_t index64) { U_ASSERT(index>=ut->chunkNativeStart+ut->nativeIndexingLimit); U_ASSERT(index<=ut->chunkNativeLimit); int32_t mapIndex = index - u8b->toUCharsMapStart; + U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars)); int32_t offset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx; U_ASSERT(offset>=0 && offset<=ut->chunkLength); return offset; @@ -2225,13 +2238,13 @@ unistrTextCopy(UText *ut, } if(move) { - // move: copy to destIndex, then replace original with nothing + // move: copy to destIndex, then remove original int32_t segLength=limit32-start32; us->copy(start32, limit32, destIndex32); if(destIndex32replace(start32, segLength, NULL, 0); + us->remove(start32, segLength); } else { // copy us->copy(start32, limit32, destIndex32); diff --git a/deps/icu-small/source/common/utf_impl.c b/deps/icu-small/source/common/utf_impl.c deleted file mode 100644 index 91cb9ba5f2935f..00000000000000 --- a/deps/icu-small/source/common/utf_impl.c +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. -// License & terms of use: http://www.unicode.org/copyright.html -/* -****************************************************************************** -* -* Copyright (C) 1999-2012, International Business Machines -* Corporation and others. All Rights Reserved. -* -****************************************************************************** -* file name: utf_impl.c -* encoding: US-ASCII -* tab size: 8 (not used) -* indentation:4 -* -* created on: 1999sep13 -* created by: Markus W. Scherer -* -* This file provides implementation functions for macros in the utfXX.h -* that would otherwise be too long as macros. -*/ - -/* set import/export definitions */ -#ifndef U_UTF8_IMPL -# define U_UTF8_IMPL -#endif - -#include "unicode/utypes.h" -#include "unicode/utf.h" -#include "unicode/utf8.h" -#include "unicode/utf_old.h" -#include "uassert.h" - -/* - * This table could be replaced on many machines by - * a few lines of assembler code using an - * "index of first 0-bit from msb" instruction and - * one or two more integer instructions. - * - * For example, on an i386, do something like - * - MOV AL, leadByte - * - NOT AL (8-bit, leave b15..b8==0..0, reverse only b7..b0) - * - MOV AH, 0 - * - BSR BX, AX (16-bit) - * - MOV AX, 6 (result) - * - JZ finish (ZF==1 if leadByte==0xff) - * - SUB AX, BX (result) - * -finish: - * (BSR: Bit Scan Reverse, scans for a 1-bit, starting from the MSB) - * - * In Unicode, all UTF-8 byte sequences with more than 4 bytes are illegal; - * lead bytes above 0xf4 are illegal. - * We keep them in this table for skipping long ISO 10646-UTF-8 sequences. - */ -U_EXPORT const uint8_t -utf8_countTrailBytes[256]={ - 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, - - 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, - - 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, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, - 3, 3, 3, /* illegal in Unicode */ - 4, 4, 4, 4, /* illegal in Unicode */ - 5, 5, /* illegal in Unicode */ - 0, 0 /* illegal bytes 0xfe and 0xff */ -}; - -static const UChar32 -utf8_minLegal[4]={ 0, 0x80, 0x800, 0x10000 }; - -static const UChar32 -utf8_errorValue[6]={ - UTF8_ERROR_VALUE_1, UTF8_ERROR_VALUE_2, UTF_ERROR_VALUE, 0x10ffff, - 0x3ffffff, 0x7fffffff -}; - -static UChar32 -errorValue(int32_t count, int8_t strict) { - if(strict>=0) { - return utf8_errorValue[count]; - } else if(strict==-3) { - return 0xfffd; - } else { - return U_SENTINEL; - } -} - -/* - * Handle the non-inline part of the U8_NEXT() and U8_NEXT_FFFD() macros - * and their obsolete sibling UTF8_NEXT_CHAR_SAFE(). - * - * U8_NEXT() supports NUL-terminated strings indicated via length<0. - * - * The "strict" parameter controls the error behavior: - * <0 "Safe" behavior of U8_NEXT(): - * -1: All illegal byte sequences yield U_SENTINEL=-1. - * -2: Same as -1, except for lenient treatment of surrogate code points as legal. - * Some implementations use this for roundtripping of - * Unicode 16-bit strings that are not well-formed UTF-16, that is, they - * contain unpaired surrogates. - * -3: All illegal byte sequences yield U+FFFD. - * 0 Obsolete "safe" behavior of UTF8_NEXT_CHAR_SAFE(..., FALSE): - * All illegal byte sequences yield a positive code point such that this - * result code point would be encoded with the same number of bytes as - * the illegal sequence. - * >0 Obsolete "strict" behavior of UTF8_NEXT_CHAR_SAFE(..., TRUE): - * Same as the obsolete "safe" behavior, but non-characters are also treated - * like illegal sequences. - * - * Note that a UBool is the same as an int8_t. - */ -U_CAPI UChar32 U_EXPORT2 -utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict) { - int32_t i=*pi; - uint8_t count=U8_COUNT_TRAIL_BYTES(c); - U_ASSERT(count <= 5); /* U8_COUNT_TRAIL_BYTES returns value 0...5 */ - if(i+count<=length || length<0) { - uint8_t trail; - - U8_MASK_LEAD_BYTE(c, count); - /* support NUL-terminated strings: do not read beyond the first non-trail byte */ - switch(count) { - /* each branch falls through to the next one */ - case 0: - /* count==0 for illegally leading trail bytes and the illegal bytes 0xfe and 0xff */ - case 5: - case 4: - /* count>=4 is always illegal: no more than 3 trail bytes in Unicode's UTF-8 */ - break; - case 3: - trail=s[i++]-0x80; - c=(c<<6)|trail; - /* c>=0x110 would result in code point>0x10ffff, outside Unicode */ - if(c>=0x110 || trail>0x3f) { break; } - case 2: - trail=s[i++]-0x80; - c=(c<<6)|trail; - /* - * test for a surrogate d800..dfff unless we are lenient: - * before the last (c<<6), a surrogate is c=360..37f - */ - if(((c&0xffe0)==0x360 && strict!=-2) || trail>0x3f) { break; } - case 1: - trail=s[i++]-0x80; - c=(c<<6)|trail; - if(trail>0x3f) { break; } - /* correct sequence - all trail bytes have (b7..b6)==(10) */ - if(c>=utf8_minLegal[count] && - /* strict: forbid non-characters like U+fffe */ - (strict<=0 || !U_IS_UNICODE_NONCHAR(c))) { - *pi=i; - return c; - } - /* no default branch to optimize switch() - all values are covered */ - } - } else { - /* too few bytes left */ - count=length-i; - } - - /* error handling */ - i=*pi; - while(count>0 && U8_IS_TRAIL(s[i])) { - ++i; - --count; - } - c=errorValue(i-*pi, strict); - *pi=i; - return c; -} - -U_CAPI int32_t U_EXPORT2 -utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool *pIsError) { - if((uint32_t)(c)<=0x7ff) { - if((i)+1<(length)) { - (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); - (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); - return i; - } - } else if((uint32_t)(c)<=0xffff) { - /* Starting with Unicode 3.2, surrogate code points must not be encoded in UTF-8. */ - if((i)+2<(length) && !U_IS_SURROGATE(c)) { - (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); - (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); - (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); - return i; - } - } else if((uint32_t)(c)<=0x10ffff) { - if((i)+3<(length)) { - (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); - (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); - (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); - (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); - return i; - } - } - /* c>0x10ffff or not enough space, write an error value */ - if(pIsError!=NULL) { - *pIsError=TRUE; - } else { - length-=i; - if(length>0) { - int32_t offset; - if(length>3) { - length=3; - } - s+=i; - offset=0; - c=utf8_errorValue[length-1]; - UTF8_APPEND_CHAR_UNSAFE(s, offset, c); - i=i+offset; - } - } - return i; -} - -U_CAPI UChar32 U_EXPORT2 -utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict) { - int32_t i=*pi; - uint8_t b, count=1, shift=6; - - if(!U8_IS_TRAIL(c)) { return errorValue(0, strict); } - - /* extract value bits from the last trail byte */ - c&=0x3f; - - for(;;) { - if(i<=start) { - /* no lead byte at all */ - return errorValue(0, strict); - } - - /* read another previous byte */ - b=s[--i]; - if((uint8_t)(b-0x80)<0x7e) { /* 0x80<=b<0xfe */ - if(b&0x40) { - /* lead byte, this will always end the loop */ - uint8_t shouldCount=U8_COUNT_TRAIL_BYTES(b); - - if(count==shouldCount) { - /* set the new position */ - *pi=i; - U8_MASK_LEAD_BYTE(b, count); - c|=(UChar32)b<=4 || c>0x10ffff || c0 && U_IS_UNICODE_NONCHAR(c))) { - /* illegal sequence or (strict and non-character) */ - if(count>=4) { - count=3; - } - c=errorValue(count, strict); - } else { - /* exit with correct c */ - } - } else { - /* the lead byte does not match the number of trail bytes */ - /* only set the position to the lead byte if it would - include the trail byte that we started with */ - if(countstart) { - Z=I-5; - } else { - Z=start; - } - - /* return I if the sequence starting there is long enough to include i */ - do { - b=s[I]; - if((uint8_t)(b-0x80)>=0x7e) { /* not 0x80<=b<0xfe */ - break; - } else if(b>=0xc0) { - if(U8_COUNT_TRAIL_BYTES(b)>=(i-I)) { - return I; - } else { - break; - } - } - } while(Z<=--I); - - /* return i itself to be consistent with the FWD_1 macro */ - return i; -} diff --git a/deps/icu-small/source/common/utf_impl.cpp b/deps/icu-small/source/common/utf_impl.cpp new file mode 100644 index 00000000000000..f78c566e098884 --- /dev/null +++ b/deps/icu-small/source/common/utf_impl.cpp @@ -0,0 +1,332 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +****************************************************************************** +* +* Copyright (C) 1999-2012, International Business Machines +* Corporation and others. All Rights Reserved. +* +****************************************************************************** +* file name: utf_impl.cpp +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 1999sep13 +* created by: Markus W. Scherer +* +* This file provides implementation functions for macros in the utfXX.h +* that would otherwise be too long as macros. +*/ + +/* set import/export definitions */ +#ifndef U_UTF8_IMPL +# define U_UTF8_IMPL +#endif + +#include "unicode/utypes.h" +#include "unicode/utf.h" +#include "unicode/utf8.h" +#include "uassert.h" + +/* + * Table of the number of utf8 trail bytes, indexed by the lead byte. + * Used by the deprecated macro UTF8_COUNT_TRAIL_BYTES, defined in utf_old.h + * + * The current macro, U8_COUNT_TRAIL_BYTES, does _not_ use this table. + * + * Note that this table cannot be removed, even if UTF8_COUNT_TRAIL_BYTES were + * changed to no longer use it. References to the table from expansions of UTF8_COUNT_TRAIL_BYTES + * may exist in old client code that must continue to run with newer icu library versions. + * + * This table could be replaced on many machines by + * a few lines of assembler code using an + * "index of first 0-bit from msb" instruction and + * one or two more integer instructions. + * + * For example, on an i386, do something like + * - MOV AL, leadByte + * - NOT AL (8-bit, leave b15..b8==0..0, reverse only b7..b0) + * - MOV AH, 0 + * - BSR BX, AX (16-bit) + * - MOV AX, 6 (result) + * - JZ finish (ZF==1 if leadByte==0xff) + * - SUB AX, BX (result) + * -finish: + * (BSR: Bit Scan Reverse, scans for a 1-bit, starting from the MSB) + */ +extern "C" U_EXPORT const uint8_t +utf8_countTrailBytes[256]={ + 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, + + 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, + + 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, + + // illegal C0 & C1 + // 2-byte lead bytes C2..DF + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + // 3-byte lead bytes E0..EF + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + // 4-byte lead bytes F0..F4 + // illegal F5..FF + 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static const UChar32 +utf8_errorValue[6]={ + // Same values as UTF8_ERROR_VALUE_1, UTF8_ERROR_VALUE_2, UTF_ERROR_VALUE, + // but without relying on the obsolete unicode/utf_old.h. + 0x15, 0x9f, 0xffff, + 0x10ffff +}; + +static UChar32 +errorValue(int32_t count, int8_t strict) { + if(strict>=0) { + return utf8_errorValue[count]; + } else if(strict==-3) { + return 0xfffd; + } else { + return U_SENTINEL; + } +} + +/* + * Handle the non-inline part of the U8_NEXT() and U8_NEXT_FFFD() macros + * and their obsolete sibling UTF8_NEXT_CHAR_SAFE(). + * + * U8_NEXT() supports NUL-terminated strings indicated via length<0. + * + * The "strict" parameter controls the error behavior: + * <0 "Safe" behavior of U8_NEXT(): + * -1: All illegal byte sequences yield U_SENTINEL=-1. + * -2: Same as -1, except for lenient treatment of surrogate code points as legal. + * Some implementations use this for roundtripping of + * Unicode 16-bit strings that are not well-formed UTF-16, that is, they + * contain unpaired surrogates. + * -3: All illegal byte sequences yield U+FFFD. + * 0 Obsolete "safe" behavior of UTF8_NEXT_CHAR_SAFE(..., FALSE): + * All illegal byte sequences yield a positive code point such that this + * result code point would be encoded with the same number of bytes as + * the illegal sequence. + * >0 Obsolete "strict" behavior of UTF8_NEXT_CHAR_SAFE(..., TRUE): + * Same as the obsolete "safe" behavior, but non-characters are also treated + * like illegal sequences. + * + * Note that a UBool is the same as an int8_t. + */ +U_CAPI UChar32 U_EXPORT2 +utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict) { + // *pi is one after byte c. + int32_t i=*pi; + // length can be negative for NUL-terminated strings: Read and validate one byte at a time. + if(i==length || c>0xf4) { + // end of string, or not a lead byte + } else if(c>=0xf0) { + // Test for 4-byte sequences first because + // U8_NEXT() handles shorter valid sequences inline. + uint8_t t1=s[i], t2, t3; + c&=7; + if(U8_IS_VALID_LEAD4_AND_T1(c, t1) && + ++i!=length && (t2=s[i]-0x80)<=0x3f && + ++i!=length && (t3=s[i]-0x80)<=0x3f) { + ++i; + c=(c<<18)|((t1&0x3f)<<12)|(t2<<6)|t3; + // strict: forbid non-characters like U+fffe + if(strict<=0 || !U_IS_UNICODE_NONCHAR(c)) { + *pi=i; + return c; + } + } + } else if(c>=0xe0) { + c&=0xf; + if(strict!=-2) { + uint8_t t1=s[i], t2; + if(U8_IS_VALID_LEAD3_AND_T1(c, t1) && + ++i!=length && (t2=s[i]-0x80)<=0x3f) { + ++i; + c=(c<<12)|((t1&0x3f)<<6)|t2; + // strict: forbid non-characters like U+fffe + if(strict<=0 || !U_IS_UNICODE_NONCHAR(c)) { + *pi=i; + return c; + } + } + } else { + // strict=-2 -> lenient: allow surrogates + uint8_t t1=s[i]-0x80, t2; + if(t1<=0x3f && (c>0 || t1>=0x20) && + ++i!=length && (t2=s[i]-0x80)<=0x3f) { + *pi=i+1; + return (c<<12)|(t1<<6)|t2; + } + } + } else if(c>=0xc2) { + uint8_t t1=s[i]-0x80; + if(t1<=0x3f) { + *pi=i+1; + return ((c-0xc0)<<6)|t1; + } + } // else 0x80<=c<0xc2 is not a lead byte + + /* error handling */ + c=errorValue(i-*pi, strict); + *pi=i; + return c; +} + +U_CAPI int32_t U_EXPORT2 +utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool *pIsError) { + if((uint32_t)(c)<=0x7ff) { + if((i)+1<(length)) { + (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); + return i; + } + } else if((uint32_t)(c)<=0xffff) { + /* Starting with Unicode 3.2, surrogate code points must not be encoded in UTF-8. */ + if((i)+2<(length) && !U_IS_SURROGATE(c)) { + (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); + (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); + return i; + } + } else if((uint32_t)(c)<=0x10ffff) { + if((i)+3<(length)) { + (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); + (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); + (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); + (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); + return i; + } + } + /* c>0x10ffff or not enough space, write an error value */ + if(pIsError!=NULL) { + *pIsError=TRUE; + } else { + length-=i; + if(length>0) { + int32_t offset; + if(length>3) { + length=3; + } + s+=i; + offset=0; + c=utf8_errorValue[length-1]; + U8_APPEND_UNSAFE(s, offset, c); + i=i+offset; + } + } + return i; +} + +U_CAPI UChar32 U_EXPORT2 +utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict) { + // *pi is the index of byte c. + int32_t i=*pi; + if(U8_IS_TRAIL(c) && i>start) { + uint8_t b1=s[--i]; + if(0xc2<=b1 && b1<0xe0) { + *pi=i; + return ((b1-0xc0)<<6)|(c&0x3f); + } else if(U8_IS_TRAIL(b1) && i>start) { + // Extract the value bits from the last trail byte. + c&=0x3f; + uint8_t b2=s[--i]; + if(0xe0<=b2 && b2<0xf0) { + b2&=0xf; + if(strict!=-2) { + if(U8_IS_VALID_LEAD3_AND_T1(b2, b1)) { + *pi=i; + c=(b2<<12)|((b1&0x3f)<<6)|c; + if(strict<=0 || !U_IS_UNICODE_NONCHAR(c)) { + return c; + } else { + // strict: forbid non-characters like U+fffe + return errorValue(2, strict); + } + } + } else { + // strict=-2 -> lenient: allow surrogates + b1-=0x80; + if((b2>0 || b1>=0x20)) { + *pi=i; + return (b2<<12)|(b1<<6)|c; + } + } + } else if(U8_IS_TRAIL(b2) && i>start) { + uint8_t b3=s[--i]; + if(0xf0<=b3 && b3<=0xf4) { + b3&=7; + if(U8_IS_VALID_LEAD4_AND_T1(b3, b2)) { + *pi=i; + c=(b3<<18)|((b2&0x3f)<<12)|((b1&0x3f)<<6)|c; + if(strict<=0 || !U_IS_UNICODE_NONCHAR(c)) { + return c; + } else { + // strict: forbid non-characters like U+fffe + return errorValue(3, strict); + } + } + } + } else if(0xf0<=b2 && b2<=0xf4 && U8_IS_VALID_LEAD4_AND_T1(b2, b1)) { + // Truncated 4-byte sequence. + *pi=i; + return errorValue(2, strict); + } + } else if((0xe0<=b1 && b1<0xf0 && U8_IS_VALID_LEAD3_AND_T1(b1, c)) || + (0xf0<=b1 && b1<=0xf4 && U8_IS_VALID_LEAD4_AND_T1(b1, c))) { + // Truncated 3- or 4-byte sequence. + *pi=i; + return errorValue(1, strict); + } + } + return errorValue(0, strict); +} + +U_CAPI int32_t U_EXPORT2 +utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i) { + // Same as utf8_prevCharSafeBody(..., strict=-1) minus assembling code points. + int32_t orig_i=i; + uint8_t c=s[i]; + if(U8_IS_TRAIL(c) && i>start) { + uint8_t b1=s[--i]; + if(0xc2<=b1 && b1<0xe0) { + return i; + } else if(U8_IS_TRAIL(b1) && i>start) { + uint8_t b2=s[--i]; + if(0xe0<=b2 && b2<0xf0) { + if(U8_IS_VALID_LEAD3_AND_T1(b2, b1)) { + return i; + } + } else if(U8_IS_TRAIL(b2) && i>start) { + uint8_t b3=s[--i]; + if(0xf0<=b3 && b3<=0xf4) { + if(U8_IS_VALID_LEAD4_AND_T1(b3, b2)) { + return i; + } + } + } else if(0xf0<=b2 && b2<=0xf4 && U8_IS_VALID_LEAD4_AND_T1(b2, b1)) { + // Truncated 4-byte sequence. + return i; + } + } else if((0xe0<=b1 && b1<0xf0 && U8_IS_VALID_LEAD3_AND_T1(b1, c)) || + (0xf0<=b1 && b1<=0xf4 && U8_IS_VALID_LEAD4_AND_T1(b1, c))) { + // Truncated 3- or 4-byte sequence. + return i; + } + } + return orig_i; +} diff --git a/deps/icu-small/source/common/util.cpp b/deps/icu-small/source/common/util.cpp index b5d1fa4888ad27..838a201a73d803 100644 --- a/deps/icu-small/source/common/util.cpp +++ b/deps/icu-small/source/common/util.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/util.h b/deps/icu-small/source/common/util.h index b3ed037ab62696..7af9a32d8ffe53 100644 --- a/deps/icu-small/source/common/util.h +++ b/deps/icu-small/source/common/util.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/util_props.cpp b/deps/icu-small/source/common/util_props.cpp index 3b7bb20d254a86..36057a6066db94 100644 --- a/deps/icu-small/source/common/util_props.cpp +++ b/deps/icu-small/source/common/util_props.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/utrace.c b/deps/icu-small/source/common/utrace.cpp similarity index 97% rename from deps/icu-small/source/common/utrace.c rename to deps/icu-small/source/common/utrace.cpp index e702497d8c0f69..7d0ddc6f8b0339 100644 --- a/deps/icu-small/source/common/utrace.c +++ b/deps/icu-small/source/common/utrace.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,12 +6,11 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: utrace.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 */ -#define UTRACE_IMPL #include "unicode/utrace.h" #include "utracimp.h" #include "cstring.h" @@ -24,7 +23,11 @@ static UTraceExit *pTraceExitFunc = NULL; static UTraceData *pTraceDataFunc = NULL; static const void *gTraceContext = NULL; -U_EXPORT int32_t +/** + * \var utrace_level + * Trace level variable. Negative for "off". + */ +static int32_t utrace_level = UTRACE_ERROR; U_CAPI void U_EXPORT2 @@ -134,7 +137,7 @@ static void outputHexBytes(int64_t val, int32_t charsToOutput, /* Output a pointer value in hex. Work with any size of pointer */ static void outputPtrBytes(void *val, char *outBuf, int32_t *outIx, int32_t capacity) { - int32_t i; + uint32_t i; int32_t incVal = 1; /* +1 for big endian, -1 for little endian */ char *p = (char *)&val; /* point to current byte to output in the ptr val */ @@ -230,7 +233,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt, case 'S': /* UChar * string, with length, len==-1 for null terminated. */ - ptrArg = va_arg(args, void *); /* Ptr */ + ptrArg = va_arg(args, char *); /* Ptr */ intArg =(int32_t)va_arg(args, int32_t); /* Length */ outputUString((const UChar *)ptrArg, intArg, outBuf, &outIx, capacity, indent); break; @@ -261,7 +264,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt, case 'p': /* Pointers. */ - ptrArg = va_arg(args, void *); + ptrArg = va_arg(args, char *); outputPtrBytes(ptrArg, outBuf, &outIx, capacity); break; @@ -332,7 +335,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt, break; case 's': charsToOutput = 0; - outputString(*ptrPtr, outBuf, &outIx, capacity, indent); + outputString((const char *)*ptrPtr, outBuf, &outIx, capacity, indent); outputChar('\n', outBuf, &outIx, capacity, indent); longArg = *ptrPtr==NULL? 0: 1; /* for test for null term. array. */ ptrPtr++; diff --git a/deps/icu-small/source/common/utracimp.h b/deps/icu-small/source/common/utracimp.h index 5ec047a967a858..c2819830e1ba52 100644 --- a/deps/icu-small/source/common/utracimp.h +++ b/deps/icu-small/source/common/utracimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: utracimp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -47,20 +47,6 @@ U_CDECL_BEGIN -/** - * \var utrace_level - * Trace level variable. Negative for "off". - * Use only via UTRACE_ macros. - * @internal - */ -#ifdef UTRACE_IMPL -U_EXPORT int32_t -#else -U_CFUNC U_COMMON_API int32_t -#endif -utrace_level; - - /** * Traced Function Exit return types. * Flags indicating the number and types of varargs included in a call diff --git a/deps/icu-small/source/common/utrie.cpp b/deps/icu-small/source/common/utrie.cpp index 478560df66eb3b..ecf9b1cba72c6d 100644 --- a/deps/icu-small/source/common/utrie.cpp +++ b/deps/icu-small/source/common/utrie.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: utrie.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/utrie.h b/deps/icu-small/source/common/utrie.h index 17e660b3e308cb..9c5382c5949b3b 100644 --- a/deps/icu-small/source/common/utrie.h +++ b/deps/icu-small/source/common/utrie.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: utrie.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/utrie2.cpp b/deps/icu-small/source/common/utrie2.cpp index 4bd35a924d874a..8f9183bafad71f 100644 --- a/deps/icu-small/source/common/utrie2.cpp +++ b/deps/icu-small/source/common/utrie2.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: utrie2.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -746,7 +746,7 @@ uint16_t BackwardUTrie2StringIterator::previous16() { codePointLimit=codePointStart; if(start>=codePointStart) { codePoint=U_SENTINEL; - return 0; + return trie->errorValue; } uint16_t result; UTRIE2_U16_PREV16(trie, start, codePointStart, codePoint, result); @@ -757,7 +757,7 @@ uint16_t ForwardUTrie2StringIterator::next16() { codePointStart=codePointLimit; if(codePointLimit==limit) { codePoint=U_SENTINEL; - return 0; + return trie->errorValue; } uint16_t result; UTRIE2_U16_NEXT16(trie, codePointLimit, limit, codePoint, result); diff --git a/deps/icu-small/source/common/utrie2.h b/deps/icu-small/source/common/utrie2.h index 810bcfc9591058..8e1caa5e90bde2 100644 --- a/deps/icu-small/source/common/utrie2.h +++ b/deps/icu-small/source/common/utrie2.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: utrie2.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -20,6 +20,7 @@ #define __UTRIE2_H__ #include "unicode/utypes.h" +#include "unicode/utf8.h" #include "putilimp.h" #include "udataswp.h" @@ -54,6 +55,8 @@ typedef struct UTrie UTrie; * is truncated, omitting both the BMP portion and the high range. * - There is a special small index for 2-byte UTF-8, and the initial data * entries are designed for fast 1/2-byte UTF-8 lookup. + * Starting with ICU 60, C0 and C1 are not recognized as UTF-8 lead bytes any more at all, + * and the associated 2-byte indexes are unused. */ /** @@ -933,29 +936,29 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c, /** Internal UTF-8 next-post-increment: get the next code point's data. */ #define _UTRIE2_U8_NEXT(trie, ascii, data, src, limit, result) { \ uint8_t __lead=(uint8_t)*(src)++; \ - if(__lead<0xc0) { \ + if(U8_IS_SINGLE(__lead)) { \ (result)=(trie)->ascii[__lead]; \ } else { \ uint8_t __t1, __t2; \ - if( /* handle U+0000..U+07FF inline */ \ - __lead<0xe0 && (src)<(limit) && \ - (__t1=(uint8_t)(*(src)-0x80))<=0x3f \ - ) { \ - ++(src); \ - (result)=(trie)->data[ \ - (trie)->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET-0xc0)+__lead]+ \ - __t1]; \ - } else if( /* handle U+0000..U+CFFF inline */ \ - __lead<0xed && ((src)+1)<(limit) && \ - (__t1=(uint8_t)(*(src)-0x80))<=0x3f && (__lead>0xe0 || __t1>=0x20) && \ + if( /* handle U+0800..U+FFFF inline */ \ + 0xe0<=__lead && __lead<0xf0 && ((src)+1)<(limit) && \ + U8_IS_VALID_LEAD3_AND_T1(__lead, __t1=(uint8_t)*(src)) && \ (__t2=(uint8_t)(*((src)+1)-0x80))<= 0x3f \ ) { \ (src)+=2; \ (result)=(trie)->data[ \ ((int32_t)((trie)->index[((__lead-0xe0)<<(12-UTRIE2_SHIFT_2))+ \ - (__t1<<(6-UTRIE2_SHIFT_2))+(__t2>>UTRIE2_SHIFT_2)]) \ + ((__t1&0x3f)<<(6-UTRIE2_SHIFT_2))+(__t2>>UTRIE2_SHIFT_2)]) \ <=0xc2 && (src)<(limit) && \ + (__t1=(uint8_t)(*(src)-0x80))<=0x3f \ + ) { \ + ++(src); \ + (result)=(trie)->data[ \ + (trie)->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET-0xc0)+__lead]+ \ + __t1]; \ } else { \ int32_t __index=utrie2_internalU8NextIndex((trie), __lead, (const uint8_t *)(src), \ (const uint8_t *)(limit)); \ @@ -968,7 +971,7 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c, /** Internal UTF-8 pre-decrement-previous: get the previous code point's data. */ #define _UTRIE2_U8_PREV(trie, ascii, data, start, src, result) { \ uint8_t __b=(uint8_t)*--(src); \ - if(__b<0x80) { \ + if(U8_IS_SINGLE(__b)) { \ (result)=(trie)->ascii[__b]; \ } else { \ int32_t __index=utrie2_internalU8PrevIndex((trie), __b, (const uint8_t *)(start), \ @@ -980,11 +983,4 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c, U_CDECL_END -/** - * Work around MSVC 2003 optimization bugs. - */ -#if defined (U_HAVE_MSVC_2003_OR_EARLIER) -#pragma optimize("", off) -#endif - #endif diff --git a/deps/icu-small/source/common/utrie2_builder.cpp b/deps/icu-small/source/common/utrie2_builder.cpp index 664051c5f9bd04..d8a3a06757370d 100644 --- a/deps/icu-small/source/common/utrie2_builder.cpp +++ b/deps/icu-small/source/common/utrie2_builder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: utrie2_builder.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/utrie2_impl.h b/deps/icu-small/source/common/utrie2_impl.h index 48883638b185c4..b7dc9d3fb45fd4 100644 --- a/deps/icu-small/source/common/utrie2_impl.h +++ b/deps/icu-small/source/common/utrie2_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: utrie2_impl.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/common/uts46.cpp b/deps/icu-small/source/common/uts46.cpp index 7bc4f925caca0b..9b8d3ded2fddd1 100644 --- a/deps/icu-small/source/common/uts46.cpp +++ b/deps/icu-small/source/common/uts46.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: uts46.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -1015,8 +1015,8 @@ UTS46::checkLabelBiDi(const UChar *label, int32_t labelLength, IDNAInfo &info) c ) { info.isOkBiDi=FALSE; } - // Get the directionalities of the intervening characters. - uint32_t mask=0; + // Add the directionalities of the intervening characters. + uint32_t mask=firstMask|lastMask; while(i(uprv_strlen(label)) : length); CheckedArrayByteSink sink(dest, capacity); IDNAInfo info; reinterpret_cast(idna)->labelToASCII_UTF8(src, sink, info, *pErrorCode); @@ -1431,7 +1431,7 @@ uidna_labelToUnicodeUTF8(const UIDNA *idna, if(!checkArgs(label, length, dest, capacity, pInfo, pErrorCode)) { return 0; } - StringPiece src(label, length<0 ? uprv_strlen(label) : length); + StringPiece src(label, length<0 ? static_cast(uprv_strlen(label)) : length); CheckedArrayByteSink sink(dest, capacity); IDNAInfo info; reinterpret_cast(idna)->labelToUnicodeUTF8(src, sink, info, *pErrorCode); @@ -1447,7 +1447,7 @@ uidna_nameToASCII_UTF8(const UIDNA *idna, if(!checkArgs(name, length, dest, capacity, pInfo, pErrorCode)) { return 0; } - StringPiece src(name, length<0 ? uprv_strlen(name) : length); + StringPiece src(name, length<0 ? static_cast(uprv_strlen(name)) : length); CheckedArrayByteSink sink(dest, capacity); IDNAInfo info; reinterpret_cast(idna)->nameToASCII_UTF8(src, sink, info, *pErrorCode); @@ -1463,7 +1463,7 @@ uidna_nameToUnicodeUTF8(const UIDNA *idna, if(!checkArgs(name, length, dest, capacity, pInfo, pErrorCode)) { return 0; } - StringPiece src(name, length<0 ? uprv_strlen(name) : length); + StringPiece src(name, length<0 ? static_cast(uprv_strlen(name)) : length); CheckedArrayByteSink sink(dest, capacity); IDNAInfo info; reinterpret_cast(idna)->nameToUnicodeUTF8(src, sink, info, *pErrorCode); diff --git a/deps/icu-small/source/common/utypeinfo.h b/deps/icu-small/source/common/utypeinfo.h index b39aa0d6053344..c6663734fc3dc4 100644 --- a/deps/icu-small/source/common/utypeinfo.h +++ b/deps/icu-small/source/common/utypeinfo.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -24,7 +24,7 @@ #include using std::exception; #endif -#if !defined(_MSC_VER) +#if defined(__GLIBCXX__) namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364 #endif #include // for 'typeid' to work diff --git a/deps/icu-small/source/common/utypes.c b/deps/icu-small/source/common/utypes.cpp similarity index 99% rename from deps/icu-small/source/common/utypes.c rename to deps/icu-small/source/common/utypes.cpp index c506dd44f5424c..8f5791be160e17 100644 --- a/deps/icu-small/source/common/utypes.c +++ b/deps/icu-small/source/common/utypes.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/uvector.cpp b/deps/icu-small/source/common/uvector.cpp index e48913e55eac12..ad3a813e3706ac 100644 --- a/deps/icu-small/source/common/uvector.cpp +++ b/deps/icu-small/source/common/uvector.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/uvector.h b/deps/icu-small/source/common/uvector.h index f6abe3e78ad1c9..ad75e23400aa9b 100644 --- a/deps/icu-small/source/common/uvector.h +++ b/deps/icu-small/source/common/uvector.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uvectr32.cpp b/deps/icu-small/source/common/uvectr32.cpp index 3607d974ce5a9d..6e0760d7184040 100644 --- a/deps/icu-small/source/common/uvectr32.cpp +++ b/deps/icu-small/source/common/uvectr32.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/uvectr32.h b/deps/icu-small/source/common/uvectr32.h index c975de769b55b4..3174e94c9f55a9 100644 --- a/deps/icu-small/source/common/uvectr32.h +++ b/deps/icu-small/source/common/uvectr32.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/uvectr64.cpp b/deps/icu-small/source/common/uvectr64.cpp index 9196274aba1826..145db246dc5a05 100644 --- a/deps/icu-small/source/common/uvectr64.cpp +++ b/deps/icu-small/source/common/uvectr64.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/common/uvectr64.h b/deps/icu-small/source/common/uvectr64.h index fec10983988de9..1db4a1fe2ea3c4 100644 --- a/deps/icu-small/source/common/uvectr64.h +++ b/deps/icu-small/source/common/uvectr64.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/common/wintz.c b/deps/icu-small/source/common/wintz.cpp similarity index 63% rename from deps/icu-small/source/common/wintz.c rename to deps/icu-small/source/common/wintz.cpp index 5a3ecae0a43f36..c30a5dbc606894 100644 --- a/deps/icu-small/source/common/wintz.c +++ b/deps/icu-small/source/common/wintz.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -13,7 +13,9 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API +// This file contains only desktop Windows behavior +// Windows UWP calls Windows::Globalization directly, so this isn't needed there. +#if U_PLATFORM_USES_ONLY_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) #include "wintz.h" #include "cmemory.h" @@ -22,7 +24,9 @@ #include "unicode/ures.h" #include "unicode/ustring.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -46,102 +50,25 @@ typedef struct * Various registry keys and key fragments. */ static const char CURRENT_ZONE_REGKEY[] = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation\\"; -/* static const char STANDARD_NAME_REGKEY[] = "StandardName"; Currently unused constant */ static const char STANDARD_TIME_REGKEY[] = " Standard Time"; static const char TZI_REGKEY[] = "TZI"; static const char STD_REGKEY[] = "Std"; /** - * HKLM subkeys used to probe for the flavor of Windows. Note that we - * specifically check for the "GMT" zone subkey; this is present on - * NT, but on XP has become "GMT Standard Time". We need to - * discriminate between these cases. + * The time zone root keys (under HKLM) for Win7+ */ -static const char* const WIN_TYPE_PROBE_REGKEY[] = { - /* WIN_9X_ME_TYPE */ - "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones", - - /* WIN_NT_TYPE */ - "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\GMT" - - /* otherwise: WIN_2K_XP_TYPE */ -}; - -/** - * The time zone root subkeys (under HKLM) for different flavors of - * Windows. - */ -static const char* const TZ_REGKEY[] = { - /* WIN_9X_ME_TYPE */ - "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones\\", - - /* WIN_NT_TYPE | WIN_2K_XP_TYPE */ - "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\" -}; - -/** - * Flavor of Windows, from our perspective. Not a real OS version, - * but rather the flavor of the layout of the time zone information in - * the registry. - */ -enum { - WIN_9X_ME_TYPE = 1, - WIN_NT_TYPE = 2, - WIN_2K_XP_TYPE = 3 -}; - -static int32_t gWinType = 0; - -static int32_t detectWindowsType() -{ - int32_t winType; - LONG result; - HKEY hkey; - - /* Detect the version of windows by trying to open a sequence of - probe keys. We don't use the OS version API because what we - really want to know is how the registry is laid out. - Specifically, is it 9x/Me or not, and is it "GMT" or "GMT - Standard Time". */ - for (winType = 0; winType < 2; winType++) { - result = RegOpenKeyExA(HKEY_LOCAL_MACHINE, - WIN_TYPE_PROBE_REGKEY[winType], - 0, - KEY_QUERY_VALUE, - &hkey); - RegCloseKey(hkey); - - if (result == ERROR_SUCCESS) { - break; - } - } - - return winType+1; /* +1 to bring it inline with the enum */ -} +static const char TZ_REGKEY[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\"; static LONG openTZRegKey(HKEY *hkey, const char *winid) { - char subKeyName[110]; /* TODO: why 96?? */ + char subKeyName[110]; /* TODO: why 110?? */ char *name; LONG result; - /* This isn't thread safe, but it's good enough because the result should be constant per system. */ - if (gWinType <= 0) { - gWinType = detectWindowsType(); - } - - uprv_strcpy(subKeyName, TZ_REGKEY[(gWinType != WIN_9X_ME_TYPE)]); + uprv_strcpy(subKeyName, TZ_REGKEY); name = &subKeyName[strlen(subKeyName)]; uprv_strcat(subKeyName, winid); - if (gWinType == WIN_9X_ME_TYPE) { - /* Remove " Standard Time" */ - char *pStd = uprv_strstr(subKeyName, STANDARD_TIME_REGKEY); - if (pStd) { - *pStd = 0; - } - } - result = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subKeyName, 0, @@ -158,44 +85,44 @@ static LONG getTZI(const char *winid, TZI *tzi) result = openTZRegKey(&hkey, winid); - if (result == ERROR_SUCCESS) { + if (result == ERROR_SUCCESS) + { result = RegQueryValueExA(hkey, TZI_REGKEY, NULL, NULL, (LPBYTE)tzi, &cbData); - + RegCloseKey(hkey); } - RegCloseKey(hkey); - return result; } -static LONG getSTDName(const char *winid, char *regStdName, int32_t length) { +static LONG getSTDName(const char *winid, char *regStdName, int32_t length) +{ DWORD cbData = length; LONG result; HKEY hkey; result = openTZRegKey(&hkey, winid); - if (result == ERROR_SUCCESS) { + if (result == ERROR_SUCCESS) + { result = RegQueryValueExA(hkey, STD_REGKEY, NULL, NULL, (LPBYTE)regStdName, &cbData); - + RegCloseKey(hkey); } - RegCloseKey(hkey); - return result; } -static LONG getTZKeyName(char* tzKeyName, int32_t length) { +static LONG getTZKeyName(char* tzKeyName, int32_t length) +{ HKEY hkey; LONG result = FALSE; DWORD cbData = length; @@ -214,27 +141,27 @@ static LONG getTZKeyName(char* tzKeyName, int32_t length) { NULL, (LPBYTE)tzKeyName, &cbData); + + RegCloseKey(hkey); } return result; } /* - This code attempts to detect the Windows time zone, as set in the - Windows Date and Time control panel. It attempts to work on - multiple flavors of Windows (9x, Me, NT, 2000, XP) and on localized + This code attempts to detect the Windows time zone directly, + as set in the Windows Date and Time control panel. It attempts + to work on versions greater than Windows Vista and on localized installs. It works by directly interrogating the registry and comparing the data there with the data returned by the GetTimeZoneInformation API, along with some other strategies. The - registry contains time zone data under one of two keys (depending on - the flavor of Windows): + registry contains time zone data under this key: - HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones\ HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\ - Under this key are several subkeys, one for each time zone. These - subkeys are named "Pacific" on Win9x/Me and "Pacific Standard Time" - on WinNT/2k/XP. There are some other wrinkles; see the code for + Under this key are several subkeys, one for each time zone. For + example these subkeys are named "Pacific Standard Time" on Vista+. + There are some other wrinkles; see the code for details. The subkey name is NOT LOCALIZED, allowing us to support localized installs. @@ -272,7 +199,8 @@ static LONG getTZKeyName(char* tzKeyName, int32_t length) { * time zone, translated to an ICU time zone, or NULL upon failure. */ U_CFUNC const char* U_EXPORT2 -uprv_detectWindowsTimeZone() { +uprv_detectWindowsTimeZone() +{ UErrorCode status = U_ZERO_ERROR; UResourceBundle* bundle = NULL; char* icuid = NULL; @@ -282,7 +210,7 @@ uprv_detectWindowsTimeZone() { int32_t len; int id; int errorCode; - UChar ISOcodeW[3]; /* 2 letter iso code in UTF-16*/ + wchar_t ISOcodeW[3]; /* 2 letter iso code in UTF-16*/ char ISOcodeA[3]; /* 2 letter iso code in ansi */ LONG result; @@ -290,7 +218,6 @@ uprv_detectWindowsTimeZone() { TZI tziReg; TIME_ZONE_INFORMATION apiTZI; - BOOL isVistaOrHigher; BOOL tryPreVistaFallback; OSVERSIONINFO osVerInfo; @@ -314,8 +241,8 @@ uprv_detectWindowsTimeZone() { tmpid[0] = 0; id = GetUserGeoID(GEOCLASS_NATION); - errorCode = GetGeoInfoW(id,GEO_ISO2,ISOcodeW,3,0); - u_strToUTF8(ISOcodeA, 3, NULL, ISOcodeW, 3, &status); + errorCode = GetGeoInfoW(id, GEO_ISO2, ISOcodeW, 3, 0); + u_strToUTF8(ISOcodeA, 3, NULL, (const UChar *)ISOcodeW, 3, &status); bundle = ures_openDirect(NULL, "windowsZones", &status); ures_getByKey(bundle, "mapTimezones", bundle, &status); @@ -327,75 +254,86 @@ uprv_detectWindowsTimeZone() { */ uprv_memset(&osVerInfo, 0, sizeof(osVerInfo)); osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo); - GetVersionEx(&osVerInfo); - isVistaOrHigher = osVerInfo.dwMajorVersion >= 6; /* actually includes Windows Server 2008 as well, but don't worry about it */ tryPreVistaFallback = TRUE; - if(isVistaOrHigher) { - result = getTZKeyName(regStdName, sizeof(regStdName)); - if(ERROR_SUCCESS == result) { - UResourceBundle* winTZ = ures_getByKey(bundle, regStdName, NULL, &status); - if(U_SUCCESS(status)) { - const UChar* icuTZ = NULL; - if (errorCode != 0) { - icuTZ = ures_getStringByKey(winTZ, ISOcodeA, &len, &status); - } - if (errorCode==0 || icuTZ==NULL) { - /* fallback to default "001" and reset status */ - status = U_ZERO_ERROR; - icuTZ = ures_getStringByKey(winTZ, "001", &len, &status); - } + result = getTZKeyName(regStdName, sizeof(regStdName)); + if(ERROR_SUCCESS == result) + { + UResourceBundle* winTZ = ures_getByKey(bundle, regStdName, NULL, &status); + if(U_SUCCESS(status)) + { + const UChar* icuTZ = NULL; + if (errorCode != 0) + { + icuTZ = ures_getStringByKey(winTZ, ISOcodeA, &len, &status); + } + if (errorCode==0 || icuTZ==NULL) + { + /* fallback to default "001" and reset status */ + status = U_ZERO_ERROR; + icuTZ = ures_getStringByKey(winTZ, "001", &len, &status); + } - if(U_SUCCESS(status)) { - int index=0; - while (! (*icuTZ == '\0' || *icuTZ ==' ')) { - tmpid[index++]=(char)(*icuTZ++); /* safe to assume 'char' is ASCII compatible on windows */ - } - tmpid[index]='\0'; - tryPreVistaFallback = FALSE; + if(U_SUCCESS(status)) + { + int index=0; + while (! (*icuTZ == '\0' || *icuTZ ==' ')) + { + tmpid[index++]=(char)(*icuTZ++); /* safe to assume 'char' is ASCII compatible on windows */ } + tmpid[index]='\0'; + tryPreVistaFallback = FALSE; } - ures_close(winTZ); } + ures_close(winTZ); } - if(tryPreVistaFallback) { - + if(tryPreVistaFallback) + { /* Note: We get the winid not from static tables but from resource bundle. */ - while (U_SUCCESS(status) && ures_hasNext(bundle)) { + while (U_SUCCESS(status) && ures_hasNext(bundle)) + { UBool idFound = FALSE; const char* winid; UResourceBundle* winTZ = ures_getNextResource(bundle, NULL, &status); - if (U_FAILURE(status)) { + if (U_FAILURE(status)) + { break; } winid = ures_getKey(winTZ); result = getTZI(winid, &tziReg); - if (result == ERROR_SUCCESS) { + if (result == ERROR_SUCCESS) + { /* Windows alters the DaylightBias in some situations. Using the bias and the rules suffices, so overwrite these unreliable fields. */ tziKey.standardBias = tziReg.standardBias; tziKey.daylightBias = tziReg.daylightBias; - if (uprv_memcmp((char *)&tziKey, (char*)&tziReg, sizeof(tziKey)) == 0) { + if (uprv_memcmp((char *)&tziKey, (char*)&tziReg, sizeof(tziKey)) == 0) + { const UChar* icuTZ = NULL; - if (errorCode != 0) { + if (errorCode != 0) + { icuTZ = ures_getStringByKey(winTZ, ISOcodeA, &len, &status); } - if (errorCode==0 || icuTZ==NULL) { + if (errorCode==0 || icuTZ==NULL) + { /* fallback to default "001" and reset status */ status = U_ZERO_ERROR; icuTZ = ures_getStringByKey(winTZ, "001", &len, &status); } - if (U_SUCCESS(status)) { + if (U_SUCCESS(status)) + { /* Get the standard name from the registry key to compare with the one from Windows API call. */ uprv_memset(regStdName, 0, sizeof(regStdName)); result = getSTDName(winid, regStdName, sizeof(regStdName)); - if (result == ERROR_SUCCESS) { - if (uprv_strcmp(apiStdName, regStdName) == 0) { + if (result == ERROR_SUCCESS) + { + if (uprv_strcmp(apiStdName, regStdName) == 0) + { idFound = TRUE; } } @@ -404,10 +342,12 @@ uprv_detectWindowsTimeZone() { * If none is found, tmpid buffer will contain a fallback ID (i.e. the time zone ID matching * the current time zone information) */ - if (idFound || tmpid[0] == 0) { + if (idFound || tmpid[0] == 0) + { /* if icuTZ has more than one city, take only the first (i.e. terminate icuTZ at first space) */ int index=0; - while (! (*icuTZ == '\0' || *icuTZ ==' ')) { + while (! (*icuTZ == '\0' || *icuTZ ==' ')) + { tmpid[index++]=(char)(*icuTZ++); /* safe to assume 'char' is ASCII compatible on windows */ } tmpid[index]='\0'; @@ -416,7 +356,8 @@ uprv_detectWindowsTimeZone() { } } ures_close(winTZ); - if (idFound) { + if (idFound) + { break; } } @@ -425,10 +366,12 @@ uprv_detectWindowsTimeZone() { /* * Copy the timezone ID to icuid to be returned. */ - if (tmpid[0] != 0) { + if (tmpid[0] != 0) + { len = uprv_strlen(tmpid); icuid = (char*)uprv_calloc(len + 1, sizeof(char)); - if (icuid != NULL) { + if (icuid != NULL) + { uprv_strcpy(icuid, tmpid); } } @@ -438,4 +381,4 @@ uprv_detectWindowsTimeZone() { return icuid; } -#endif /* U_PLATFORM_HAS_WIN32_API */ +#endif /* U_PLATFORM_USES_ONLY_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) */ diff --git a/deps/icu-small/source/common/wintz.h b/deps/icu-small/source/common/wintz.h index 01a906a401348d..9e8cbbcfaba36f 100644 --- a/deps/icu-small/source/common/wintz.h +++ b/deps/icu-small/source/common/wintz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -16,7 +16,9 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API +// This file contains only desktop windows behavior +// Windows UWP calls Windows::Globalization directly, so this isn't needed there. +#if U_PLATFORM_USES_ONLY_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) /** * \file @@ -31,6 +33,6 @@ U_CDECL_END U_CFUNC const char* U_EXPORT2 uprv_detectWindowsTimeZone(); -#endif /* U_PLATFORM_HAS_WIN32_API */ +#endif /* U_PLATFORM_USES_ONLY_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) */ #endif /* __WINTZ */ diff --git a/deps/icu-small/source/data/in/icudt58l.dat b/deps/icu-small/source/data/in/icudt58l.dat deleted file mode 100644 index bc36c1313d9c7e..00000000000000 Binary files a/deps/icu-small/source/data/in/icudt58l.dat and /dev/null differ diff --git a/deps/icu-small/source/data/in/icudt60l.dat b/deps/icu-small/source/data/in/icudt60l.dat new file mode 100644 index 00000000000000..c81ffccfa9ff97 Binary files /dev/null and b/deps/icu-small/source/data/in/icudt60l.dat differ diff --git a/deps/icu-small/source/i18n/affixpatternparser.cpp b/deps/icu-small/source/i18n/affixpatternparser.cpp index 05e45dbb12bfc5..d9e122953af53e 100644 --- a/deps/icu-small/source/i18n/affixpatternparser.cpp +++ b/deps/icu-small/source/i18n/affixpatternparser.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines @@ -13,19 +13,21 @@ #include "unicode/dcfmtsym.h" #include "unicode/plurrule.h" +#include "unicode/strenum.h" #include "unicode/ucurr.h" +#include "unicode/ustring.h" #include "affixpatternparser.h" #include "charstr.h" #include "precision.h" #include "uassert.h" #include "unistrappender.h" - static UChar gDefaultSymbols[] = {0xa4, 0xa4, 0xa4}; +static const UChar gDefaultSymbols[] = {0xa4, 0xa4, 0xa4}; -static UChar gPercent = 0x25; -static UChar gPerMill = 0x2030; -static UChar gNegative = 0x2D; -static UChar gPositive = 0x2B; +static const UChar gPercent = 0x25; +static const UChar gPerMill = 0x2030; +static const UChar gNegative = 0x2D; +static const UChar gPositive = 0x2B; #define PACK_TOKEN_AND_LENGTH(t, l) ((UChar) (((t) << 8) | (l & 0xFF))) @@ -224,7 +226,7 @@ AffixPattern::append(const AffixPattern &other) { addLiteral(literal.getBuffer(), 0, literal.length()); break; case kCurrency: - addCurrency(iter.getTokenLength()); + addCurrency(static_cast(iter.getTokenLength())); break; default: add(iter.getTokenType()); @@ -479,7 +481,7 @@ AffixPattern::parseUserAffixString( break; case 0xA4: appender.flush(); - appendTo.add(kCurrency, tokenSize); + appendTo.add(kCurrency, static_cast(tokenSize)); break; default: appender.append(token); diff --git a/deps/icu-small/source/i18n/affixpatternparser.h b/deps/icu-small/source/i18n/affixpatternparser.h index 07f84c53145d1d..b54c749c700816 100644 --- a/deps/icu-small/source/i18n/affixpatternparser.h +++ b/deps/icu-small/source/i18n/affixpatternparser.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/alphaindex.cpp b/deps/icu-small/source/i18n/alphaindex.cpp index 8a2f0a3cb5c820..692f5809b6c237 100644 --- a/deps/icu-small/source/i18n/alphaindex.cpp +++ b/deps/icu-small/source/i18n/alphaindex.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/anytrans.cpp b/deps/icu-small/source/i18n/anytrans.cpp index 8ec6f837cfdffa..d06469e2ae2746 100644 --- a/deps/icu-small/source/i18n/anytrans.cpp +++ b/deps/icu-small/source/i18n/anytrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************** @@ -31,9 +31,13 @@ static const UChar TARGET_SEP = 45; // '-' static const UChar VARIANT_SEP = 47; // '/' -static const UChar ANY[] = {65,110,121,0}; // "Any" +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[] = {45,76,97,116,105,110,59,76,97,116,105,110,45,0}; // "-Latin;Latin-" +static const UChar 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) +#define ANY_TRANS_CACHE_INIT_SIZE 7 //------------------------------------------------------------ @@ -186,7 +190,7 @@ AnyTransliterator::AnyTransliterator(const UnicodeString& id, Transliterator(id, NULL), targetScript(theTargetScript) { - cache = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &ec); + cache = uhash_openSize(uhash_hashLong, uhash_compareLong, NULL, ANY_TRANS_CACHE_INIT_SIZE, &ec); if (U_FAILURE(ec)) { return; } @@ -212,7 +216,7 @@ AnyTransliterator::AnyTransliterator(const AnyTransliterator& o) : { // Don't copy the cache contents UErrorCode ec = U_ZERO_ERROR; - cache = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &ec); + cache = uhash_openSize(uhash_hashLong, uhash_compareLong, NULL, ANY_TRANS_CACHE_INIT_SIZE, &ec); if (U_FAILURE(ec)) { return; } @@ -286,7 +290,7 @@ Transliterator* AnyTransliterator::getTransliterator(UScriptCode source) const { } if (t == NULL) { UErrorCode ec = U_ZERO_ERROR; - UnicodeString sourceName(uscript_getName(source), -1, US_INV); + UnicodeString sourceName(uscript_getShortName(source), -1, US_INV); UnicodeString id(sourceName); id.append(TARGET_SEP).append(target); diff --git a/deps/icu-small/source/i18n/anytrans.h b/deps/icu-small/source/i18n/anytrans.h index d06d2baa57e202..703d42b6d4be55 100644 --- a/deps/icu-small/source/i18n/anytrans.h +++ b/deps/icu-small/source/i18n/anytrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *********************************************************************** diff --git a/deps/icu-small/source/i18n/astro.cpp b/deps/icu-small/source/i18n/astro.cpp index d657aaa20d751a..0bf32ae854f2a6 100644 --- a/deps/icu-small/source/i18n/astro.cpp +++ b/deps/icu-small/source/i18n/astro.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /************************************************************************ * Copyright (C) 1996-2012, International Business Machines Corporation diff --git a/deps/icu-small/source/i18n/astro.h b/deps/icu-small/source/i18n/astro.h index e8546617634e36..a2464890056c3e 100644 --- a/deps/icu-small/source/i18n/astro.h +++ b/deps/icu-small/source/i18n/astro.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /************************************************************************ * Copyright (C) 1996-2008, International Business Machines Corporation * diff --git a/deps/icu-small/source/i18n/basictz.cpp b/deps/icu-small/source/i18n/basictz.cpp index b464f5cc5fbe64..6cd93f4d3c2c83 100644 --- a/deps/icu-small/source/i18n/basictz.cpp +++ b/deps/icu-small/source/i18n/basictz.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/bocsu.cpp b/deps/icu-small/source/i18n/bocsu.cpp index a2f94f239efcf7..861a76a0427536 100644 --- a/deps/icu-small/source/i18n/bocsu.cpp +++ b/deps/icu-small/source/i18n/bocsu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bocsu.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/bocsu.h b/deps/icu-small/source/i18n/bocsu.h index 56b03500b143d2..6b8ed5197097fd 100644 --- a/deps/icu-small/source/i18n/bocsu.h +++ b/deps/icu-small/source/i18n/bocsu.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bocsu.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/brktrans.cpp b/deps/icu-small/source/i18n/brktrans.cpp index 714a0a8720ad3f..ab5a8038420b78 100644 --- a/deps/icu-small/source/i18n/brktrans.cpp +++ b/deps/icu-small/source/i18n/brktrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/brktrans.h b/deps/icu-small/source/i18n/brktrans.h index 27228321e67399..fcc8bdd002ca76 100644 --- a/deps/icu-small/source/i18n/brktrans.h +++ b/deps/icu-small/source/i18n/brktrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/buddhcal.cpp b/deps/icu-small/source/i18n/buddhcal.cpp index c8a3a91a2cbd0d..b6ccbc4749955a 100644 --- a/deps/icu-small/source/i18n/buddhcal.cpp +++ b/deps/icu-small/source/i18n/buddhcal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/buddhcal.h b/deps/icu-small/source/i18n/buddhcal.h index 95db980600d20f..89e3f3dec36625 100644 --- a/deps/icu-small/source/i18n/buddhcal.h +++ b/deps/icu-small/source/i18n/buddhcal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/calendar.cpp b/deps/icu-small/source/i18n/calendar.cpp index 9b0f5a0ad3e9e4..7ccaa43b82b1e7 100644 --- a/deps/icu-small/source/i18n/calendar.cpp +++ b/deps/icu-small/source/i18n/calendar.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -66,10 +66,8 @@ #if !UCONFIG_NO_SERVICE static icu::ICULocaleService* gService = NULL; static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; -#endif // INTERNAL - for cleanup - U_CDECL_BEGIN static UBool calendar_cleanup(void) { #if !UCONFIG_NO_SERVICE @@ -82,6 +80,7 @@ static UBool calendar_cleanup(void) { return TRUE; } U_CDECL_END +#endif // ------------------------------------------ // @@ -234,6 +233,8 @@ static ECalType getCalendarType(const char *s) { return CALTYPE_UNKNOWN; } +#if !UCONFIG_NO_SERVICE +// Only used with service registration. static UBool isStandardSupportedKeyword(const char *keyword, UErrorCode& status) { if(U_FAILURE(status)) { return FALSE; @@ -242,6 +243,7 @@ static UBool isStandardSupportedKeyword(const char *keyword, UErrorCode& status) return (calType != CALTYPE_UNKNOWN); } +// only used with service registration. static void getCalendarKeyword(const UnicodeString &id, char *targetBuffer, int32_t targetBufferSize) { UnicodeString calendarKeyword = UNICODE_STRING_SIMPLE("calendar="); int32_t calKeyLen = calendarKeyword.length(); @@ -255,6 +257,7 @@ static void getCalendarKeyword(const UnicodeString &id, char *targetBuffer, int3 } targetBuffer[keyLen] = 0; } +#endif static ECalType getCalendarTypeForLocale(const char *locid) { UErrorCode status = U_ZERO_ERROR; @@ -705,6 +708,8 @@ fZone(NULL), fRepeatedWallTime(UCAL_WALLTIME_LAST), fSkippedWallTime(UCAL_WALLTIME_LAST) { + validLocale[0] = 0; + actualLocale[0] = 0; clear(); if (U_FAILURE(success)) { return; @@ -731,6 +736,8 @@ fZone(NULL), fRepeatedWallTime(UCAL_WALLTIME_LAST), fSkippedWallTime(UCAL_WALLTIME_LAST) { + validLocale[0] = 0; + actualLocale[0] = 0; if (U_FAILURE(success)) { return; } @@ -763,6 +770,8 @@ fZone(NULL), fRepeatedWallTime(UCAL_WALLTIME_LAST), fSkippedWallTime(UCAL_WALLTIME_LAST) { + validLocale[0] = 0; + actualLocale[0] = 0; if (U_FAILURE(success)) { return; } @@ -819,8 +828,10 @@ Calendar::operator=(const Calendar &right) fWeekendCease = right.fWeekendCease; fWeekendCeaseMillis = right.fWeekendCeaseMillis; fNextStamp = right.fNextStamp; - uprv_strcpy(validLocale, right.validLocale); - uprv_strcpy(actualLocale, right.actualLocale); + uprv_strncpy(validLocale, right.validLocale, sizeof(validLocale)); + uprv_strncpy(actualLocale, right.actualLocale, sizeof(actualLocale)); + validLocale[sizeof(validLocale)-1] = 0; + actualLocale[sizeof(validLocale)-1] = 0; } return *this; @@ -2966,7 +2977,7 @@ void Calendar::computeTime(UErrorCode& status) { // } #endif - int32_t millisInDay; + double millisInDay; // We only use MILLISECONDS_IN_DAY if it has been set by the user. // This makes it possible for the caller to set the calendar to a @@ -3086,10 +3097,10 @@ UBool Calendar::getImmediatePreviousZoneTransition(UDate base, UDate *transition * reflects local zone wall time. * @stable ICU 2.0 */ -int32_t Calendar::computeMillisInDay() { +double Calendar::computeMillisInDay() { // Do the time portion of the conversion. - int32_t millisInDay = 0; + double millisInDay = 0; // Find the best set of fields specifying the time of day. There // are only two possibilities here; the HOUR_OF_DAY or the @@ -3131,7 +3142,7 @@ int32_t Calendar::computeMillisInDay() { * or range. * @stable ICU 2.0 */ -int32_t Calendar::computeZoneOffset(double millis, int32_t millisInDay, UErrorCode &ec) { +int32_t Calendar::computeZoneOffset(double millis, double millisInDay, UErrorCode &ec) { int32_t rawOffset, dstOffset; UDate wall = millis + millisInDay; BasicTimeZone* btz = getBasicTimeZone(); diff --git a/deps/icu-small/source/i18n/casetrn.cpp b/deps/icu-small/source/i18n/casetrn.cpp index 7f71362c334dce..f08d448881d364 100644 --- a/deps/icu-small/source/i18n/casetrn.cpp +++ b/deps/icu-small/source/i18n/casetrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: casetrn.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -92,7 +92,6 @@ UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(CaseMapTransliterator) */ CaseMapTransliterator::CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map) : Transliterator(id, 0), - fCsp(ucase_getSingleton()), fMap(map) { // TODO test incremental mode with context-sensitive text (e.g. greek sigma) @@ -110,7 +109,7 @@ CaseMapTransliterator::~CaseMapTransliterator() { */ CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) : Transliterator(o), - fCsp(o.fCsp), fMap(o.fMap) + fMap(o.fMap) { } @@ -119,7 +118,6 @@ CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) : */ /*CaseMapTransliterator& CaseMapTransliterator::operator=(const CaseMapTransliterator& o) { Transliterator::operator=(o); - fCsp = o.fCsp; fMap = o.fMap; return *this; }*/ @@ -151,14 +149,14 @@ void CaseMapTransliterator::handleTransliterate(Replaceable& text, UnicodeString tmp; const UChar *s; UChar32 c; - int32_t textPos, delta, result, locCache=0; + int32_t textPos, delta, result; for(textPos=offsets.start; textPosjamoCE32s)) { - indexes[CollationDataReader::IX_JAMO_CE32S_START] = data.jamoCE32s - data.ce32s; + indexes[CollationDataReader::IX_JAMO_CE32S_START] = static_cast(data.jamoCE32s - data.ce32s); } else { indexes[CollationDataReader::IX_JAMO_CE32S_START] = -1; } diff --git a/deps/icu-small/source/i18n/collationdatawriter.h b/deps/icu-small/source/i18n/collationdatawriter.h index 6169e0fd2640ed..197cd5309f278b 100644 --- a/deps/icu-small/source/i18n/collationdatawriter.h +++ b/deps/icu-small/source/i18n/collationdatawriter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationfastlatin.cpp b/deps/icu-small/source/i18n/collationfastlatin.cpp index c3e8c98b3adb1a..b98b8457f4581b 100644 --- a/deps/icu-small/source/i18n/collationfastlatin.cpp +++ b/deps/icu-small/source/i18n/collationfastlatin.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationfastlatin.h b/deps/icu-small/source/i18n/collationfastlatin.h index 00a2d1b5105faf..4bac797409d8ac 100644 --- a/deps/icu-small/source/i18n/collationfastlatin.h +++ b/deps/icu-small/source/i18n/collationfastlatin.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp b/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp index 032e5e82aaef15..e5ba2f0e21dd82 100644 --- a/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp +++ b/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -607,7 +607,7 @@ CollationFastLatinBuilder::encodeContractions(UErrorCode &errorCode) { } UBool firstTriple = TRUE; for(int32_t index = (int32_t)ce & 0x7fffffff;; index += 3) { - int32_t x = contractionCEs.elementAti(index); + int32_t x = static_cast(contractionCEs.elementAti(index)); if((uint32_t)x == CollationFastLatin::CONTR_CHAR_MASK && !firstTriple) { break; } int64_t cce0 = contractionCEs.elementAti(index + 1); int64_t cce1 = contractionCEs.elementAti(index + 2); diff --git a/deps/icu-small/source/i18n/collationfastlatinbuilder.h b/deps/icu-small/source/i18n/collationfastlatinbuilder.h index 9d380380b4e58c..8b63b86815fdc6 100644 --- a/deps/icu-small/source/i18n/collationfastlatinbuilder.h +++ b/deps/icu-small/source/i18n/collationfastlatinbuilder.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationfcd.cpp b/deps/icu-small/source/i18n/collationfcd.cpp index de1d9a2d1d8c5b..19841ee6487ad2 100644 --- a/deps/icu-small/source/i18n/collationfcd.cpp +++ b/deps/icu-small/source/i18n/collationfcd.cpp @@ -1,13 +1,13 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html -/* - * Copyright (C) 1999-2016, International Business Machines - * Corporation and others. All Rights Reserved. - * - * file name: collationfcd.cpp - * - * machine-generated by: icu/tools/unicode/c/genuca/genuca.cpp - */ +// +// Copyright (C) 1999-2016, International Business Machines +// Corporation and others. All Rights Reserved. +// +// file name: collationfcd.cpp +// +// machine-generated by: icu/tools/unicode/c/genuca/genuca.cpp + #include "unicode/utypes.h" @@ -24,25 +24,25 @@ const uint8_t CollationFCD::lcccIndex[2048]={ 8,0,9,0xa,0,0,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0x10, 0x11,0x12,0x13,0,0,0,0x14,0x15,0,0x16,0x17,0,0,0x16,0x18,0, 0,0x16,0x18,0,0,0x16,0x18,0,0,0x16,0x18,0,0,0,0x18,0, -0,0,0x19,0,0,0x16,0x18,0,0,0,0x18,0,0,0,0x1a,0, -0,0x1b,0x1c,0,0,0x1d,0x1c,0,0x1d,0x1e,0,0x1f,0x20,0,0x21,0, -0,0x22,0,0,0x18,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x23,0,0,0,0,0, +0,0,0x19,0,0,0x16,0x18,0,0,0x1a,0x18,0,0,0,0x1b,0, +0,0x1c,0x1d,0,0,0x1e,0x1d,0,0x1e,0x1f,0,0x20,0x21,0,0x22,0, +0,0x23,0,0,0x18,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0x24,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,0x24,0x24,0,0,0,0,0x25,0, -0,0,0,0,0,0x26,0,0,0,0x13,0,0,0,0,0,0, -0x27,0,0,0x28,0,0x29,0,0,0,0x24,0x2a,0x10,0,0x2b,0,0x2c, -0,0x2d,0,0,0,0,0x2e,0x2f,0,0,0,0,0,0,1,0x30, +0,0,0,0,0,0,0,0,0x25,0x25,0,0,0,0,0x26,0, +0,0,0,0,0,0x27,0,0,0,0x13,0,0,0,0,0,0, +0x28,0,0,0x29,0,0x2a,0,0,0,0x25,0x2b,0x10,0,0x2c,0,0x2d, +0,0x2e,0,0,0,0,0x2f,0x30,0,0,0,0,0,0,1,0x31, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0x31,0x32,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0x32,0x33,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,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,0x33,0,0,0,0x34,0,0,0,1, +0,0,0,0,0,0,0,0x34,0,0,0,0x35,0,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0x35,0,0,0x36,0,0,0,0,0,0,0,0,0,0,0, +0,0x36,0,0,0x37,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, @@ -101,9 +101,9 @@ const uint8_t CollationFCD::lcccIndex[2048]={ 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,0x37,0x38,0,0,0x39,0,0,0,0,0,0,0,0, -0x21,0,0,0,0,0,0x2a,0x3a,0,0x3b,0x3c,0,0,0x3c,0x3d,0, -0,0,0,0,0,0x3e,0x3f,0x40,0,0,0,0,0,0,0,0x18, +0,0,0,0x38,0x39,0,0,0x3a,0,0,0,0,0,0,0,0, +0x22,0,0,0,0,0,0x2b,0x3b,0,0x3c,0x3d,0,0,0x3d,0x3e,0, +0,0,0,0,0,0x3f,0x40,0x41,0,0,0,0,0,0,0,0x18, 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, @@ -126,7 +126,7 @@ const uint8_t CollationFCD::lcccIndex[2048]={ 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, -0x41,0x42,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x42,0x43,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, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -143,17 +143,17 @@ const uint8_t CollationFCD::lcccIndex[2048]={ 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,0x43,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x44,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -const uint32_t CollationFCD::lcccBits[68]={ +const uint32_t CollationFCD::lcccBits[69]={ 0,0xffffffff,0xffff7fff,0xffff,0xf8,0xfffe0000,0xbfffffff,0xb6,0x7ff0000,0xfffff800,0x10000,0x9fc00000,0x3d9f,0x20000,0xffff0000,0x7ff, -0xff800,0xfbc00000,0x3eef,0xe000000,0xfff00000,0xfffffffb,0x10000000,0x1e2000,0x2000,0x602000,0x400,0x7000000,0xf00,0x3000000,0x2a00000,0x3c3e0000, -0xdf,0x40,0x6800000,0xe0000000,0x100000,0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd, -0xf83fffff,0x1fff0000,0x1ffe2,0x38000,0x80000000,0xfc00,0x6000000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000,2, -0x400000,0x40000b5,0x5108000,0x40000000 +0xff800,0xfbc00000,0x3eef,0xe000000,0xfff00000,0xfffffffb,0x10000000,0x1e2000,0x2000,0x602000,0x18000000,0x400,0x7000000,0xf00,0x3000000,0x2a00000, +0x3c3e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000,0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000, +0x31021fd,0xfbffffff,0x1fff0000,0x1ffe2,0x38000,0x80000000,0xfc00,0x6000000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000, +2,0x400000,0x40000f5,0x5108000,0x40000000 }; const uint8_t CollationFCD::tcccIndex[2048]={ @@ -163,25 +163,25 @@ const uint8_t CollationFCD::tcccIndex[2048]={ 0x1c,0x1d,0x1e,0x1f,0,0,0x20,0x21,0x22,0x23,0x24,0,0,0,0,0x25, 0x26,0x27,0x28,0,0,0,0x29,0x2a,0,0x2b,0x2c,0,0,0x2d,0x2e,0, 0,0x2f,0x30,0,0,0x2d,0x31,0,0,0x2d,0x32,0,0,0,0x31,0, -0,0,0x33,0,0,0x2d,0x31,0,0,0,0x31,0,0,0,0x34,0, -0,0x35,0x36,0,0,0x37,0x36,0,0x37,0x38,0,0x39,0x3a,0,0x3b,0, -0,0x3c,0,0,0x31,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0x3d,0,0,0,0,0, +0,0,0x33,0,0,0x2d,0x31,0,0,0x34,0x31,0,0,0,0x35,0, +0,0x36,0x37,0,0,0x38,0x37,0,0x38,0x39,0,0x3a,0x3b,0,0x3c,0, +0,0x3d,0,0,0x31,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0x3e,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,0x3e,0x3e,0,0,0,0,0x3f,0, -0,0,0,0,0,0x40,0,0,0,0x28,0,0,0,0,0,0, -0x41,0,0,0x42,0,0x43,0,0,0,0x3e,0x44,0x25,0,0x45,0,0x46, -0,0x47,0,0,0,0,0x48,0x49,0,0,0,0,0,0,1,0x4a, -1,1,1,1,0x4b,1,1,0x4c,0x4d,1,0x4e,0x4f,1,0x50,0x51,0x52, -0,0,0,0,0,0,0x53,0x54,0,0x55,0,0,0x56,0x57,0x58,0, -0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0,0x5f,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x3f,0x3f,0,0,0,0,0x40,0, +0,0,0,0,0,0x41,0,0,0,0x28,0,0,0,0,0,0, +0x42,0,0,0x43,0,0x44,0,0,0,0x3f,0x45,0x25,0,0x46,0,0x47, +0,0x48,0,0,0,0,0x49,0x4a,0,0,0,0,0,0,1,0x4b, +1,1,1,1,0x4c,1,1,0x4d,0x4e,1,0x4f,0x50,1,0x51,0x52,0x53, +0,0,0,0,0,0,0x54,0x55,0,0x56,0,0,0x57,0x58,0x59,0, +0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0,0x60,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,0x2d,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0x60,0,0,0,0x61,0,0,0,1, +0,0,0,0,0,0,0,0x61,0,0,0,0x62,0,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0x62,0x63,0x64,0x65,0x63,0x64,0x66,0,0,0,0,0,0,0,0, +0,0x63,0x64,0x65,0x66,0x64,0x65,0x67,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, @@ -240,9 +240,9 @@ const uint8_t CollationFCD::tcccIndex[2048]={ 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,0x67,0x68,0,0,0x69,0,0,0,0,0,0,0,0, -0x3b,0,0,0,0,0,0x44,0x6a,0,0x6b,0x6c,0,0,0x6c,0x6d,0, -0,0,0,0,0,0x6e,0x6f,0x70,0,0,0,0,0,0,0,0x31, +0,0,0,0x68,0x69,0,0,0x6a,0,0,0,0,0,0,0,0, +0x3c,0,0,0,0,0,0x45,0x6b,0,0x6c,0x6d,0,0,0x6d,0x6e,0, +0,0,0,0,0,0x6f,0x70,0x71,0,0,0,0,0,0,0,0x31, 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, @@ -265,7 +265,7 @@ const uint8_t CollationFCD::tcccIndex[2048]={ 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, -0x71,0x72,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0x72,0x73,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, @@ -282,20 +282,20 @@ const uint8_t CollationFCD::tcccIndex[2048]={ 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,0x3d,0x73,0x74,0,0,0,0,0, +0,0,0,0,0,0,0,0,0x3e,0x74,0x75,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xe,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -const uint32_t CollationFCD::tcccBits[117]={ +const uint32_t CollationFCD::tcccBits[118]={ 0,0xffffffff,0x3e7effbf,0xbe7effbf,0xfffcffff,0x7ef1ff3f,0xfff3f1f8,0x7fffff3f,0x18003,0xdfffe000,0xff31ffcf,0xcfffffff,0xfffc0,0xffff7fff,0xffff,0x1d760, 0x1fc00,0x187c00,0x200708b,0x2000000,0x708b0000,0xc00000,0xf8,0xfccf0006,0x33ffcfc,0xfffe0000,0xbfffffff,0xb6,0x7ff0000,0x7c,0xfffff800,0x10000, 0x9fc80005,0x3d9f,0x20000,0xffff0000,0x7ff,0xff800,0xfbc00000,0x3eef,0xe000000,0xfff00000,0xfffffffb,0x10120200,0xff1e2000,0x10000000,0xb0002000,0x10480000, -0x4e002000,0x2000,0x30002000,0x602100,0x24000400,0x7000000,0xf00,0x3000000,0x2a00000,0x3d7e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000,0x20040000, -0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd,0xf83fffff,0xbffffff,0x3ffffff,0x3f3fffff,0xaaff3f3f,0x3fffffff, -0x1fdfffff,0xefcfffde,0x1fdc7fff,0x1fff0000,0x1ffe2,0x800,0xc000000,0x4000,0xe000,0x1210,0x50,0x292,0x333e005,0x333,0xf000,0x3c0f, -0x38000,0x80000000,0xfc00,0x55555000,0x36db02a5,0x46100000,0x47900000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000,2, -0x400000,0x40000b5,0x5108000,0x5f7ffc00,0x7fdb +0x4e002000,0x2000,0x30002000,0x602100,0x18000000,0x24000400,0x7000000,0xf00,0x3000000,0x2a00000,0x3d7e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000, +0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd,0xfbffffff,0xbffffff,0x3ffffff,0x3f3fffff,0xaaff3f3f, +0x3fffffff,0x1fdfffff,0xefcfffde,0x1fdc7fff,0x1fff0000,0x1ffe2,0x800,0xc000000,0x4000,0xe000,0x1210,0x50,0x292,0x333e005,0x333,0xf000, +0x3c0f,0x38000,0x80000000,0xfc00,0x55555000,0x36db02a5,0x46100000,0x47900000,0x3ff08000,0xc0000000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000, +2,0x400000,0x40000f5,0x5108000,0x5f7ffc00,0x7fdb }; U_NAMESPACE_END diff --git a/deps/icu-small/source/i18n/collationfcd.h b/deps/icu-small/source/i18n/collationfcd.h index 150f4880c90046..ec7167d76bab75 100644 --- a/deps/icu-small/source/i18n/collationfcd.h +++ b/deps/icu-small/source/i18n/collationfcd.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationiterator.cpp b/deps/icu-small/source/i18n/collationiterator.cpp index e6e8f27e2f6b9d..961c9e9acef675 100644 --- a/deps/icu-small/source/i18n/collationiterator.cpp +++ b/deps/icu-small/source/i18n/collationiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationiterator.h b/deps/icu-small/source/i18n/collationiterator.h index 0161f5a7b16e9a..d0910ea57b40a2 100644 --- a/deps/icu-small/source/i18n/collationiterator.h +++ b/deps/icu-small/source/i18n/collationiterator.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -28,6 +28,21 @@ class SkippedState; class UCharsTrie; class UVector32; +/* Large enough for CEs of most short strings. */ +#define CEBUFFER_INITIAL_CAPACITY 40 + +// Export an explicit template instantiation of the MaybeStackArray that +// is used as a data member of CEBuffer. +// +// MSVC requires this, even though it should not be necessary. +// No direct access to the MaybeStackArray leaks out of the i18n library. +// +// See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples. +// +#if defined (_MSC_VER) +template class U_I18N_API MaybeStackArray; +#endif + /** * Collation element iterator and abstract character iterator. * @@ -36,10 +51,10 @@ class UVector32; */ class U_I18N_API CollationIterator : public UObject { private: - class CEBuffer { + class U_I18N_API CEBuffer { private: /** Large enough for CEs of most short strings. */ - static const int32_t INITIAL_CAPACITY = 40; + static const int32_t INITIAL_CAPACITY = CEBUFFER_INITIAL_CAPACITY; public: CEBuffer() : length(0) {} ~CEBuffer(); diff --git a/deps/icu-small/source/i18n/collationkeys.cpp b/deps/icu-small/source/i18n/collationkeys.cpp index 91302285d6b78f..4b9e6b59075e1d 100644 --- a/deps/icu-small/source/i18n/collationkeys.cpp +++ b/deps/icu-small/source/i18n/collationkeys.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationkeys.h b/deps/icu-small/source/i18n/collationkeys.h index 74b370e710991e..60d9e50c0d9106 100644 --- a/deps/icu-small/source/i18n/collationkeys.h +++ b/deps/icu-small/source/i18n/collationkeys.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationroot.cpp b/deps/icu-small/source/i18n/collationroot.cpp index f862e410b81cd5..71753bd6f4bf20 100644 --- a/deps/icu-small/source/i18n/collationroot.cpp +++ b/deps/icu-small/source/i18n/collationroot.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationroot.h b/deps/icu-small/source/i18n/collationroot.h index 26e5071fff8b7a..8cd3046cdf1a63 100644 --- a/deps/icu-small/source/i18n/collationroot.h +++ b/deps/icu-small/source/i18n/collationroot.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationrootelements.cpp b/deps/icu-small/source/i18n/collationrootelements.cpp index 638a2456c82958..9b46d14144bb3d 100644 --- a/deps/icu-small/source/i18n/collationrootelements.cpp +++ b/deps/icu-small/source/i18n/collationrootelements.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationrootelements.h b/deps/icu-small/source/i18n/collationrootelements.h index 518a24fe4e0e5f..7836d8d83b4da7 100644 --- a/deps/icu-small/source/i18n/collationrootelements.h +++ b/deps/icu-small/source/i18n/collationrootelements.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationruleparser.cpp b/deps/icu-small/source/i18n/collationruleparser.cpp index ea3ea66bc08cf5..96dcc0d940b77a 100644 --- a/deps/icu-small/source/i18n/collationruleparser.cpp +++ b/deps/icu-small/source/i18n/collationruleparser.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationruleparser.h b/deps/icu-small/source/i18n/collationruleparser.h index bd393c2b6ad143..e124881fcf0a2f 100644 --- a/deps/icu-small/source/i18n/collationruleparser.h +++ b/deps/icu-small/source/i18n/collationruleparser.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationsets.cpp b/deps/icu-small/source/i18n/collationsets.cpp index 1188f310620e84..09581416a8541d 100644 --- a/deps/icu-small/source/i18n/collationsets.cpp +++ b/deps/icu-small/source/i18n/collationsets.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationsets.h b/deps/icu-small/source/i18n/collationsets.h index 070d507ebdc318..aed41f7ac8d119 100644 --- a/deps/icu-small/source/i18n/collationsets.h +++ b/deps/icu-small/source/i18n/collationsets.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationsettings.cpp b/deps/icu-small/source/i18n/collationsettings.cpp index bc1d4e63f8a2a7..534e20df3e8417 100644 --- a/deps/icu-small/source/i18n/collationsettings.cpp +++ b/deps/icu-small/source/i18n/collationsettings.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationsettings.h b/deps/icu-small/source/i18n/collationsettings.h index 1522dd58be6603..83e775d443bfd9 100644 --- a/deps/icu-small/source/i18n/collationsettings.h +++ b/deps/icu-small/source/i18n/collationsettings.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationtailoring.cpp b/deps/icu-small/source/i18n/collationtailoring.cpp index d1ffa306f1290d..78a11fbb26b87c 100644 --- a/deps/icu-small/source/i18n/collationtailoring.cpp +++ b/deps/icu-small/source/i18n/collationtailoring.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationtailoring.h b/deps/icu-small/source/i18n/collationtailoring.h index e463005e08f54a..9a636cf1eb9aa3 100644 --- a/deps/icu-small/source/i18n/collationtailoring.h +++ b/deps/icu-small/source/i18n/collationtailoring.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/collationweights.cpp b/deps/icu-small/source/i18n/collationweights.cpp index 9a7b9a9973c127..aec0037861a36f 100644 --- a/deps/icu-small/source/i18n/collationweights.cpp +++ b/deps/icu-small/source/i18n/collationweights.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: collationweights.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -527,7 +527,7 @@ CollationWeights::allocWeights(uint32_t lowerLimit, uint32_t upperLimit, int32_t #ifdef UCOL_DEBUG printf("lengthen the short ranges from %ld bytes to %ld and iterate\n", minLength, minLength+1); #endif - for(int32_t i=0; ranges[i].length==minLength; ++i) { + for(int32_t i=0; imarkAsSet(); // Everything up to first 0 is the prefix - unit->prefix = formatStr.tempSubString(0, firstIdx); + unit->prefix = positivePart.tempSubString(0, firstIdx); fixQuotes(unit->prefix); // Everything beyond the last 0 is the suffix - unit->suffix = formatStr.tempSubString(lastIdx + 1); + unit->suffix = positivePart.tempSubString(lastIdx + 1); fixQuotes(unit->suffix); // If there is effectively no prefix or suffix, ignore the actual number of @@ -804,7 +813,7 @@ static int32_t populatePrefixSuffix( // Calculate number of zeros before decimal point int32_t idx = firstIdx + 1; - while (idx <= lastIdx && formatStr.charAt(idx) == u_0) { + while (idx <= lastIdx && positivePart.charAt(idx) == u_0) { ++idx; } return (idx - firstIdx); diff --git a/deps/icu-small/source/i18n/coptccal.cpp b/deps/icu-small/source/i18n/coptccal.cpp index ce531ca0e851bd..39691217d0fcb5 100644 --- a/deps/icu-small/source/i18n/coptccal.cpp +++ b/deps/icu-small/source/i18n/coptccal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/coptccal.h b/deps/icu-small/source/i18n/coptccal.h index 523769fabe57f0..0b82c36088fb0d 100644 --- a/deps/icu-small/source/i18n/coptccal.h +++ b/deps/icu-small/source/i18n/coptccal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/cpdtrans.cpp b/deps/icu-small/source/i18n/cpdtrans.cpp index b6e328f92c223c..a204de5a5352dd 100644 --- a/deps/icu-small/source/i18n/cpdtrans.cpp +++ b/deps/icu-small/source/i18n/cpdtrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/cpdtrans.h b/deps/icu-small/source/i18n/cpdtrans.h index 6f832df883cb85..29f3ba83fc1d57 100644 --- a/deps/icu-small/source/i18n/cpdtrans.h +++ b/deps/icu-small/source/i18n/cpdtrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csdetect.cpp b/deps/icu-small/source/i18n/csdetect.cpp index 8ddbe8129b68d7..0afecb287a7a40 100644 --- a/deps/icu-small/source/i18n/csdetect.cpp +++ b/deps/icu-small/source/i18n/csdetect.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csdetect.h b/deps/icu-small/source/i18n/csdetect.h index d0dc0d20777d44..d4bfa75eef25fe 100644 --- a/deps/icu-small/source/i18n/csdetect.h +++ b/deps/icu-small/source/i18n/csdetect.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csmatch.cpp b/deps/icu-small/source/i18n/csmatch.cpp index ea8d37cd202703..7ed6e0ee1a8d53 100644 --- a/deps/icu-small/source/i18n/csmatch.cpp +++ b/deps/icu-small/source/i18n/csmatch.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csmatch.h b/deps/icu-small/source/i18n/csmatch.h index a94b86ae7c0ca4..0dc0a9e468c5dd 100644 --- a/deps/icu-small/source/i18n/csmatch.h +++ b/deps/icu-small/source/i18n/csmatch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csr2022.cpp b/deps/icu-small/source/i18n/csr2022.cpp index 9566ee479612be..aa7f8446eb947c 100644 --- a/deps/icu-small/source/i18n/csr2022.cpp +++ b/deps/icu-small/source/i18n/csr2022.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csr2022.h b/deps/icu-small/source/i18n/csr2022.h index 9ff2648505f141..6d5b7bffccacc5 100644 --- a/deps/icu-small/source/i18n/csr2022.h +++ b/deps/icu-small/source/i18n/csr2022.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrecog.cpp b/deps/icu-small/source/i18n/csrecog.cpp index 7ae7765399f20a..d02be2bef68666 100644 --- a/deps/icu-small/source/i18n/csrecog.cpp +++ b/deps/icu-small/source/i18n/csrecog.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrecog.h b/deps/icu-small/source/i18n/csrecog.h index 1759ca561b363a..51c25396adbe14 100644 --- a/deps/icu-small/source/i18n/csrecog.h +++ b/deps/icu-small/source/i18n/csrecog.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrmbcs.cpp b/deps/icu-small/source/i18n/csrmbcs.cpp index d61269f5e33770..0c2df594d56a75 100644 --- a/deps/icu-small/source/i18n/csrmbcs.cpp +++ b/deps/icu-small/source/i18n/csrmbcs.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrmbcs.h b/deps/icu-small/source/i18n/csrmbcs.h index 6a49a859724be8..8ccf1d56a95f65 100644 --- a/deps/icu-small/source/i18n/csrmbcs.h +++ b/deps/icu-small/source/i18n/csrmbcs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrsbcs.cpp b/deps/icu-small/source/i18n/csrsbcs.cpp index 48e7dc51233c53..3d0b7269ccac3b 100644 --- a/deps/icu-small/source/i18n/csrsbcs.cpp +++ b/deps/icu-small/source/i18n/csrsbcs.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrsbcs.h b/deps/icu-small/source/i18n/csrsbcs.h index 2f967dd9c2888d..bae124c05a8426 100644 --- a/deps/icu-small/source/i18n/csrsbcs.h +++ b/deps/icu-small/source/i18n/csrsbcs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrucode.cpp b/deps/icu-small/source/i18n/csrucode.cpp index 201b2996c78cab..b84011c259095a 100644 --- a/deps/icu-small/source/i18n/csrucode.cpp +++ b/deps/icu-small/source/i18n/csrucode.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrucode.h b/deps/icu-small/source/i18n/csrucode.h index 10e5fafe66febd..4465bf35a1a917 100644 --- a/deps/icu-small/source/i18n/csrucode.h +++ b/deps/icu-small/source/i18n/csrucode.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrutf8.cpp b/deps/icu-small/source/i18n/csrutf8.cpp index 4f29fa2af7fe28..bc06fa8bb8dd4e 100644 --- a/deps/icu-small/source/i18n/csrutf8.cpp +++ b/deps/icu-small/source/i18n/csrutf8.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/csrutf8.h b/deps/icu-small/source/i18n/csrutf8.h index 71309eade75657..dc4f79b8246118 100644 --- a/deps/icu-small/source/i18n/csrutf8.h +++ b/deps/icu-small/source/i18n/csrutf8.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/curramt.cpp b/deps/icu-small/source/i18n/curramt.cpp index 4475ff611eeec0..019c17df8e3379 100644 --- a/deps/icu-small/source/i18n/curramt.cpp +++ b/deps/icu-small/source/i18n/curramt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -19,12 +19,12 @@ U_NAMESPACE_BEGIN -CurrencyAmount::CurrencyAmount(const Formattable& amount, const UChar* isoCode, +CurrencyAmount::CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode, UErrorCode& ec) : Measure(amount, new CurrencyUnit(isoCode, ec), ec) { } -CurrencyAmount::CurrencyAmount(double amount, const UChar* isoCode, +CurrencyAmount::CurrencyAmount(double amount, ConstChar16Ptr isoCode, UErrorCode& ec) : Measure(Formattable(amount), new CurrencyUnit(isoCode, ec), ec) { } diff --git a/deps/icu-small/source/i18n/currfmt.cpp b/deps/icu-small/source/i18n/currfmt.cpp index b92aa00e5cb8b5..06bdad042aad0e 100644 --- a/deps/icu-small/source/i18n/currfmt.cpp +++ b/deps/icu-small/source/i18n/currfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/currfmt.h b/deps/icu-small/source/i18n/currfmt.h index 83e027246562eb..97d44cbb1d146f 100644 --- a/deps/icu-small/source/i18n/currfmt.h +++ b/deps/icu-small/source/i18n/currfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/currpinf.cpp b/deps/icu-small/source/i18n/currpinf.cpp index 7c16fff961dc40..5d3ca620891500 100644 --- a/deps/icu-small/source/i18n/currpinf.cpp +++ b/deps/icu-small/source/i18n/currpinf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -20,6 +20,7 @@ #include "unicode/locid.h" #include "unicode/plurrule.h" +#include "unicode/strenum.h" #include "unicode/ures.h" #include "unicode/numsys.h" #include "cstring.h" diff --git a/deps/icu-small/source/i18n/currunit.cpp b/deps/icu-small/source/i18n/currunit.cpp index f538d65ada657d..83429c01694acc 100644 --- a/deps/icu-small/source/i18n/currunit.cpp +++ b/deps/icu-small/source/i18n/currunit.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -16,13 +16,14 @@ #include "unicode/currunit.h" #include "unicode/ustring.h" +#include "cstring.h" U_NAMESPACE_BEGIN -CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) { +CurrencyUnit::CurrencyUnit(ConstChar16Ptr _isoCode, UErrorCode& ec) { *isoCode = 0; if (U_SUCCESS(ec)) { - if (_isoCode && u_strlen(_isoCode)==3) { + if (_isoCode != nullptr && u_strlen(_isoCode)==3) { u_strcpy(isoCode, _isoCode); char simpleIsoCode[4]; u_UCharsToChars(isoCode, simpleIsoCode, 4); @@ -33,11 +34,30 @@ CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) { } } -CurrencyUnit::CurrencyUnit(const CurrencyUnit& other) : - MeasureUnit(other) { +CurrencyUnit::CurrencyUnit(const CurrencyUnit& other) : MeasureUnit(other) { u_strcpy(isoCode, other.isoCode); } +CurrencyUnit::CurrencyUnit(const MeasureUnit& other, UErrorCode& ec) : MeasureUnit(other) { + // Make sure this is a currency. + // OK to hard-code the string because we are comparing against another hard-coded string. + if (uprv_strcmp("currency", getType()) != 0) { + ec = U_ILLEGAL_ARGUMENT_ERROR; + isoCode[0] = 0; + } else { + // Get the ISO Code from the subtype field. + u_charsToUChars(getSubtype(), isoCode, 4); + isoCode[3] = 0; // make 100% sure it is NUL-terminated + } +} + +CurrencyUnit::CurrencyUnit() : MeasureUnit() { + u_strcpy(isoCode, u"XXX"); + char simpleIsoCode[4]; + u_UCharsToChars(isoCode, simpleIsoCode, 4); + initCurrency(simpleIsoCode); +} + CurrencyUnit& CurrencyUnit::operator=(const CurrencyUnit& other) { if (this == &other) { return *this; diff --git a/deps/icu-small/source/i18n/dangical.cpp b/deps/icu-small/source/i18n/dangical.cpp index 3a7b2ebb8fca2d..bc3951f210ec45 100644 --- a/deps/icu-small/source/i18n/dangical.cpp +++ b/deps/icu-small/source/i18n/dangical.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/dangical.h b/deps/icu-small/source/i18n/dangical.h index 17a5004bdc6d32..1a1e06b9020295 100644 --- a/deps/icu-small/source/i18n/dangical.h +++ b/deps/icu-small/source/i18n/dangical.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** diff --git a/deps/icu-small/source/i18n/datefmt.cpp b/deps/icu-small/source/i18n/datefmt.cpp index 00f46cfdfdf2c0..58696f6e93dfd5 100644 --- a/deps/icu-small/source/i18n/datefmt.cpp +++ b/deps/icu-small/source/i18n/datefmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -80,7 +80,7 @@ class U_I18N_API DateFmtBestPatternKey : public LocaleCacheKey::hashCode() + fSkeleton.hashCode(); + return (int32_t)(37u * (uint32_t)LocaleCacheKey::hashCode() + (uint32_t)fSkeleton.hashCode()); } virtual UBool operator==(const CacheKeyBase &other) const { // reflexive @@ -498,7 +498,7 @@ DateFormat* U_EXPORT2 DateFormat::create(EStyle timeStyle, EStyle dateStyle, const Locale& locale) { UErrorCode status = U_ZERO_ERROR; -#if U_PLATFORM_HAS_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API char buffer[8]; int32_t count = locale.getKeywordValue("compat", buffer, sizeof(buffer), status); @@ -586,6 +586,7 @@ DateFormat::adoptNumberFormat(NumberFormat* newNumberFormat) delete fNumberFormat; fNumberFormat = newNumberFormat; newNumberFormat->setParseIntegerOnly(TRUE); + newNumberFormat->setGroupingUsed(FALSE); } //---------------------------------------------------------------------- @@ -738,7 +739,7 @@ DateFormat::setBooleanAttribute(UDateFormatBooleanAttribute attr, UBool DateFormat::getBooleanAttribute(UDateFormatBooleanAttribute attr, UErrorCode &/*status*/) const { - return fBoolFlags.get(attr); + return static_cast(fBoolFlags.get(attr)); } U_NAMESPACE_END diff --git a/deps/icu-small/source/i18n/dayperiodrules.cpp b/deps/icu-small/source/i18n/dayperiodrules.cpp index 30414823efdfe3..e364ecb708cf66 100644 --- a/deps/icu-small/source/i18n/dayperiodrules.cpp +++ b/deps/icu-small/source/i18n/dayperiodrules.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -174,7 +174,7 @@ struct DayPeriodRulesDataSink : public ResourceSink { } } - void addCutoff(CutoffType type, UnicodeString hour_str, UErrorCode &errorCode) { + void addCutoff(CutoffType type, const UnicodeString &hour_str, UErrorCode &errorCode) { if (U_FAILURE(errorCode)) { return; } if (type == CUTOFF_TYPE_UNKNOWN) { @@ -340,7 +340,7 @@ const DayPeriodRules *DayPeriodRules::getInstance(const Locale &locale, UErrorCo // does), return NULL. if(U_FAILURE(errorCode)) { return NULL; } - const char *localeCode = locale.getName(); + const char *localeCode = locale.getBaseName(); char name[ULOC_FULLNAME_CAPACITY]; char parentName[ULOC_FULLNAME_CAPACITY]; diff --git a/deps/icu-small/source/i18n/dayperiodrules.h b/deps/icu-small/source/i18n/dayperiodrules.h index 3c006cdc2f59dd..610c6175bf5fb9 100644 --- a/deps/icu-small/source/i18n/dayperiodrules.h +++ b/deps/icu-small/source/i18n/dayperiodrules.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/dcfmtimp.h b/deps/icu-small/source/i18n/dcfmtimp.h index 58858728419641..e582efb344b3b8 100644 --- a/deps/icu-small/source/i18n/dcfmtimp.h +++ b/deps/icu-small/source/i18n/dcfmtimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/dcfmtsym.cpp b/deps/icu-small/source/i18n/dcfmtsym.cpp index b8b9c32a42fa25..f840fde2abaca3 100644 --- a/deps/icu-small/source/i18n/dcfmtsym.cpp +++ b/deps/icu-small/source/i18n/dcfmtsym.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -97,9 +97,7 @@ static const char *gNumberElementKeys[DecimalFormatSymbols::kFormatSymbolCount] // Initializes this with the decimal format symbols in the default locale. DecimalFormatSymbols::DecimalFormatSymbols(UErrorCode& status) - : UObject(), - locale() -{ + : UObject(), locale() { initialize(locale, status, TRUE); } @@ -107,16 +105,17 @@ DecimalFormatSymbols::DecimalFormatSymbols(UErrorCode& status) // Initializes this with the decimal format symbols in the desired locale. DecimalFormatSymbols::DecimalFormatSymbols(const Locale& loc, UErrorCode& status) - : UObject(), - locale(loc) -{ + : UObject(), locale(loc) { initialize(locale, status); } +DecimalFormatSymbols::DecimalFormatSymbols(const Locale& loc, const NumberingSystem& ns, UErrorCode& status) + : UObject(), locale(loc) { + initialize(locale, status, FALSE, &ns); +} + DecimalFormatSymbols::DecimalFormatSymbols() - : UObject(), - locale(Locale::getRoot()), - currPattern(NULL) { + : UObject(), locale(Locale::getRoot()), currPattern(NULL) { *validLocale = *actualLocale = 0; initialize(); } @@ -342,7 +341,8 @@ CurrencySpacingSink::~CurrencySpacingSink() {} } // namespace void -DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status, UBool useLastResortData) +DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status, + UBool useLastResortData, const NumberingSystem* ns) { if (U_FAILURE(status)) { return; } *validLocale = *actualLocale = 0; @@ -355,7 +355,13 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status, UBool us // Next get the numbering system for this locale and set zero digit // and the digit string based on the numbering system for the locale // - LocalPointer ns(NumberingSystem::createInstance(loc, status)); + LocalPointer nsLocal; + if (ns == nullptr) { + // Use the numbering system according to the locale. + // Save it into a LocalPointer so it gets cleaned up. + nsLocal.adoptInstead(NumberingSystem::createInstance(loc, status)); + ns = nsLocal.getAlias(); + } const char *nsName; if (U_SUCCESS(status) && ns->getRadix() == 10 && !ns->isAlgorithmic()) { nsName = ns->getName(); @@ -433,12 +439,13 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status, UBool us UErrorCode internalStatus = U_ZERO_ERROR; // don't propagate failures out UChar curriso[4]; UnicodeString tempStr; - ucurr_forLocale(locStr, curriso, 4, &internalStatus); - - uprv_getStaticCurrencyName(curriso, locStr, tempStr, internalStatus); - if (U_SUCCESS(internalStatus)) { - fSymbols[kIntlCurrencySymbol].setTo(curriso, -1); - fSymbols[kCurrencySymbol] = tempStr; + int32_t currisoLength = ucurr_forLocale(locStr, curriso, UPRV_LENGTHOF(curriso), &internalStatus); + if (U_SUCCESS(internalStatus) && currisoLength == 3) { + uprv_getStaticCurrencyName(curriso, locStr, tempStr, internalStatus); + if (U_SUCCESS(internalStatus)) { + fSymbols[kIntlCurrencySymbol].setTo(curriso, currisoLength); + fSymbols[kCurrencySymbol] = tempStr; + } } /* else use the default values. */ diff --git a/deps/icu-small/source/i18n/decContext.c b/deps/icu-small/source/i18n/decContext.cpp similarity index 99% rename from deps/icu-small/source/i18n/decContext.c rename to deps/icu-small/source/i18n/decContext.cpp index 498e1fede9a994..bead83efff7b83 100644 --- a/deps/icu-small/source/i18n/decContext.c +++ b/deps/icu-small/source/i18n/decContext.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ------------------------------------------------------------------ */ /* Decimal Context module */ diff --git a/deps/icu-small/source/i18n/decContext.h b/deps/icu-small/source/i18n/decContext.h index 62123ff440a903..1fd18e5d3df537 100644 --- a/deps/icu-small/source/i18n/decContext.h +++ b/deps/icu-small/source/i18n/decContext.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ------------------------------------------------------------------ */ /* Decimal Context module header */ diff --git a/deps/icu-small/source/i18n/decNumber.c b/deps/icu-small/source/i18n/decNumber.cpp similarity index 99% rename from deps/icu-small/source/i18n/decNumber.c rename to deps/icu-small/source/i18n/decNumber.cpp index b25845e0aacceb..363f93ea72de40 100644 --- a/deps/icu-small/source/i18n/decNumber.c +++ b/deps/icu-small/source/i18n/decNumber.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ------------------------------------------------------------------ */ /* Decimal Number arithmetic module */ @@ -386,7 +386,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberFromUInt32(decNumber *dn, uInt uin) { *up=(Unit)(uin%(DECDPUNMAX+1)); uin=uin/(DECDPUNMAX+1); } - dn->digits=decGetDigits(dn->lsu, up-dn->lsu); + dn->digits=decGetDigits(dn->lsu, static_cast(up - dn->lsu)); return dn; } /* decNumberFromUInt32 */ @@ -666,7 +666,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberFromString(decNumber *dn, const char /* Handle decimal point... */ if (dotchar!=NULL && dotchar(last-dotchar); /* adjust exponent */ /* [we can now ignore the .] */ /* OK, the digits string is good. Assemble in the decNumber, or in */ @@ -866,7 +866,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberAnd(decNumber *res, const decNumber * } /* both OK */ } /* each unit */ /* [here uc-1 is the msu of the result] */ - res->digits=decGetDigits(res->lsu, uc-res->lsu); + res->digits=decGetDigits(res->lsu, static_cast(uc - res->lsu)); res->exponent=0; /* integer */ res->bits=0; /* sign=0 */ return res; /* [no status to set] */ @@ -1253,7 +1253,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberInvert(decNumber *res, const decNumbe } /* each digit */ } /* each unit */ /* [here uc-1 is the msu of the result] */ - res->digits=decGetDigits(res->lsu, uc-res->lsu); + res->digits=decGetDigits(res->lsu, static_cast(uc - res->lsu)); res->exponent=0; /* integer */ res->bits=0; /* sign=0 */ return res; /* [no status to set] */ @@ -1880,7 +1880,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberOr(decNumber *res, const decNumber *l } /* non-zero */ } /* each unit */ /* [here uc-1 is the msu of the result] */ - res->digits=decGetDigits(res->lsu, uc-res->lsu); + res->digits=decGetDigits(res->lsu, static_cast(uc-res->lsu)); res->exponent=0; /* integer */ res->bits=0; /* sign=0 */ return res; /* [no status to set] */ @@ -2586,7 +2586,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberRotate(decNumber *res, const decNumbe } /* whole units to rotate */ /* the rotation may have left an undetermined number of zeros */ /* on the left, so true length needs to be calculated */ - res->digits=decGetDigits(res->lsu, msumax-res->lsu+1); + res->digits=decGetDigits(res->lsu, static_cast(msumax-res->lsu+1)); } /* rotate needed */ } /* rhs OK */ } /* numerics */ @@ -3310,7 +3310,7 @@ U_CAPI decNumber * U_EXPORT2 uprv_decNumberXor(decNumber *res, const decNumber * } /* non-zero */ } /* each unit */ /* [here uc-1 is the msu of the result] */ - res->digits=decGetDigits(res->lsu, uc-res->lsu); + res->digits=decGetDigits(res->lsu, static_cast(uc-res->lsu)); res->exponent=0; /* integer */ res->bits=0; /* sign=0 */ return res; /* [no status to set] */ @@ -5007,7 +5007,7 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs, /* Make sure no signed int overflow below. This is always true */ /* if the given numbers have less digits than DEC_MAX_DIGITS. */ - U_ASSERT(iacc <= INT32_MAX/sizeof(uLong)); + U_ASSERT((uint32_t)iacc <= INT32_MAX/sizeof(uLong)); needbytes=iacc*sizeof(uLong); #if DECDPUN==1 zoff=(iacc+7)/8; /* items to offset by */ @@ -5101,7 +5101,7 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs, } /* p */ *up=(Unit)item; up++; /* [final needs no division] */ } /* lp */ - accunits=up-acc; /* count of units */ + accunits = static_cast(up-acc); /* count of units */ } else { /* here to use units directly, without chunking ['old code'] */ #endif @@ -6587,11 +6587,11 @@ static Int decUnitAddSub(const Unit *a, Int alength, /* OK, all A and B processed; might still have carry or borrow */ /* return number of Units in the result, negated if a borrow */ - if (carry==0) return c-clsu; /* no carry, so no more to do */ + if (carry==0) return static_cast(c-clsu); /* no carry, so no more to do */ if (carry>0) { /* positive carry */ *c=(Unit)carry; /* place as new unit */ c++; /* .. */ - return c-clsu; + return static_cast(c-clsu); } /* -ve carry: it's a borrow; complement needed */ add=1; /* temporary carry... */ @@ -6614,7 +6614,7 @@ static Int decUnitAddSub(const Unit *a, Int alength, *c=(Unit)(add-carry-1); c++; /* interesting, include it */ } - return clsu-c; /* -ve result indicates borrowed */ + return static_cast(clsu-c); /* -ve result indicates borrowed */ } /* decUnitAddSub */ /* ------------------------------------------------------------------ */ @@ -6798,7 +6798,7 @@ static Int decShiftToLeast(Unit *uar, Int units, Int shift) { if (cut==DECDPUN) { /* unit-boundary case; easy */ up=uar+D2U(shift); for (; up(target-uar); } /* messier */ @@ -6826,7 +6826,7 @@ static Int decShiftToLeast(Unit *uar, Int units, Int shift) { count-=cut; if (count<=0) break; } - return target-uar+1; + return static_cast(target-uar+1); } /* decShiftToLeast */ #if DECSUBSET @@ -7690,7 +7690,7 @@ static decNumber *decDecap(decNumber *dn, Int drop) { cut=MSUDIGITS(dn->digits-drop); /* digits to be in use in msu */ if (cut!=DECDPUN) *msu%=powers[cut]; /* clear left digits */ /* that may have left leading zero digits, so do a proper count... */ - dn->digits=decGetDigits(dn->lsu, msu-dn->lsu+1); + dn->digits=decGetDigits(dn->lsu, static_cast(msu-dn->lsu+1)); return dn; } /* decDecap */ diff --git a/deps/icu-small/source/i18n/decNumber.h b/deps/icu-small/source/i18n/decNumber.h index 90269d9f66ebfd..92be8e8c0acd64 100644 --- a/deps/icu-small/source/i18n/decNumber.h +++ b/deps/icu-small/source/i18n/decNumber.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ------------------------------------------------------------------ */ /* Decimal Number arithmetic module header */ diff --git a/deps/icu-small/source/i18n/decNumberLocal.h b/deps/icu-small/source/i18n/decNumberLocal.h index 294d5f519da6df..a45b7d8cc63ef2 100644 --- a/deps/icu-small/source/i18n/decNumberLocal.h +++ b/deps/icu-small/source/i18n/decNumberLocal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ------------------------------------------------------------------ */ /* decNumber package local type, tuning, and macro definitions */ diff --git a/deps/icu-small/source/i18n/decfmtst.cpp b/deps/icu-small/source/i18n/decfmtst.cpp index 4af758787720bb..5943affad4eb06 100644 --- a/deps/icu-small/source/i18n/decfmtst.cpp +++ b/deps/icu-small/source/i18n/decfmtst.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -71,7 +71,7 @@ static const UChar gStrictDashEquivalentsPattern[] = { // [ \ - MINUS ] 0x005B, 0x005C, 0x002D, 0x2212, 0x005D, 0x0000}; -static UChar32 gMinusSigns[] = { +static const UChar32 gMinusSigns[] = { 0x002D, 0x207B, 0x208B, @@ -80,7 +80,7 @@ static UChar32 gMinusSigns[] = { 0xFE63, 0xFF0D}; -static UChar32 gPlusSigns[] = { +static const UChar32 gPlusSigns[] = { 0x002B, 0x207A, 0x208A, diff --git a/deps/icu-small/source/i18n/decfmtst.h b/deps/icu-small/source/i18n/decfmtst.h index 719f0aa9761319..63ae50c6df904a 100644 --- a/deps/icu-small/source/i18n/decfmtst.h +++ b/deps/icu-small/source/i18n/decfmtst.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/decimalformatpattern.cpp b/deps/icu-small/source/i18n/decimalformatpattern.cpp index ca90e968a118a0..c7ec5cd966a3ec 100644 --- a/deps/icu-small/source/i18n/decimalformatpattern.cpp +++ b/deps/icu-small/source/i18n/decimalformatpattern.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/decimalformatpattern.h b/deps/icu-small/source/i18n/decimalformatpattern.h index 2ebbdf9ffcad97..1c297575ead1e7 100644 --- a/deps/icu-small/source/i18n/decimalformatpattern.h +++ b/deps/icu-small/source/i18n/decimalformatpattern.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/decimalformatpatternimpl.h b/deps/icu-small/source/i18n/decimalformatpatternimpl.h index 67bc96db6181a7..8cecc8cca02c72 100644 --- a/deps/icu-small/source/i18n/decimalformatpatternimpl.h +++ b/deps/icu-small/source/i18n/decimalformatpatternimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/decimfmt.cpp b/deps/icu-small/source/i18n/decimfmt.cpp index 440adf5a6bfdae..80a9446e146f6c 100644 --- a/deps/icu-small/source/i18n/decimfmt.cpp +++ b/deps/icu-small/source/i18n/decimfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -49,6 +49,7 @@ #include "unicode/utf16.h" #include "unicode/numsys.h" #include "unicode/localpointer.h" +#include "unicode/ustring.h" #include "uresimp.h" #include "ucurrimp.h" #include "charstr.h" @@ -1422,8 +1423,8 @@ UBool DecimalFormat::subparse(const UnicodeString& text, UBool strictFail = FALSE; // did we exit with a strict parse failure? - int32_t lastGroup = -1; // where did we last see a grouping separator? - int32_t digitStart = position; + int32_t lastGroup = -1; // after which digit index did we last see a grouping separator? + int32_t currGroup = -1; // for temporary storage the digit index of the current grouping separator int32_t gs2 = fImpl->fEffGrouping.fGrouping2 == 0 ? fImpl->fEffGrouping.fGrouping : fImpl->fEffGrouping.fGrouping2; const UnicodeString *decimalString; @@ -1512,16 +1513,17 @@ UBool DecimalFormat::subparse(const UnicodeString& text, // before that, the group must == the secondary group // length, else it can be <= the the secondary group // length. - if ((lastGroup != -1 && backup - lastGroup - 1 != gs2) || - (lastGroup == -1 && position - digitStart - 1 > gs2)) { + if ((lastGroup != -1 && currGroup - lastGroup != gs2) || + (lastGroup == -1 && digitCount - 1 > gs2)) { strictFail = TRUE; break; } - lastGroup = backup; + lastGroup = currGroup; } // Cancel out backup setting (see grouping handler below) + currGroup = -1; backup = -1; sawDigit = TRUE; @@ -1560,6 +1562,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, // Ignore grouping characters, if we are using them, but require // that they be followed by a digit. Otherwise we backup and // reprocess them. + currGroup = digitCount; backup = position; position += groupingStringLength; sawGrouping=TRUE; @@ -1570,7 +1573,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, { if (strictParse) { if (backup != -1 || - (lastGroup != -1 && position - lastGroup != fImpl->fEffGrouping.fGrouping + 1)) { + (lastGroup != -1 && digitCount - lastGroup != fImpl->fEffGrouping.fGrouping)) { strictFail = TRUE; break; } @@ -1621,7 +1624,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, UBool sawExponentDigit = FALSE; while (pos < textLength) { - ch = text[(int32_t)pos]; + ch = text.char32At(pos); digit = ch - zero; if (digit < 0 || digit > 9) { @@ -1633,7 +1636,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, parsedNum.append(exponentSign, err); sawExponentDigit = TRUE; } - ++pos; + pos += U16_LENGTH(ch); parsedNum.append((char)(digit + '0'), err); } else { break; @@ -1672,7 +1675,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, } if (strictParse && !sawDecimal) { - if (lastGroup != -1 && position - lastGroup != fImpl->fEffGrouping.fGrouping + 1) { + if (lastGroup != -1 && digitCount - lastGroup != fImpl->fEffGrouping.fGrouping) { strictFail = TRUE; } } @@ -2542,7 +2545,7 @@ UnicodeString DecimalFormat::getPadCharacterString() const { } void DecimalFormat::setPadCharacter(const UnicodeString &padChar) { - UChar pad; + UChar32 pad; if (padChar.length() > 0) { pad = padChar.char32At(0); } @@ -2791,7 +2794,7 @@ DecimalFormat::setDecimalSeparatorAlwaysShown(UBool newValue) UBool DecimalFormat::isDecimalPatternMatchRequired(void) const { - return fBoolFlags.contains(UNUM_PARSE_DECIMAL_MARK_REQUIRED); + return static_cast(fBoolFlags.contains(UNUM_PARSE_DECIMAL_MARK_REQUIRED)); } //------------------------------------------------------------------------------ diff --git a/deps/icu-small/source/i18n/decimfmtimpl.cpp b/deps/icu-small/source/i18n/decimfmtimpl.cpp index 342ce5b5e4ed1f..ef44eab0101453 100644 --- a/deps/icu-small/source/i18n/decimfmtimpl.cpp +++ b/deps/icu-small/source/i18n/decimfmtimpl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines @@ -521,7 +521,8 @@ static FixedDecimal &initFixedDecimal( const VisibleDigits &digits, FixedDecimal &result) { result.source = 0.0; result.isNegative = digits.isNegative(); - result.isNanOrInfinity = digits.isNaNOrInfinity(); + result._isNaN = digits.isNaN(); + result._isInfinite = digits.isInfinite(); digits.getFixedDecimal( result.source, result.intValue, result.decimalDigits, result.decimalDigitsWithoutTrailingZeros, @@ -1382,8 +1383,8 @@ DecimalFormatImpl::toNumberPattern( DigitInterval maxInterval; // Only for significant digits - int32_t sigMin; - int32_t sigMax; + int32_t sigMin = 0; /* initialize to avoid compiler warning */ + int32_t sigMax = 0; /* initialize to avoid compiler warning */ // These are all the digits to be displayed. For significant digits, // this interval always starts at the 1's place an extends left. diff --git a/deps/icu-small/source/i18n/decimfmtimpl.h b/deps/icu-small/source/i18n/decimfmtimpl.h index 537107c6f74de4..b4438cba9e1ea8 100644 --- a/deps/icu-small/source/i18n/decimfmtimpl.h +++ b/deps/icu-small/source/i18n/decimfmtimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/digitaffix.cpp b/deps/icu-small/source/i18n/digitaffix.cpp index 262bc49427062a..396df2cf1d75eb 100644 --- a/deps/icu-small/source/i18n/digitaffix.cpp +++ b/deps/icu-small/source/i18n/digitaffix.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/digitaffix.h b/deps/icu-small/source/i18n/digitaffix.h index a1a100654f4e84..005c36f8488d8f 100644 --- a/deps/icu-small/source/i18n/digitaffix.h +++ b/deps/icu-small/source/i18n/digitaffix.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/digitaffixesandpadding.cpp b/deps/icu-small/source/i18n/digitaffixesandpadding.cpp index 716ab4a32ebfb3..487d9a345d3e21 100644 --- a/deps/icu-small/source/i18n/digitaffixesandpadding.cpp +++ b/deps/icu-small/source/i18n/digitaffixesandpadding.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/digitaffixesandpadding.h b/deps/icu-small/source/i18n/digitaffixesandpadding.h index e837e07c8fbe0e..d570599d180e77 100644 --- a/deps/icu-small/source/i18n/digitaffixesandpadding.h +++ b/deps/icu-small/source/i18n/digitaffixesandpadding.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/digitformatter.cpp b/deps/icu-small/source/i18n/digitformatter.cpp index d1a88f95eee80f..0d857f8f6873c6 100644 --- a/deps/icu-small/source/i18n/digitformatter.cpp +++ b/deps/icu-small/source/i18n/digitformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines @@ -177,7 +177,7 @@ UnicodeString &DigitFormatter::format( int32_t digitsLeftOfDecimal = interval.getMostSignificantExclusive(); int32_t lastDigitPos = interval.getLeastSignificantInclusive(); int32_t intBegin = appendTo.length(); - int32_t fracBegin; + int32_t fracBegin = 0; /* initialize to avoid compiler warning */ // Emit "0" instead of empty string. if (digitsLeftOfDecimal == 0 && lastDigitPos == 0) { diff --git a/deps/icu-small/source/i18n/digitformatter.h b/deps/icu-small/source/i18n/digitformatter.h index d92d4251513f38..54a54c3639a629 100644 --- a/deps/icu-small/source/i18n/digitformatter.h +++ b/deps/icu-small/source/i18n/digitformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/digitgrouping.cpp b/deps/icu-small/source/i18n/digitgrouping.cpp index 0d96b407c5039f..cffa122b6ceaf6 100644 --- a/deps/icu-small/source/i18n/digitgrouping.cpp +++ b/deps/icu-small/source/i18n/digitgrouping.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/digitgrouping.h b/deps/icu-small/source/i18n/digitgrouping.h index 33835ff665cfb1..f3f8679b879e95 100644 --- a/deps/icu-small/source/i18n/digitgrouping.h +++ b/deps/icu-small/source/i18n/digitgrouping.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/digitinterval.cpp b/deps/icu-small/source/i18n/digitinterval.cpp index b1ba811606b371..32d952e0267950 100644 --- a/deps/icu-small/source/i18n/digitinterval.cpp +++ b/deps/icu-small/source/i18n/digitinterval.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/digitinterval.h b/deps/icu-small/source/i18n/digitinterval.h index 5dbf3f9a296f8b..95d406da206f4c 100644 --- a/deps/icu-small/source/i18n/digitinterval.h +++ b/deps/icu-small/source/i18n/digitinterval.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/digitlst.cpp b/deps/icu-small/source/i18n/digitlst.cpp index e3873eb59f2d4e..10a3a5dca1a404 100644 --- a/deps/icu-small/source/i18n/digitlst.cpp +++ b/deps/icu-small/source/i18n/digitlst.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -53,6 +53,7 @@ #if !defined(U_USE_STRTOD_L) # if U_PLATFORM_USES_ONLY_WIN32_API # define U_USE_STRTOD_L 1 +# define U_HAVE_XLOCALE_H 0 # elif defined(U_HAVE_STRTOD_L) # define U_USE_STRTOD_L U_HAVE_STRTOD_L # else @@ -61,10 +62,10 @@ #endif #if U_USE_STRTOD_L -# if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CYGWIN -# include -# else +# if U_HAVE_XLOCALE_H # include +# else +# include # endif #endif diff --git a/deps/icu-small/source/i18n/digitlst.h b/deps/icu-small/source/i18n/digitlst.h index 27e6e8c410b4ad..6befaf32e6f340 100644 --- a/deps/icu-small/source/i18n/digitlst.h +++ b/deps/icu-small/source/i18n/digitlst.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/dt_impl.h b/deps/icu-small/source/i18n/dt_impl.h index 9b01bad79edd9b..a4058c69244d0d 100644 --- a/deps/icu-small/source/i18n/dt_impl.h +++ b/deps/icu-small/source/i18n/dt_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/dtfmtsym.cpp b/deps/icu-small/source/i18n/dtfmtsym.cpp index c412c5be05242b..af421d41c72e61 100644 --- a/deps/icu-small/source/i18n/dtfmtsym.cpp +++ b/deps/icu-small/source/i18n/dtfmtsym.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -1368,7 +1368,7 @@ DateFormatSymbols::setZoneStrings(const UnicodeString* const *strings, int32_t r //------------------------------------------------------ -const UChar * U_EXPORT2 +const char16_t * U_EXPORT2 DateFormatSymbols::getPatternUChars(void) { return gPatternChars; @@ -1630,20 +1630,24 @@ struct CalendarDataSink : public ResourceSink { UnicodeString *aliasArray; Hashtable *aliasMap; if ((aliasArray = (UnicodeString*)arrays.get(*alias)) != NULL) { - // Clone the array - int32_t aliasArraySize = arraySizes.geti(*alias); - LocalArray aliasArrayCopy(new UnicodeString[aliasArraySize], errorCode); - if (U_FAILURE(errorCode)) { return; } - uprv_arrayCopy(aliasArray, aliasArrayCopy.getAlias(), aliasArraySize); - // Put the array on the 'arrays' map UnicodeString *path = (UnicodeString*)aliasPathPairs[i + 1]; - arrays.put(*path, aliasArrayCopy.orphan(), errorCode); - arraySizes.puti(*path, aliasArraySize, errorCode); + if (arrays.get(*path) == NULL) { + // Clone the array + int32_t aliasArraySize = arraySizes.geti(*alias); + LocalArray aliasArrayCopy(new UnicodeString[aliasArraySize], errorCode); + if (U_FAILURE(errorCode)) { return; } + uprv_arrayCopy(aliasArray, aliasArrayCopy.getAlias(), aliasArraySize); + // Put the array on the 'arrays' map + arrays.put(*path, aliasArrayCopy.orphan(), errorCode); + arraySizes.puti(*path, aliasArraySize, errorCode); + } if (U_FAILURE(errorCode)) { return; } mod = true; } else if ((aliasMap = (Hashtable*)maps.get(*alias)) != NULL) { UnicodeString *path = (UnicodeString*)aliasPathPairs[i + 1]; - maps.put(*path, aliasMap, errorCode); + if (maps.get(*path) == NULL) { + maps.put(*path, aliasMap, errorCode); + } if (U_FAILURE(errorCode)) { return; } mod = true; } diff --git a/deps/icu-small/source/i18n/dtitv_impl.h b/deps/icu-small/source/i18n/dtitv_impl.h index 7e5d53921e4a58..18fe0b8c9b527d 100644 --- a/deps/icu-small/source/i18n/dtitv_impl.h +++ b/deps/icu-small/source/i18n/dtitv_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/dtitvfmt.cpp b/deps/icu-small/source/i18n/dtitvfmt.cpp index 48068d3cc2da20..743b534fc8f9cf 100644 --- a/deps/icu-small/source/i18n/dtitvfmt.cpp +++ b/deps/icu-small/source/i18n/dtitvfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************************* * Copyright (C) 2008-2016, International Business Machines Corporation and diff --git a/deps/icu-small/source/i18n/dtitvinf.cpp b/deps/icu-small/source/i18n/dtitvinf.cpp index 07129db928b31a..c863a683a5c2f8 100644 --- a/deps/icu-small/source/i18n/dtitvinf.cpp +++ b/deps/icu-small/source/i18n/dtitvinf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************************* * Copyright (C) 2008-2016, International Business Machines Corporation and diff --git a/deps/icu-small/source/i18n/dtptngen.cpp b/deps/icu-small/source/i18n/dtptngen.cpp index 17e7ec7cde8a21..187342e4af2efc 100644 --- a/deps/icu-small/source/i18n/dtptngen.cpp +++ b/deps/icu-small/source/i18n/dtptngen.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -134,15 +134,18 @@ U_NAMESPACE_BEGIN // class DateTimePatternGenerator // ***************************************************************************** static const UChar Canonical_Items[] = { - // GyQMwWEdDFHmsSv - CAP_G, LOW_Y, CAP_Q, CAP_M, LOW_W, CAP_W, CAP_E, LOW_D, CAP_D, CAP_F, + // 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 CAP_H, LOW_M, LOW_S, CAP_S, LOW_V, 0 }; static const dtTypeElem dtTypes[] = { // patternChar, field, type, minLen, weight {CAP_G, UDATPG_ERA_FIELD, DT_SHORT, 1, 3,}, - {CAP_G, UDATPG_ERA_FIELD, DT_LONG, 4, 0}, + {CAP_G, UDATPG_ERA_FIELD, DT_LONG, 4, 0}, + {CAP_G, UDATPG_ERA_FIELD, DT_NARROW, 5, 0}, + {LOW_Y, UDATPG_YEAR_FIELD, DT_NUMERIC, 1, 20}, {CAP_Y, UDATPG_YEAR_FIELD, DT_NUMERIC + DT_DELTA, 1, 20}, {LOW_U, UDATPG_YEAR_FIELD, DT_NUMERIC + 2*DT_DELTA, 1, 20}, @@ -150,12 +153,16 @@ static const dtTypeElem dtTypes[] = { {CAP_U, UDATPG_YEAR_FIELD, DT_SHORT, 1, 3}, {CAP_U, UDATPG_YEAR_FIELD, DT_LONG, 4, 0}, {CAP_U, UDATPG_YEAR_FIELD, DT_NARROW, 5, 0}, + {CAP_Q, UDATPG_QUARTER_FIELD, DT_NUMERIC, 1, 2}, {CAP_Q, UDATPG_QUARTER_FIELD, DT_SHORT, 3, 0}, {CAP_Q, UDATPG_QUARTER_FIELD, DT_LONG, 4, 0}, + {CAP_Q, UDATPG_QUARTER_FIELD, DT_NARROW, 5, 0}, {LOW_Q, UDATPG_QUARTER_FIELD, DT_NUMERIC + DT_DELTA, 1, 2}, - {LOW_Q, UDATPG_QUARTER_FIELD, DT_SHORT + DT_DELTA, 3, 0}, - {LOW_Q, UDATPG_QUARTER_FIELD, DT_LONG + DT_DELTA, 4, 0}, + {LOW_Q, UDATPG_QUARTER_FIELD, DT_SHORT - DT_DELTA, 3, 0}, + {LOW_Q, UDATPG_QUARTER_FIELD, DT_LONG - DT_DELTA, 4, 0}, + {LOW_Q, UDATPG_QUARTER_FIELD, DT_NARROW - DT_DELTA, 5, 0}, + {CAP_M, UDATPG_MONTH_FIELD, DT_NUMERIC, 1, 2}, {CAP_M, UDATPG_MONTH_FIELD, DT_SHORT, 3, 0}, {CAP_M, UDATPG_MONTH_FIELD, DT_LONG, 4, 0}, @@ -165,32 +172,66 @@ static const dtTypeElem dtTypes[] = { {CAP_L, UDATPG_MONTH_FIELD, DT_LONG - DT_DELTA, 4, 0}, {CAP_L, UDATPG_MONTH_FIELD, DT_NARROW - DT_DELTA, 5, 0}, {LOW_L, UDATPG_MONTH_FIELD, DT_NUMERIC + DT_DELTA, 1, 1}, + {LOW_W, UDATPG_WEEK_OF_YEAR_FIELD, DT_NUMERIC, 1, 2}, - {CAP_W, UDATPG_WEEK_OF_MONTH_FIELD, DT_NUMERIC + DT_DELTA, 1, 0}, + + {CAP_W, UDATPG_WEEK_OF_MONTH_FIELD, DT_NUMERIC, 1, 0}, + {CAP_E, UDATPG_WEEKDAY_FIELD, DT_SHORT, 1, 3}, {CAP_E, UDATPG_WEEKDAY_FIELD, DT_LONG, 4, 0}, {CAP_E, UDATPG_WEEKDAY_FIELD, DT_NARROW, 5, 0}, + {CAP_E, UDATPG_WEEKDAY_FIELD, DT_SHORTER, 6, 0}, {LOW_C, UDATPG_WEEKDAY_FIELD, DT_NUMERIC + 2*DT_DELTA, 1, 2}, {LOW_C, UDATPG_WEEKDAY_FIELD, DT_SHORT - 2*DT_DELTA, 3, 0}, {LOW_C, UDATPG_WEEKDAY_FIELD, DT_LONG - 2*DT_DELTA, 4, 0}, {LOW_C, UDATPG_WEEKDAY_FIELD, DT_NARROW - 2*DT_DELTA, 5, 0}, + {LOW_C, UDATPG_WEEKDAY_FIELD, DT_SHORTER - 2*DT_DELTA, 6, 0}, {LOW_E, UDATPG_WEEKDAY_FIELD, DT_NUMERIC + DT_DELTA, 1, 2}, // LOW_E is currently not used in CLDR data, should not be canonical {LOW_E, UDATPG_WEEKDAY_FIELD, DT_SHORT - DT_DELTA, 3, 0}, {LOW_E, UDATPG_WEEKDAY_FIELD, DT_LONG - DT_DELTA, 4, 0}, {LOW_E, UDATPG_WEEKDAY_FIELD, DT_NARROW - DT_DELTA, 5, 0}, + {LOW_E, UDATPG_WEEKDAY_FIELD, DT_SHORTER - DT_DELTA, 6, 0}, + {LOW_D, UDATPG_DAY_FIELD, DT_NUMERIC, 1, 2}, - {CAP_D, UDATPG_DAY_OF_YEAR_FIELD, DT_NUMERIC + DT_DELTA, 1, 3}, - {CAP_F, UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD, DT_NUMERIC + 2*DT_DELTA, 1, 0}, - {LOW_G, UDATPG_DAY_FIELD, DT_NUMERIC + 3*DT_DELTA, 1, 20}, // really internal use, so we don't care - {LOW_A, UDATPG_DAYPERIOD_FIELD, DT_SHORT, 1, 0}, + {LOW_G, UDATPG_DAY_FIELD, DT_NUMERIC + DT_DELTA, 1, 20}, // really internal use, so we don't care + + {CAP_D, UDATPG_DAY_OF_YEAR_FIELD, DT_NUMERIC, 1, 3}, + + {CAP_F, UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD, DT_NUMERIC, 1, 0}, + + {LOW_A, UDATPG_DAYPERIOD_FIELD, DT_SHORT, 1, 3}, + {LOW_A, UDATPG_DAYPERIOD_FIELD, DT_LONG, 4, 0}, + {LOW_A, UDATPG_DAYPERIOD_FIELD, DT_NARROW, 5, 0}, + {LOW_B, UDATPG_DAYPERIOD_FIELD, DT_SHORT - DT_DELTA, 1, 3}, + {LOW_B, UDATPG_DAYPERIOD_FIELD, DT_LONG - DT_DELTA, 4, 0}, + {LOW_B, UDATPG_DAYPERIOD_FIELD, DT_NARROW - DT_DELTA, 5, 0}, + // b needs to be closer to a than to B, so we make this 3*DT_DELTA + {CAP_B, UDATPG_DAYPERIOD_FIELD, DT_SHORT - 3*DT_DELTA, 1, 3}, + {CAP_B, UDATPG_DAYPERIOD_FIELD, DT_LONG - 3*DT_DELTA, 4, 0}, + {CAP_B, UDATPG_DAYPERIOD_FIELD, DT_NARROW - 3*DT_DELTA, 5, 0}, + {CAP_H, UDATPG_HOUR_FIELD, DT_NUMERIC + 10*DT_DELTA, 1, 2}, // 24 hour {LOW_K, UDATPG_HOUR_FIELD, DT_NUMERIC + 11*DT_DELTA, 1, 2}, // 24 hour {LOW_H, UDATPG_HOUR_FIELD, DT_NUMERIC, 1, 2}, // 12 hour {CAP_K, UDATPG_HOUR_FIELD, DT_NUMERIC + DT_DELTA, 1, 2}, // 12 hour + // The C code has had versions of the following 3, keep & update. Should not need these, but... + // Without these, certain tests using e.g. staticGetSkeleton fail because j/J in patterns + // get skipped instead of mapped to the right hour chars, for example in + // DateFormatTest::TestPatternFromSkeleton + // IntlTestDateTimePatternGeneratorAPI:: testStaticGetSkeleton + // DateIntervalFormatTest::testTicket11985 + // Need to investigate better handling of jJC replacement e.g. in staticGetSkeleton. + {CAP_J, UDATPG_HOUR_FIELD, DT_NUMERIC + 5*DT_DELTA, 1, 2}, // 12/24 hour no AM/PM + {LOW_J, UDATPG_HOUR_FIELD, DT_NUMERIC + 6*DT_DELTA, 1, 6}, // 12/24 hour + {CAP_C, UDATPG_HOUR_FIELD, DT_NUMERIC + 7*DT_DELTA, 1, 6}, // 12/24 hour with preferred dayPeriods for 12 + {LOW_M, UDATPG_MINUTE_FIELD, DT_NUMERIC, 1, 2}, + {LOW_S, UDATPG_SECOND_FIELD, DT_NUMERIC, 1, 2}, - {CAP_S, UDATPG_FRACTIONAL_SECOND_FIELD, DT_NUMERIC + DT_DELTA, 1, 1000}, - {CAP_A, UDATPG_SECOND_FIELD, DT_NUMERIC + 2*DT_DELTA, 1, 1000}, + {CAP_A, UDATPG_SECOND_FIELD, DT_NUMERIC + DT_DELTA, 1, 1000}, + + {CAP_S, UDATPG_FRACTIONAL_SECOND_FIELD, DT_NUMERIC, 1, 1000}, + {LOW_V, UDATPG_ZONE_FIELD, DT_SHORT - 2*DT_DELTA, 1, 0}, {LOW_V, UDATPG_ZONE_FIELD, DT_LONG - 2*DT_DELTA, 4, 0}, {LOW_Z, UDATPG_ZONE_FIELD, DT_SHORT, 1, 3}, @@ -202,24 +243,27 @@ static const dtTypeElem dtTypes[] = { {CAP_O, UDATPG_ZONE_FIELD, DT_LONG - DT_DELTA, 4, 0}, {CAP_V, UDATPG_ZONE_FIELD, DT_SHORT - DT_DELTA, 1, 0}, {CAP_V, UDATPG_ZONE_FIELD, DT_LONG - DT_DELTA, 2, 0}, + {CAP_V, UDATPG_ZONE_FIELD, DT_LONG-1 - DT_DELTA, 3, 0}, + {CAP_V, UDATPG_ZONE_FIELD, DT_LONG-2 - DT_DELTA, 4, 0}, {CAP_X, UDATPG_ZONE_FIELD, DT_NARROW - DT_DELTA, 1, 0}, {CAP_X, UDATPG_ZONE_FIELD, DT_SHORT - DT_DELTA, 2, 0}, {CAP_X, UDATPG_ZONE_FIELD, DT_LONG - DT_DELTA, 4, 0}, {LOW_X, UDATPG_ZONE_FIELD, DT_NARROW - DT_DELTA, 1, 0}, {LOW_X, UDATPG_ZONE_FIELD, DT_SHORT - DT_DELTA, 2, 0}, {LOW_X, UDATPG_ZONE_FIELD, DT_LONG - DT_DELTA, 4, 0}, - {LOW_J, UDATPG_HOUR_FIELD, DT_NUMERIC, 1, 2}, // 12/24 hour - {CAP_J, UDATPG_HOUR_FIELD, DT_NUMERIC, 1, 2}, // 12/24 hour no AM/PM + {0, UDATPG_FIELD_COUNT, 0, 0, 0} , // last row of dtTypes[] }; static const char* const CLDR_FIELD_APPEND[] = { - "Era", "Year", "Quarter", "Month", "Week", "*", "Day-Of-Week", "Day", "*", "*", "*", + "Era", "Year", "Quarter", "Month", "Week", "*", "Day-Of-Week", + "*", "*", "Day", "*", // The UDATPG_x_FIELD constants and these fields have a different order than in ICU4J "Hour", "Minute", "Second", "*", "Timezone" }; static const char* const CLDR_FIELD_NAME[] = { - "era", "year", "quarter", "month", "week", "*", "weekday", "*", "*", "day", "dayperiod", + "era", "year", "quarter", "month", "week", "weekOfMonth", "weekday", + "dayOfYear", "weekdayOfMonth", "day", "dayperiod", // The UDATPG_x_FIELD constants and these fields have a different order than in ICU4J "hour", "minute", "second", "*", "zone" }; @@ -475,7 +519,7 @@ struct AllowedHourFormatsSink : public ResourceSink { } } - AllowedHourFormat getHourFormatFromUnicodeString(UnicodeString s) { + AllowedHourFormat getHourFormatFromUnicodeString(const UnicodeString &s) { if (s.length() == 1) { if (s[0] == LOW_H) { return ALLOWED_HOUR_FORMAT_h; } if (s[0] == CAP_H) { return ALLOWED_HOUR_FORMAT_H; } @@ -963,47 +1007,13 @@ DateTimePatternGenerator::getBestPattern(const UnicodeString& patternForm, UDate int32_t timeMask=(1<set(patternFormCopy, fp); + dtMatcher->set(patternFormMapped, fp); const PtnSkeleton* specifiedSkeleton=NULL; bestPattern=getBestRaw(*dtMatcher, -1, distanceInfo, &specifiedSkeleton); if ( distanceInfo->missingFieldMask==0 && distanceInfo->extraFieldMask==0 ) { @@ -1032,6 +1042,82 @@ DateTimePatternGenerator::getBestPattern(const UnicodeString& patternForm, UDate return resultPattern; } +/* + * Map a skeleton that may have metacharacters jJC to one without, by replacing + * the metacharacters with locale-appropriate fields of of h/H/k/K and of a/b/B + * (depends on fDefaultHourFormatChar and fAllowedHourFormats being set, which in + * turn depends on initData having been run). This method also updates the flags + * as necessary. Returns the updated skeleton. + */ +UnicodeString +DateTimePatternGenerator::mapSkeletonMetacharacters(const UnicodeString& patternForm, int32_t* flags, UErrorCode& status) { + UnicodeString patternFormMapped; + patternFormMapped.remove(); + UBool inQuoted = FALSE; + int32_t patPos, patLen = patternForm.length(); + for (patPos = 0; patPos < patLen; patPos++) { + UChar patChr = patternForm.charAt(patPos); + if (patChr == SINGLE_QUOTE) { + inQuoted = !inQuoted; + } else if (!inQuoted) { + // Handle special mappings for 'j' and 'C' in which fields lengths + // 1,3,5 => hour field length 1 + // 2,4,6 => hour field length 2 + // 1,2 => abbreviated dayPeriod (field length 1..3) + // 3,4 => long dayPeriod (field length 4) + // 5,6 => narrow dayPeriod (field length 5) + if (patChr == LOW_J || patChr == CAP_C) { + int32_t extraLen = 0; // 1 less than total field length + while (patPos+1 < patLen && patternForm.charAt(patPos+1)==patChr) { + extraLen++; + patPos++; + } + int32_t hourLen = 1 + (extraLen & 1); + int32_t dayPeriodLen = (extraLen < 2)? 1: 3 + (extraLen >> 1); + UChar hourChar = LOW_H; + UChar dayPeriodChar = LOW_A; + if (patChr == LOW_J) { + hourChar = fDefaultHourFormatChar; + } else { + AllowedHourFormat preferred; + if (fAllowedHourFormats[0] != ALLOWED_HOUR_FORMAT_UNKNOWN) { + preferred = (AllowedHourFormat)fAllowedHourFormats[0]; + } else { + status = U_INVALID_FORMAT_ERROR; + return UnicodeString(); + } + if (preferred == ALLOWED_HOUR_FORMAT_H || preferred == ALLOWED_HOUR_FORMAT_HB || preferred == ALLOWED_HOUR_FORMAT_Hb) { + hourChar = CAP_H; + } + // in #13183 just add b/B to skeleton, no longer need to set special flags + if (preferred == ALLOWED_HOUR_FORMAT_HB || preferred == ALLOWED_HOUR_FORMAT_hB) { + dayPeriodChar = CAP_B; + } else if (preferred == ALLOWED_HOUR_FORMAT_Hb || preferred == ALLOWED_HOUR_FORMAT_hb) { + dayPeriodChar = LOW_B; + } + } + if (hourChar==CAP_H || hourChar==LOW_K) { + dayPeriodLen = 0; + } + while (dayPeriodLen-- > 0) { + patternFormMapped.append(dayPeriodChar); + } + while (hourLen-- > 0) { + patternFormMapped.append(hourChar); + } + } else if (patChr == CAP_J) { + // Get pattern for skeleton with H, then replace H or k + // with fDefaultHourFormatChar (if different) + patternFormMapped.append(CAP_H); + *flags |= kDTPGSkeletonUsesCapJ; + } else { + patternFormMapped.append(patChr); + } + } + } + return patternFormMapped; +} + UnicodeString DateTimePatternGenerator::replaceFieldTypes(const UnicodeString& pattern, const UnicodeString& skeleton, @@ -1299,17 +1385,7 @@ DateTimePatternGenerator::adjustFieldTypes(const UnicodeString& pattern, const dtTypeElem *row = &dtTypes[canonicalIndex]; int32_t typeValue = row->field; - // Handle special day periods. - if (typeValue == UDATPG_DAYPERIOD_FIELD && flags != 0) { - UChar c = NONE; // '0' - if (flags & kDTPGSkeletonUsesCapB) { c = CAP_B; } - if (flags & kDTPGSkeletonUsesLowB) { c = LOW_B; } - - if (c != NONE) { - for (int32_t i = 0; i < field.length(); ++i) - field.setCharAt(i, c); - } - } + // handle day periods - with #13183, no longer need special handling here, integrated with normal types if ((flags & kDTPGFixFractionalSeconds) != 0 && typeValue == UDATPG_SECOND_FIELD) { field += decimal; @@ -1841,12 +1917,14 @@ DateTimeMatcher::set(const UnicodeString& pattern, FormatParser* fp, PtnSkeleton for (i=0; iset(pattern); for (i=0; i < fp->itemNumber; i++) { const UnicodeString& value = fp->items[i]; - if ( value.charAt(0) == LOW_A ) { - continue; // skip 'a' - } + // don't skip 'a' anymore, dayPeriod handled specially below if ( fp->isQuoteLiteral(value) ) { UnicodeString quoteLiteral; @@ -1861,7 +1939,7 @@ DateTimeMatcher::set(const UnicodeString& pattern, FormatParser* fp, PtnSkeleton int32_t field = row->field; skeletonResult.original.populate(field, value); UChar repeatChar = row->patternChar; - int32_t repeatCount = row->minLen; // #7930 removes cap at 3 + int32_t repeatCount = row->minLen; skeletonResult.baseOriginal.populate(field, repeatChar, repeatCount); int16_t subField = row->type; if ( row->type > 0) { @@ -1869,6 +1947,30 @@ DateTimeMatcher::set(const UnicodeString& pattern, FormatParser* fp, PtnSkeleton } skeletonResult.type[field] = subField; } + // #13183, handle special behavior for day period characters (a, b, B) + if (!skeletonResult.original.isFieldEmpty(UDATPG_HOUR_FIELD)) { + if (skeletonResult.original.getFieldChar(UDATPG_HOUR_FIELD)==LOW_H || skeletonResult.original.getFieldChar(UDATPG_HOUR_FIELD)==CAP_K) { + // We have a skeleton with 12-hour-cycle format + if (skeletonResult.original.isFieldEmpty(UDATPG_DAYPERIOD_FIELD)) { + // But we do not have a day period in the skeleton; add the default DAYPERIOD (currently "a") + for (i = 0; dtTypes[i].patternChar != 0; i++) { + if ( dtTypes[i].field == UDATPG_DAYPERIOD_FIELD ) { + // first entry for UDATPG_DAYPERIOD_FIELD + skeletonResult.original.populate(UDATPG_DAYPERIOD_FIELD, dtTypes[i].patternChar, dtTypes[i].minLen); + skeletonResult.baseOriginal.populate(UDATPG_DAYPERIOD_FIELD, dtTypes[i].patternChar, dtTypes[i].minLen); + skeletonResult.type[UDATPG_DAYPERIOD_FIELD] = dtTypes[i].type; + skeletonResult.addedDefaultDayPeriod = TRUE; + break; + } + } + } + } else { + // Skeleton has 24-hour-cycle hour format and has dayPeriod, delete dayPeriod (i.e. ignore it) + skeletonResult.original.clearField(UDATPG_DAYPERIOD_FIELD); + skeletonResult.baseOriginal.clearField(UDATPG_DAYPERIOD_FIELD); + skeletonResult.type[UDATPG_DAYPERIOD_FIELD] = NONE; + } + } copyFrom(skeletonResult); } @@ -2290,13 +2392,27 @@ PtnSkeleton::equals(const PtnSkeleton& other) const { UnicodeString PtnSkeleton::getSkeleton() const { UnicodeString result; - return original.appendTo(result); + result = original.appendTo(result); + int32_t pos; + if (addedDefaultDayPeriod && (pos = result.indexOf(LOW_A)) >= 0) { + // for backward compatibility: if DateTimeMatcher.set added a single 'a' that + // was not in the provided skeleton, remove it here before returning skeleton. + result.remove(pos, 1); + } + return result; } UnicodeString PtnSkeleton::getBaseSkeleton() const { UnicodeString result; - return baseOriginal.appendTo(result); + result = baseOriginal.appendTo(result); + int32_t pos; + if (addedDefaultDayPeriod && (pos = result.indexOf(LOW_A)) >= 0) { + // for backward compatibility: if DateTimeMatcher.set added a single 'a' that + // was not in the provided skeleton, remove it here before returning skeleton. + result.remove(pos, 1); + } + return result; } UChar diff --git a/deps/icu-small/source/i18n/dtptngen_impl.h b/deps/icu-small/source/i18n/dtptngen_impl.h index 00a707585b7a5b..2ea31a75c488fa 100644 --- a/deps/icu-small/source/i18n/dtptngen_impl.h +++ b/deps/icu-small/source/i18n/dtptngen_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -15,6 +15,9 @@ #define __DTPTNGEN_IMPL_H__ #include "unicode/udatpg.h" + +#include "unicode/strenum.h" +#include "unicode/unistr.h" #include "uvector.h" // TODO(claireho): Split off Builder class. @@ -89,10 +92,11 @@ #define LOW_X ((UChar)0x0078) #define LOW_Y ((UChar)0x0079) #define LOW_Z ((UChar)0x007A) -#define DT_SHORT -0x102 -#define DT_LONG -0x103 -#define DT_NUMERIC 0x100 #define DT_NARROW -0x101 +#define DT_SHORTER -0x102 +#define DT_SHORT -0x103 +#define DT_LONG -0x104 +#define DT_NUMERIC 0x100 #define DT_DELTA 0x10 U_NAMESPACE_BEGIN @@ -152,6 +156,7 @@ class PtnSkeleton : public UMemory { int32_t type[UDATPG_FIELD_COUNT]; SkeletonFields original; SkeletonFields baseOriginal; + UBool addedDefaultDayPeriod; PtnSkeleton(); PtnSkeleton(const PtnSkeleton& other); diff --git a/deps/icu-small/source/i18n/dtrule.cpp b/deps/icu-small/source/i18n/dtrule.cpp index 41b61ae045be57..6847f1d16e89ff 100644 --- a/deps/icu-small/source/i18n/dtrule.cpp +++ b/deps/icu-small/source/i18n/dtrule.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/esctrn.cpp b/deps/icu-small/source/i18n/esctrn.cpp index 9be926f138c7f1..900bed7e45734b 100644 --- a/deps/icu-small/source/i18n/esctrn.cpp +++ b/deps/icu-small/source/i18n/esctrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/esctrn.h b/deps/icu-small/source/i18n/esctrn.h index 7afea1b503fca5..60ecc74b498456 100644 --- a/deps/icu-small/source/i18n/esctrn.h +++ b/deps/icu-small/source/i18n/esctrn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/ethpccal.cpp b/deps/icu-small/source/i18n/ethpccal.cpp index e27f005583dac6..4377c59b325a1b 100644 --- a/deps/icu-small/source/i18n/ethpccal.cpp +++ b/deps/icu-small/source/i18n/ethpccal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/ethpccal.h b/deps/icu-small/source/i18n/ethpccal.h index a9adac6f57af83..5fae2fb1bea2c7 100644 --- a/deps/icu-small/source/i18n/ethpccal.h +++ b/deps/icu-small/source/i18n/ethpccal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/fmtable.cpp b/deps/icu-small/source/i18n/fmtable.cpp index feb4e28a07377f..73f9b66ab6f950 100644 --- a/deps/icu-small/source/i18n/fmtable.cpp +++ b/deps/icu-small/source/i18n/fmtable.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/fmtable_cnv.cpp b/deps/icu-small/source/i18n/fmtable_cnv.cpp index ff4deae92d2a2f..9a647927797dbd 100644 --- a/deps/icu-small/source/i18n/fmtable_cnv.cpp +++ b/deps/icu-small/source/i18n/fmtable_cnv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/fmtableimp.h b/deps/icu-small/source/i18n/fmtableimp.h index 8b3778ccc34066..0e6ccd24da7f02 100644 --- a/deps/icu-small/source/i18n/fmtableimp.h +++ b/deps/icu-small/source/i18n/fmtableimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -12,6 +12,8 @@ #include "digitlst.h" +#if !UCONFIG_NO_FORMATTING + U_NAMESPACE_BEGIN /** @@ -35,4 +37,5 @@ static const int64_t MAX_INT64_IN_DOUBLE = 0x001FFFFFFFFFFFFFLL; U_NAMESPACE_END +#endif // #if !UCONFIG_NO_FORMATTING #endif diff --git a/deps/icu-small/source/i18n/format.cpp b/deps/icu-small/source/i18n/format.cpp index e951b3082ed077..e5abbe9eb0fa7d 100644 --- a/deps/icu-small/source/i18n/format.cpp +++ b/deps/icu-small/source/i18n/format.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/fphdlimp.cpp b/deps/icu-small/source/i18n/fphdlimp.cpp index 6a004a6685296c..abcec97ee3171c 100644 --- a/deps/icu-small/source/i18n/fphdlimp.cpp +++ b/deps/icu-small/source/i18n/fphdlimp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/fphdlimp.h b/deps/icu-small/source/i18n/fphdlimp.h index b1fe42bb40fa57..f3ac12c2bacb9a 100644 --- a/deps/icu-small/source/i18n/fphdlimp.h +++ b/deps/icu-small/source/i18n/fphdlimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/fpositer.cpp b/deps/icu-small/source/i18n/fpositer.cpp index 426226d69d7bbb..79e2791db8d371 100644 --- a/deps/icu-small/source/i18n/fpositer.cpp +++ b/deps/icu-small/source/i18n/fpositer.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/funcrepl.cpp b/deps/icu-small/source/i18n/funcrepl.cpp index 683e00a2c8db51..30bcebbf908794 100644 --- a/deps/icu-small/source/i18n/funcrepl.cpp +++ b/deps/icu-small/source/i18n/funcrepl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/funcrepl.h b/deps/icu-small/source/i18n/funcrepl.h index 954150cf002c40..a835d5be7c2173 100644 --- a/deps/icu-small/source/i18n/funcrepl.h +++ b/deps/icu-small/source/i18n/funcrepl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/gender.cpp b/deps/icu-small/source/i18n/gender.cpp index 4847ce95848e1d..e60bc520bcc0e8 100644 --- a/deps/icu-small/source/i18n/gender.cpp +++ b/deps/icu-small/source/i18n/gender.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/gregocal.cpp b/deps/icu-small/source/i18n/gregocal.cpp index 959228ab49b31b..49c4226049d9c8 100644 --- a/deps/icu-small/source/i18n/gregocal.cpp +++ b/deps/icu-small/source/i18n/gregocal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/gregoimp.cpp b/deps/icu-small/source/i18n/gregoimp.cpp index fa886f5a6fa037..cc31e274131906 100644 --- a/deps/icu-small/source/i18n/gregoimp.cpp +++ b/deps/icu-small/source/i18n/gregoimp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -27,6 +27,11 @@ int32_t ClockMath::floorDivide(int32_t numerator, int32_t denominator) { numerator / denominator : ((numerator + 1) / denominator) - 1; } +int64_t ClockMath::floorDivide(int64_t numerator, int64_t denominator) { + return (numerator >= 0) ? + numerator / denominator : ((numerator + 1) / denominator) - 1; +} + int32_t ClockMath::floorDivide(double numerator, int32_t denominator, int32_t& remainder) { double quotient; diff --git a/deps/icu-small/source/i18n/gregoimp.h b/deps/icu-small/source/i18n/gregoimp.h index 19e44c7a5a01d2..55922a6b40aa52 100644 --- a/deps/icu-small/source/i18n/gregoimp.h +++ b/deps/icu-small/source/i18n/gregoimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -40,6 +40,17 @@ class ClockMath { */ static int32_t floorDivide(int32_t numerator, int32_t denominator); + /** + * Divide two integers, returning the floor of the quotient. + * Unlike the built-in division, this is mathematically + * well-behaved. E.g., -1/4 => 0 but + * floorDivide(-1,4) => -1. + * @param numerator the numerator + * @param denominator a divisor which must be != 0 + * @return the floor of the quotient + */ + static int64_t floorDivide(int64_t numerator, int64_t denominator); + /** * Divide two numbers, returning the floor of the quotient. * Unlike the built-in division, this is mathematically diff --git a/deps/icu-small/source/i18n/hebrwcal.cpp b/deps/icu-small/source/i18n/hebrwcal.cpp index 0b329a87158733..66a3e47a4f1e0f 100644 --- a/deps/icu-small/source/i18n/hebrwcal.cpp +++ b/deps/icu-small/source/i18n/hebrwcal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/hebrwcal.h b/deps/icu-small/source/i18n/hebrwcal.h index 0824fb7c784e9e..9323ad62aa72fa 100644 --- a/deps/icu-small/source/i18n/hebrwcal.h +++ b/deps/icu-small/source/i18n/hebrwcal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/indiancal.cpp b/deps/icu-small/source/i18n/indiancal.cpp index 7964d45312ea4d..a2a7f2dcdd3e9e 100644 --- a/deps/icu-small/source/i18n/indiancal.cpp +++ b/deps/icu-small/source/i18n/indiancal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2003-2014, International Business Machines Corporation diff --git a/deps/icu-small/source/i18n/indiancal.h b/deps/icu-small/source/i18n/indiancal.h index fcc21d729bf0aa..d40af5ad450c9e 100644 --- a/deps/icu-small/source/i18n/indiancal.h +++ b/deps/icu-small/source/i18n/indiancal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** diff --git a/deps/icu-small/source/i18n/inputext.cpp b/deps/icu-small/source/i18n/inputext.cpp index 4e053aef2ea1ee..96e59b24d878ff 100644 --- a/deps/icu-small/source/i18n/inputext.cpp +++ b/deps/icu-small/source/i18n/inputext.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/inputext.h b/deps/icu-small/source/i18n/inputext.h index 6a5d253e0568c2..06ad627c622d47 100644 --- a/deps/icu-small/source/i18n/inputext.h +++ b/deps/icu-small/source/i18n/inputext.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/islamcal.cpp b/deps/icu-small/source/i18n/islamcal.cpp index 7c2d1b6b98e74c..733301d98eeff6 100644 --- a/deps/icu-small/source/i18n/islamcal.cpp +++ b/deps/icu-small/source/i18n/islamcal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/islamcal.h b/deps/icu-small/source/i18n/islamcal.h index 4e2a1e3d52fe1b..17fb6687ef7b63 100644 --- a/deps/icu-small/source/i18n/islamcal.h +++ b/deps/icu-small/source/i18n/islamcal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/japancal.cpp b/deps/icu-small/source/i18n/japancal.cpp index 0c8396f6f8c620..a2738e86a91edb 100644 --- a/deps/icu-small/source/i18n/japancal.cpp +++ b/deps/icu-small/source/i18n/japancal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/japancal.h b/deps/icu-small/source/i18n/japancal.h index ab267f81f17271..356351d28dd28a 100644 --- a/deps/icu-small/source/i18n/japancal.h +++ b/deps/icu-small/source/i18n/japancal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/measfmt.cpp b/deps/icu-small/source/i18n/measfmt.cpp index 4ac2f7d5ebe768..628c8f8992d7a2 100644 --- a/deps/icu-small/source/i18n/measfmt.cpp +++ b/deps/icu-small/source/i18n/measfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -26,6 +26,7 @@ #include "unicode/decimfmt.h" #include "uresimp.h" #include "unicode/ures.h" +#include "unicode/ustring.h" #include "ureslocs.h" #include "cstring.h" #include "mutex.h" @@ -41,11 +42,14 @@ #include "standardplural.h" #include "unifiedcache.h" -#define MEAS_UNIT_COUNT 138 -#define WIDTH_INDEX_COUNT (UMEASFMT_WIDTH_NARROW + 1) U_NAMESPACE_BEGIN +static constexpr int32_t PER_UNIT_INDEX = StandardPlural::COUNT; +static constexpr int32_t PATTERN_COUNT = PER_UNIT_INDEX + 1; +static constexpr int32_t MEAS_UNIT_COUNT = 138; // see assertion in MeasureFormatCacheData constructor +static constexpr int32_t WIDTH_INDEX_COUNT = UMEASFMT_WIDTH_NARROW + 1; + UOBJECT_DEFINE_RTTI_IMPLEMENTATION(MeasureFormat) // Used to format durations like 5:47 or 21:35:42. @@ -99,8 +103,6 @@ static UMeasureFormatWidth getRegularWidth(UMeasureFormatWidth width) { */ class MeasureFormatCacheData : public SharedObject { public: - static const int32_t PER_UNIT_INDEX = StandardPlural::COUNT; - static const int32_t PATTERN_COUNT = PER_UNIT_INDEX + 1; /** * Redirection data from root-bundle, top-level sideways aliases. @@ -109,7 +111,7 @@ class MeasureFormatCacheData : public SharedObject { */ UMeasureFormatWidth widthFallback[WIDTH_INDEX_COUNT]; /** Measure unit -> format width -> array of patterns ("{0} meters") (plurals + PER_UNIT_INDEX) */ - SimpleFormatter *patterns[MEAS_UNIT_COUNT][WIDTH_INDEX_COUNT][PATTERN_COUNT]; + SimpleFormatter* patterns[MEAS_UNIT_COUNT][WIDTH_INDEX_COUNT][PATTERN_COUNT]; const UChar* dnams[MEAS_UNIT_COUNT][WIDTH_INDEX_COUNT]; SimpleFormatter perFormatters[WIDTH_INDEX_COUNT]; @@ -145,24 +147,25 @@ class MeasureFormatCacheData : public SharedObject { } private: - NumberFormat *currencyFormats[WIDTH_INDEX_COUNT]; - NumberFormat *integerFormat; - NumericDateFormatters *numericDateFormatters; + NumberFormat* currencyFormats[WIDTH_INDEX_COUNT]; + NumberFormat* integerFormat; + NumericDateFormatters* numericDateFormatters; + MeasureFormatCacheData(const MeasureFormatCacheData &other); MeasureFormatCacheData &operator=(const MeasureFormatCacheData &other); }; -MeasureFormatCacheData::MeasureFormatCacheData() { +MeasureFormatCacheData::MeasureFormatCacheData() + : integerFormat(nullptr), numericDateFormatters(nullptr) { + // Please update MEAS_UNIT_COUNT if it gets out of sync with the true count! + U_ASSERT(MEAS_UNIT_COUNT == MeasureUnit::getIndexCount()); + for (int32_t i = 0; i < WIDTH_INDEX_COUNT; ++i) { widthFallback[i] = UMEASFMT_WIDTH_COUNT; } - for (int32_t i = 0; i < UPRV_LENGTHOF(currencyFormats); ++i) { - currencyFormats[i] = NULL; - } - uprv_memset(patterns, 0, sizeof(patterns)); - uprv_memset(dnams, 0, sizeof(dnams)); - integerFormat = NULL; - numericDateFormatters = NULL; + memset(&patterns[0][0][0], 0, sizeof(patterns)); + memset(&dnams[0][0], 0, sizeof(dnams)); + memset(currencyFormats, 0, sizeof(currencyFormats)); } MeasureFormatCacheData::~MeasureFormatCacheData() { @@ -235,6 +238,9 @@ struct UnitDataSink : public ResourceSink { void setFormatterIfAbsent(int32_t index, const ResourceValue &value, int32_t minPlaceholders, UErrorCode &errorCode) { + U_ASSERT(unitIndex < MEAS_UNIT_COUNT); + U_ASSERT(width < WIDTH_INDEX_COUNT); + U_ASSERT(index < PATTERN_COUNT); SimpleFormatter **patterns = &cacheData.patterns[unitIndex][width][0]; if (U_SUCCESS(errorCode) && patterns[index] == NULL) { if (minPlaceholders >= 0) { @@ -248,6 +254,8 @@ struct UnitDataSink : public ResourceSink { } void setDnamIfAbsent(const ResourceValue &value, UErrorCode& errorCode) { + U_ASSERT(unitIndex < MEAS_UNIT_COUNT); + U_ASSERT(width < WIDTH_INDEX_COUNT); if (cacheData.dnams[unitIndex][width] == NULL) { int32_t length; cacheData.dnams[unitIndex][width] = value.getString(length, errorCode); @@ -265,7 +273,7 @@ struct UnitDataSink : public ResourceSink { setDnamIfAbsent(value, errorCode); } else if (uprv_strcmp(key, "per") == 0) { // For example, "{0}/h". - setFormatterIfAbsent(MeasureFormatCacheData::PER_UNIT_INDEX, value, 1, errorCode); + setFormatterIfAbsent(PER_UNIT_INDEX, value, 1, errorCode); } else { // The key must be one of the plural form strings. For example: // one{"{0} hr"} @@ -288,10 +296,8 @@ struct UnitDataSink : public ResourceSink { return; } - if (value.getType() == URES_STRING) { - // Units like "coordinate" that don't have plural variants - setFormatterIfAbsent(StandardPlural::OTHER, value, 0, errorCode); - } else if (value.getType() == URES_TABLE) { + // We no longer handle units like "coordinate" here (which do not have plural variants) + if (value.getType() == URES_TABLE) { // Units that have plural variants ResourceTable patternTableTable = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } @@ -333,6 +339,8 @@ struct UnitDataSink : public ResourceSink { consumeCompoundPattern(key, value, errorCode); } } + } else if (uprv_strcmp(key, "coordinate") == 0) { + // special handling but we need to determine what that is } else { type = key; ResourceTable subtypeTable = value.getTable(errorCode); @@ -1092,8 +1100,7 @@ UnicodeString &MeasureFormat::formatNumeric( const SimpleFormatter *MeasureFormat::getFormatterOrNull( const MeasureUnit &unit, UMeasureFormatWidth width, int32_t index) const { width = getRegularWidth(width); - SimpleFormatter *const (*unitPatterns)[MeasureFormatCacheData::PATTERN_COUNT] = - &cache->patterns[unit.getIndex()][0]; + SimpleFormatter *const (*unitPatterns)[PATTERN_COUNT] = &cache->patterns[unit.getIndex()][0]; if (unitPatterns[width][index] != NULL) { return unitPatterns[width][index]; } @@ -1161,8 +1168,7 @@ int32_t MeasureFormat::withPerUnitAndAppend( if (U_FAILURE(status)) { return offset; } - const SimpleFormatter *perUnitFormatter = - getFormatterOrNull(perUnit, width, MeasureFormatCacheData::PER_UNIT_INDEX); + const SimpleFormatter *perUnitFormatter = getFormatterOrNull(perUnit, width, PER_UNIT_INDEX); if (perUnitFormatter != NULL) { const UnicodeString *params[] = {&formatted}; perUnitFormatter->formatAndAppend( diff --git a/deps/icu-small/source/i18n/measunit.cpp b/deps/icu-small/source/i18n/measunit.cpp index a3021b740521fd..580afc0df5d2bc 100644 --- a/deps/icu-small/source/i18n/measunit.cpp +++ b/deps/icu-small/source/i18n/measunit.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -33,6 +33,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(MeasureUnit) // // Start generated code + static const int32_t gOffsets[] = { 0, 2, @@ -40,21 +41,21 @@ static const int32_t gOffsets[] = { 16, 20, 24, - 28, - 288, - 298, - 309, - 313, - 319, - 323, - 342, - 343, - 354, - 360, - 365, - 369, - 373, - 398 + 285, + 295, + 306, + 310, + 316, + 320, + 340, + 341, + 352, + 355, + 361, + 366, + 370, + 374, + 399 }; static const int32_t gIndexes[] = { @@ -64,15 +65,15 @@ static const int32_t gIndexes[] = { 16, 20, 24, - 28, - 28, - 38, + 24, + 34, + 45, 49, - 53, + 55, 59, - 63, - 82, - 83, + 79, + 80, + 91, 94, 100, 105, @@ -88,7 +89,6 @@ static const char * const gTypes[] = { "area", "concentr", "consumption", - "coordinate", "currency", "digital", "duration", @@ -98,6 +98,7 @@ static const char * const gTypes[] = { "length", "light", "mass", + "none", "power", "pressure", "speed", @@ -131,10 +132,6 @@ static const char * const gSubTypes[] = { "liter-per-kilometer", "mile-per-gallon", "mile-per-gallon-imperial", - "east", - "north", - "south", - "west", "ADP", "AED", "AFA", @@ -178,6 +175,7 @@ static const char * const gSubTypes[] = { "BTN", "BWP", "BYB", + "BYN", "BYR", "BZD", "CAD", @@ -448,6 +446,7 @@ static const char * const gSubTypes[] = { "nautical-mile", "parsec", "picometer", + "point", "yard", "lux", "carat", @@ -461,6 +460,9 @@ static const char * const gSubTypes[] = { "pound", "stone", "ton", + "base", + "percent", + "permille", "gigawatt", "horsepower", "kilowatt", @@ -509,14 +511,14 @@ static const char * const gSubTypes[] = { // Must be sorted by first value and then second value. static int32_t unitPerUnitToSingleUnit[][4] = { - {330, 300, 17, 0}, - {332, 306, 17, 2}, - {334, 300, 17, 3}, - {334, 387, 4, 2}, - {334, 388, 4, 3}, - {348, 385, 3, 1}, - {351, 11, 16, 4}, - {390, 330, 4, 1} + {327, 297, 17, 0}, + {329, 303, 17, 2}, + {331, 297, 17, 3}, + {331, 388, 4, 2}, + {331, 389, 4, 3}, + {346, 386, 3, 1}, + {349, 11, 16, 4}, + {391, 327, 4, 1} }; MeasureUnit *MeasureUnit::createGForce(UErrorCode &status) { @@ -615,284 +617,272 @@ MeasureUnit *MeasureUnit::createMilePerGallonImperial(UErrorCode &status) { return MeasureUnit::create(4, 3, status); } -MeasureUnit *MeasureUnit::createEast(UErrorCode &status) { - return MeasureUnit::create(5, 0, status); -} - -MeasureUnit *MeasureUnit::createNorth(UErrorCode &status) { - return MeasureUnit::create(5, 1, status); -} - -MeasureUnit *MeasureUnit::createSouth(UErrorCode &status) { - return MeasureUnit::create(5, 2, status); -} - -MeasureUnit *MeasureUnit::createWest(UErrorCode &status) { - return MeasureUnit::create(5, 3, status); -} - MeasureUnit *MeasureUnit::createBit(UErrorCode &status) { - return MeasureUnit::create(7, 0, status); + return MeasureUnit::create(6, 0, status); } MeasureUnit *MeasureUnit::createByte(UErrorCode &status) { - return MeasureUnit::create(7, 1, status); + return MeasureUnit::create(6, 1, status); } MeasureUnit *MeasureUnit::createGigabit(UErrorCode &status) { - return MeasureUnit::create(7, 2, status); + return MeasureUnit::create(6, 2, status); } MeasureUnit *MeasureUnit::createGigabyte(UErrorCode &status) { - return MeasureUnit::create(7, 3, status); + return MeasureUnit::create(6, 3, status); } MeasureUnit *MeasureUnit::createKilobit(UErrorCode &status) { - return MeasureUnit::create(7, 4, status); + return MeasureUnit::create(6, 4, status); } MeasureUnit *MeasureUnit::createKilobyte(UErrorCode &status) { - return MeasureUnit::create(7, 5, status); + return MeasureUnit::create(6, 5, status); } MeasureUnit *MeasureUnit::createMegabit(UErrorCode &status) { - return MeasureUnit::create(7, 6, status); + return MeasureUnit::create(6, 6, status); } MeasureUnit *MeasureUnit::createMegabyte(UErrorCode &status) { - return MeasureUnit::create(7, 7, status); + return MeasureUnit::create(6, 7, status); } MeasureUnit *MeasureUnit::createTerabit(UErrorCode &status) { - return MeasureUnit::create(7, 8, status); + return MeasureUnit::create(6, 8, status); } MeasureUnit *MeasureUnit::createTerabyte(UErrorCode &status) { - return MeasureUnit::create(7, 9, status); + return MeasureUnit::create(6, 9, status); } MeasureUnit *MeasureUnit::createCentury(UErrorCode &status) { - return MeasureUnit::create(8, 0, status); + return MeasureUnit::create(7, 0, status); } MeasureUnit *MeasureUnit::createDay(UErrorCode &status) { - return MeasureUnit::create(8, 1, status); + return MeasureUnit::create(7, 1, status); } MeasureUnit *MeasureUnit::createHour(UErrorCode &status) { - return MeasureUnit::create(8, 2, status); + return MeasureUnit::create(7, 2, status); } MeasureUnit *MeasureUnit::createMicrosecond(UErrorCode &status) { - return MeasureUnit::create(8, 3, status); + return MeasureUnit::create(7, 3, status); } MeasureUnit *MeasureUnit::createMillisecond(UErrorCode &status) { - return MeasureUnit::create(8, 4, status); + return MeasureUnit::create(7, 4, status); } MeasureUnit *MeasureUnit::createMinute(UErrorCode &status) { - return MeasureUnit::create(8, 5, status); + return MeasureUnit::create(7, 5, status); } MeasureUnit *MeasureUnit::createMonth(UErrorCode &status) { - return MeasureUnit::create(8, 6, status); + return MeasureUnit::create(7, 6, status); } MeasureUnit *MeasureUnit::createNanosecond(UErrorCode &status) { - return MeasureUnit::create(8, 7, status); + return MeasureUnit::create(7, 7, status); } MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) { - return MeasureUnit::create(8, 8, status); + return MeasureUnit::create(7, 8, status); } MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) { - return MeasureUnit::create(8, 9, status); + return MeasureUnit::create(7, 9, status); } MeasureUnit *MeasureUnit::createYear(UErrorCode &status) { - return MeasureUnit::create(8, 10, status); + return MeasureUnit::create(7, 10, status); } MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) { - return MeasureUnit::create(9, 0, status); + return MeasureUnit::create(8, 0, status); } MeasureUnit *MeasureUnit::createMilliampere(UErrorCode &status) { - return MeasureUnit::create(9, 1, status); + return MeasureUnit::create(8, 1, status); } MeasureUnit *MeasureUnit::createOhm(UErrorCode &status) { - return MeasureUnit::create(9, 2, status); + return MeasureUnit::create(8, 2, status); } MeasureUnit *MeasureUnit::createVolt(UErrorCode &status) { - return MeasureUnit::create(9, 3, status); + return MeasureUnit::create(8, 3, status); } MeasureUnit *MeasureUnit::createCalorie(UErrorCode &status) { - return MeasureUnit::create(10, 0, status); + return MeasureUnit::create(9, 0, status); } MeasureUnit *MeasureUnit::createFoodcalorie(UErrorCode &status) { - return MeasureUnit::create(10, 1, status); + return MeasureUnit::create(9, 1, status); } MeasureUnit *MeasureUnit::createJoule(UErrorCode &status) { - return MeasureUnit::create(10, 2, status); + return MeasureUnit::create(9, 2, status); } MeasureUnit *MeasureUnit::createKilocalorie(UErrorCode &status) { - return MeasureUnit::create(10, 3, status); + return MeasureUnit::create(9, 3, status); } MeasureUnit *MeasureUnit::createKilojoule(UErrorCode &status) { - return MeasureUnit::create(10, 4, status); + return MeasureUnit::create(9, 4, status); } MeasureUnit *MeasureUnit::createKilowattHour(UErrorCode &status) { - return MeasureUnit::create(10, 5, status); + return MeasureUnit::create(9, 5, status); } MeasureUnit *MeasureUnit::createGigahertz(UErrorCode &status) { - return MeasureUnit::create(11, 0, status); + return MeasureUnit::create(10, 0, status); } MeasureUnit *MeasureUnit::createHertz(UErrorCode &status) { - return MeasureUnit::create(11, 1, status); + return MeasureUnit::create(10, 1, status); } MeasureUnit *MeasureUnit::createKilohertz(UErrorCode &status) { - return MeasureUnit::create(11, 2, status); + return MeasureUnit::create(10, 2, status); } MeasureUnit *MeasureUnit::createMegahertz(UErrorCode &status) { - return MeasureUnit::create(11, 3, status); + return MeasureUnit::create(10, 3, status); } MeasureUnit *MeasureUnit::createAstronomicalUnit(UErrorCode &status) { - return MeasureUnit::create(12, 0, status); + return MeasureUnit::create(11, 0, status); } MeasureUnit *MeasureUnit::createCentimeter(UErrorCode &status) { - return MeasureUnit::create(12, 1, status); + return MeasureUnit::create(11, 1, status); } MeasureUnit *MeasureUnit::createDecimeter(UErrorCode &status) { - return MeasureUnit::create(12, 2, status); + return MeasureUnit::create(11, 2, status); } MeasureUnit *MeasureUnit::createFathom(UErrorCode &status) { - return MeasureUnit::create(12, 3, status); + return MeasureUnit::create(11, 3, status); } MeasureUnit *MeasureUnit::createFoot(UErrorCode &status) { - return MeasureUnit::create(12, 4, status); + return MeasureUnit::create(11, 4, status); } MeasureUnit *MeasureUnit::createFurlong(UErrorCode &status) { - return MeasureUnit::create(12, 5, status); + return MeasureUnit::create(11, 5, status); } MeasureUnit *MeasureUnit::createInch(UErrorCode &status) { - return MeasureUnit::create(12, 6, status); + return MeasureUnit::create(11, 6, status); } MeasureUnit *MeasureUnit::createKilometer(UErrorCode &status) { - return MeasureUnit::create(12, 7, status); + return MeasureUnit::create(11, 7, status); } MeasureUnit *MeasureUnit::createLightYear(UErrorCode &status) { - return MeasureUnit::create(12, 8, status); + return MeasureUnit::create(11, 8, status); } MeasureUnit *MeasureUnit::createMeter(UErrorCode &status) { - return MeasureUnit::create(12, 9, status); + return MeasureUnit::create(11, 9, status); } MeasureUnit *MeasureUnit::createMicrometer(UErrorCode &status) { - return MeasureUnit::create(12, 10, status); + return MeasureUnit::create(11, 10, status); } MeasureUnit *MeasureUnit::createMile(UErrorCode &status) { - return MeasureUnit::create(12, 11, status); + return MeasureUnit::create(11, 11, status); } MeasureUnit *MeasureUnit::createMileScandinavian(UErrorCode &status) { - return MeasureUnit::create(12, 12, status); + return MeasureUnit::create(11, 12, status); } MeasureUnit *MeasureUnit::createMillimeter(UErrorCode &status) { - return MeasureUnit::create(12, 13, status); + return MeasureUnit::create(11, 13, status); } MeasureUnit *MeasureUnit::createNanometer(UErrorCode &status) { - return MeasureUnit::create(12, 14, status); + return MeasureUnit::create(11, 14, status); } MeasureUnit *MeasureUnit::createNauticalMile(UErrorCode &status) { - return MeasureUnit::create(12, 15, status); + return MeasureUnit::create(11, 15, status); } MeasureUnit *MeasureUnit::createParsec(UErrorCode &status) { - return MeasureUnit::create(12, 16, status); + return MeasureUnit::create(11, 16, status); } MeasureUnit *MeasureUnit::createPicometer(UErrorCode &status) { - return MeasureUnit::create(12, 17, status); + return MeasureUnit::create(11, 17, status); +} + +MeasureUnit *MeasureUnit::createPoint(UErrorCode &status) { + return MeasureUnit::create(11, 18, status); } MeasureUnit *MeasureUnit::createYard(UErrorCode &status) { - return MeasureUnit::create(12, 18, status); + return MeasureUnit::create(11, 19, status); } MeasureUnit *MeasureUnit::createLux(UErrorCode &status) { - return MeasureUnit::create(13, 0, status); + return MeasureUnit::create(12, 0, status); } MeasureUnit *MeasureUnit::createCarat(UErrorCode &status) { - return MeasureUnit::create(14, 0, status); + return MeasureUnit::create(13, 0, status); } MeasureUnit *MeasureUnit::createGram(UErrorCode &status) { - return MeasureUnit::create(14, 1, status); + return MeasureUnit::create(13, 1, status); } MeasureUnit *MeasureUnit::createKilogram(UErrorCode &status) { - return MeasureUnit::create(14, 2, status); + return MeasureUnit::create(13, 2, status); } MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) { - return MeasureUnit::create(14, 3, status); + return MeasureUnit::create(13, 3, status); } MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) { - return MeasureUnit::create(14, 4, status); + return MeasureUnit::create(13, 4, status); } MeasureUnit *MeasureUnit::createMilligram(UErrorCode &status) { - return MeasureUnit::create(14, 5, status); + return MeasureUnit::create(13, 5, status); } MeasureUnit *MeasureUnit::createOunce(UErrorCode &status) { - return MeasureUnit::create(14, 6, status); + return MeasureUnit::create(13, 6, status); } MeasureUnit *MeasureUnit::createOunceTroy(UErrorCode &status) { - return MeasureUnit::create(14, 7, status); + return MeasureUnit::create(13, 7, status); } MeasureUnit *MeasureUnit::createPound(UErrorCode &status) { - return MeasureUnit::create(14, 8, status); + return MeasureUnit::create(13, 8, status); } MeasureUnit *MeasureUnit::createStone(UErrorCode &status) { - return MeasureUnit::create(14, 9, status); + return MeasureUnit::create(13, 9, status); } MeasureUnit *MeasureUnit::createTon(UErrorCode &status) { - return MeasureUnit::create(14, 10, status); + return MeasureUnit::create(13, 10, status); } MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) { @@ -1090,6 +1080,11 @@ static int32_t binarySearch( return -1; } +MeasureUnit::MeasureUnit() { + fCurrency[0] = 0; + initNoUnit("base"); +} + MeasureUnit::MeasureUnit(const MeasureUnit &other) : fTypeId(other.fTypeId), fSubTypeId(other.fSubTypeId) { uprv_strcpy(fCurrency, other.fCurrency); @@ -1278,6 +1273,15 @@ void MeasureUnit::initCurrency(const char *isoCurrency) { } } +void MeasureUnit::initNoUnit(const char *subtype) { + int32_t result = binarySearch(gTypes, 0, UPRV_LENGTHOF(gTypes), "none"); + U_ASSERT(result != -1); + fTypeId = result; + result = binarySearch(gSubTypes, gOffsets[fTypeId], gOffsets[fTypeId + 1], subtype); + U_ASSERT(result != -1); + fSubTypeId = result - gOffsets[fTypeId]; +} + void MeasureUnit::setTo(int32_t typeId, int32_t subTypeId) { fTypeId = typeId; fSubTypeId = subTypeId; diff --git a/deps/icu-small/source/i18n/measure.cpp b/deps/icu-small/source/i18n/measure.cpp index 3459e71b8077ca..d9084f87db2baa 100644 --- a/deps/icu-small/source/i18n/measure.cpp +++ b/deps/icu-small/source/i18n/measure.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/msgfmt.cpp b/deps/icu-small/source/i18n/msgfmt.cpp index 4658528050cfe1..064585665ae5e6 100644 --- a/deps/icu-small/source/i18n/msgfmt.cpp +++ b/deps/icu-small/source/i18n/msgfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: @@ -1954,7 +1954,10 @@ UnicodeString MessageFormat::PluralSelectorProvider::select(void *ctx, double nu context.formatter = msgFormat.getDefaultNumberFormat(ec); context.forReplaceNumber = TRUE; } - U_ASSERT(context.number.getDouble(ec) == number); // argument number minus the offset + if (context.number.getDouble(ec) != number) { + ec = U_INTERNAL_PROGRAM_ERROR; + return UnicodeString(FALSE, OTHER_STRING, 5); + } context.formatter->format(context.number, context.numberString, ec); const DecimalFormat *decFmt = dynamic_cast(context.formatter); if(decFmt != NULL) { diff --git a/deps/icu-small/source/i18n/msgfmt_impl.h b/deps/icu-small/source/i18n/msgfmt_impl.h index 80a07dc1ea28f6..0f77d12d0bb6e1 100644 --- a/deps/icu-small/source/i18n/msgfmt_impl.h +++ b/deps/icu-small/source/i18n/msgfmt_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/name2uni.cpp b/deps/icu-small/source/i18n/name2uni.cpp index acd9c0af997ada..d901eb126a8a46 100644 --- a/deps/icu-small/source/i18n/name2uni.cpp +++ b/deps/icu-small/source/i18n/name2uni.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/name2uni.h b/deps/icu-small/source/i18n/name2uni.h index 2ba4c8f792b357..4c743def32ede2 100644 --- a/deps/icu-small/source/i18n/name2uni.h +++ b/deps/icu-small/source/i18n/name2uni.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/nfrlist.h b/deps/icu-small/source/i18n/nfrlist.h index 65b21c6b1dbaac..db28c4d36f8d18 100644 --- a/deps/icu-small/source/i18n/nfrlist.h +++ b/deps/icu-small/source/i18n/nfrlist.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: nfrlist.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/nfrs.cpp b/deps/icu-small/source/i18n/nfrs.cpp index 5cbd33d0e2ef8b..b2d08889e6bce5 100644 --- a/deps/icu-small/source/i18n/nfrs.cpp +++ b/deps/icu-small/source/i18n/nfrs.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: nfrs.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -23,6 +23,7 @@ #include "nfrule.h" #include "nfrlist.h" #include "patternprops.h" +#include "putilimp.h" #ifdef RBNF_DEBUG #include "cmemory.h" @@ -544,7 +545,7 @@ NFRuleSet::findNormalRule(int64_t number) const // an explanation of the rollback rule). If we do, roll back // one rule and return that one instead of the one we'd normally // return - if (result->shouldRollBack((double)number)) { + if (result->shouldRollBack(number)) { if (hi == 1) { // bad rule set, no prior rule to rollback to from this base return NULL; } @@ -829,18 +830,23 @@ int64_t util64_fromDouble(double d) { return result; } -int64_t util64_pow(int32_t r, uint32_t e) { - if (r == 0) { +uint64_t util64_pow(uint32_t base, uint16_t exponent) { + if (base == 0) { return 0; - } else if (e == 0) { - return 1; - } else { - int64_t n = r; - while (--e > 0) { - n *= r; + } + uint64_t result = 1; + uint64_t pow = base; + while (true) { + if ((exponent & 1) == 1) { + result *= pow; } - return n; + exponent >>= 1; + if (exponent == 0) { + break; + } + pow *= pow; } + return result; } static const uint8_t asciiDigits[] = { diff --git a/deps/icu-small/source/i18n/nfrs.h b/deps/icu-small/source/i18n/nfrs.h index b06c2b2215ad54..34846ed297b77d 100644 --- a/deps/icu-small/source/i18n/nfrs.h +++ b/deps/icu-small/source/i18n/nfrs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: nfrs.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -88,7 +88,9 @@ class NFRuleSet : public UMemory { int64_t util64_fromDouble(double d); // raise radix to the power exponent, only non-negative exponents -int64_t util64_pow(int32_t radix, uint32_t exponent); +// Arithmetic is performed in unsigned space since overflow in +// signed space is undefined behavior. +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); diff --git a/deps/icu-small/source/i18n/nfrule.cpp b/deps/icu-small/source/i18n/nfrule.cpp index 100a46490daca0..2c26aff2d11fde 100644 --- a/deps/icu-small/source/i18n/nfrule.cpp +++ b/deps/icu-small/source/i18n/nfrule.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: nfrule.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -30,6 +30,7 @@ #include "nfrlist.h" #include "nfsubs.h" #include "patternprops.h" +#include "putilimp.h" U_NAMESPACE_BEGIN @@ -715,6 +716,12 @@ NFRule::_appendRuleText(UnicodeString& result) const result.append(gSemicolon); } +int64_t NFRule::getDivisor() const +{ + return util64_pow(radix, exponent); +} + + //----------------------------------------------------------------------- // formatting //----------------------------------------------------------------------- @@ -749,7 +756,7 @@ NFRule::doFormat(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32 toInsertInto.insert(pos, ruleText.tempSubString(pluralRuleEnd + 2)); } toInsertInto.insert(pos, - rulePatternFormat->format((int32_t)(number/uprv_pow(radix, exponent)), status)); + rulePatternFormat->format((int32_t)(number/util64_pow(radix, exponent)), status)); if (pluralRuleStart > 0) { toInsertInto.insert(pos, ruleText.tempSubString(0, pluralRuleStart)); } @@ -798,10 +805,10 @@ NFRule::doFormat(double number, UnicodeString& toInsertInto, int32_t pos, int32_ if (0 <= pluralVal && pluralVal < 1) { // We're in a fractional rule, and we have to match the NumeratorSubstitution behavior. // 2.3 can become 0.2999999999999998 for the fraction due to rounding errors. - pluralVal = uprv_round(pluralVal * uprv_pow(radix, exponent)); + pluralVal = uprv_round(pluralVal * util64_pow(radix, exponent)); } else { - pluralVal = pluralVal / uprv_pow(radix, exponent); + pluralVal = pluralVal / util64_pow(radix, exponent); } toInsertInto.insert(pos, rulePatternFormat->format((int32_t)(pluralVal), status)); if (pluralRuleStart > 0) { @@ -827,7 +834,7 @@ NFRule::doFormat(double number, UnicodeString& toInsertInto, int32_t pos, int32_ * this one in its list; false if it should use this rule */ UBool -NFRule::shouldRollBack(double number) const +NFRule::shouldRollBack(int64_t number) const { // we roll back if the rule contains a modulus substitution, // the number being formatted is an even multiple of the rule's @@ -847,7 +854,7 @@ NFRule::shouldRollBack(double number) const // multiple of 100. This is called the "rollback rule." if ((sub1 != NULL && sub1->isModulusSubstitution()) || (sub2 != NULL && sub2->isModulusSubstitution())) { int64_t re = util64_pow(radix, exponent); - return uprv_fmod(number, (double)re) == 0 && (baseValue % re) != 0; + return (number % re) == 0 && (baseValue % re) != 0; } return FALSE; } diff --git a/deps/icu-small/source/i18n/nfrule.h b/deps/icu-small/source/i18n/nfrule.h index 5424b968a1fd90..21cdd24fbd0573 100644 --- a/deps/icu-small/source/i18n/nfrule.h +++ b/deps/icu-small/source/i18n/nfrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -17,7 +17,6 @@ #include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/unistr.h" -#include "putilimp.h" U_NAMESPACE_BEGIN @@ -66,7 +65,7 @@ class NFRule : public UMemory { UChar getDecimalPoint() const { return decimalPoint; } - double getDivisor() const { return uprv_pow(radix, exponent); } + int64_t getDivisor() const; void doFormat(int64_t number, UnicodeString& toAppendTo, int32_t pos, int32_t recursionCount, UErrorCode& status) const; void doFormat(double number, UnicodeString& toAppendTo, int32_t pos, int32_t recursionCount, UErrorCode& status) const; @@ -77,7 +76,7 @@ class NFRule : public UMemory { double upperBound, Formattable& result) const; - UBool shouldRollBack(double number) const; + UBool shouldRollBack(int64_t number) const; void _appendRuleText(UnicodeString& result) const; diff --git a/deps/icu-small/source/i18n/nfsubs.cpp b/deps/icu-small/source/i18n/nfsubs.cpp index 58039c8bacd570..1a0914152deaa4 100644 --- a/deps/icu-small/source/i18n/nfsubs.cpp +++ b/deps/icu-small/source/i18n/nfsubs.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: nfsubs.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -20,6 +20,7 @@ #include "nfsubs.h" #include "digitlst.h" +#include "fmtableimp.h" #if U_HAVE_RBNF @@ -68,27 +69,24 @@ class SameValueSubstitution : public NFSubstitution { SameValueSubstitution::~SameValueSubstitution() {} class MultiplierSubstitution : public NFSubstitution { - double divisor; - int64_t ldivisor; + int64_t divisor; public: MultiplierSubstitution(int32_t _pos, - double _divisor, + const NFRule *rule, const NFRuleSet* _ruleSet, const UnicodeString& description, UErrorCode& status) - : NFSubstitution(_pos, _ruleSet, description, status), divisor(_divisor) + : NFSubstitution(_pos, _ruleSet, description, status), divisor(rule->getDivisor()) { - ldivisor = util64_fromDouble(divisor); if (divisor == 0) { status = U_PARSE_ERROR; } } virtual ~MultiplierSubstitution(); - virtual void setDivisor(int32_t radix, int32_t exponent, UErrorCode& status) { - divisor = uprv_pow(radix, exponent); - ldivisor = util64_fromDouble(divisor); + virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) { + divisor = util64_pow(radix, exponent); if(divisor == 0) { status = U_PARSE_ERROR; @@ -98,14 +96,14 @@ class MultiplierSubstitution : public NFSubstitution { virtual UBool operator==(const NFSubstitution& rhs) const; virtual int64_t transformNumber(int64_t number) const { - return number / ldivisor; + return number / divisor; } virtual double transformNumber(double number) const { if (getRuleSet()) { return uprv_floor(number / divisor); } else { - return number/divisor; + return number / divisor; } } @@ -113,7 +111,7 @@ class MultiplierSubstitution : public NFSubstitution { return newRuleValue * divisor; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return divisor; } + virtual double calcUpperBound(double /*oldUpperBound*/) const { return static_cast(divisor); } virtual UChar tokenChar() const { return (UChar)0x003c; } // '<' @@ -125,21 +123,19 @@ class MultiplierSubstitution : public NFSubstitution { MultiplierSubstitution::~MultiplierSubstitution() {} class ModulusSubstitution : public NFSubstitution { - double divisor; - int64_t ldivisor; + int64_t divisor; const NFRule* ruleToUse; public: ModulusSubstitution(int32_t pos, - double _divisor, + const NFRule* rule, const NFRule* rulePredecessor, const NFRuleSet* ruleSet, const UnicodeString& description, UErrorCode& status); virtual ~ModulusSubstitution(); - virtual void setDivisor(int32_t radix, int32_t exponent, UErrorCode& status) { - divisor = uprv_pow(radix, exponent); - ldivisor = util64_fromDouble(divisor); + virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) { + divisor = util64_pow(radix, exponent); if (divisor == 0) { status = U_PARSE_ERROR; @@ -151,8 +147,8 @@ class ModulusSubstitution : public NFSubstitution { virtual void doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; - virtual int64_t transformNumber(int64_t number) const { return number % ldivisor; } - virtual double transformNumber(double number) const { return uprv_fmod(number, divisor); } + virtual int64_t transformNumber(int64_t number) const { return number % divisor; } + virtual double transformNumber(double number) const { return uprv_fmod(number, static_cast(divisor)); } virtual UBool doParse(const UnicodeString& text, ParsePosition& parsePosition, @@ -162,10 +158,10 @@ class ModulusSubstitution : public NFSubstitution { Formattable& result) const; virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { - return oldRuleValue - uprv_fmod(oldRuleValue, divisor) + newRuleValue; + return oldRuleValue - uprv_fmod(oldRuleValue, static_cast(divisor)) + newRuleValue; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return divisor; } + virtual double calcUpperBound(double /*oldUpperBound*/) const { return static_cast(divisor); } virtual UBool isModulusSubstitution() const { return TRUE; } @@ -353,7 +349,7 @@ NFSubstitution::makeSubstitution(int32_t pos, // otherwise, return a MultiplierSubstitution else { - return new MultiplierSubstitution(pos, rule->getDivisor(), ruleSet, + return new MultiplierSubstitution(pos, rule, ruleSet, description, status); } @@ -383,7 +379,7 @@ NFSubstitution::makeSubstitution(int32_t pos, // otherwise, return a ModulusSubstitution else { - return new ModulusSubstitution(pos, rule->getDivisor(), predecessor, + return new ModulusSubstitution(pos, rule, predecessor, ruleSet, description, status); } @@ -491,7 +487,7 @@ NFSubstitution::~NFSubstitution() * @param exponent The exponent of the divisor */ void -NFSubstitution::setDivisor(int32_t /*radix*/, int32_t /*exponent*/, UErrorCode& /*status*/) { +NFSubstitution::setDivisor(int32_t /*radix*/, int16_t /*exponent*/, UErrorCode& /*status*/) { // a no-op for all substitutions except multiplier and modulus substitutions } @@ -572,23 +568,38 @@ void NFSubstitution::doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t _pos, int32_t recursionCount, UErrorCode& status) const { if (ruleSet != NULL) { - // perform a transformation on the number that is dependent + // Perform a transformation on the number that is dependent // on the type of substitution this is, then just call its // rule set's format() method to format the result ruleSet->format(transformNumber(number), toInsertInto, _pos + this->pos, recursionCount, status); } else if (numberFormat != NULL) { - // or perform the transformation on the number (preserving - // the result's fractional part if the formatter it set - // to show it), then use that formatter's format() method - // to format the result - double numberToFormat = transformNumber((double)number); - if (numberFormat->getMaximumFractionDigits() == 0) { - numberToFormat = uprv_floor(numberToFormat); - } + if (number <= MAX_INT64_IN_DOUBLE) { + // or perform the transformation on the number (preserving + // the result's fractional part if the formatter it set + // to show it), then use that formatter's format() method + // to format the result + double numberToFormat = transformNumber((double)number); + if (numberFormat->getMaximumFractionDigits() == 0) { + numberToFormat = uprv_floor(numberToFormat); + } - UnicodeString temp; - numberFormat->format(numberToFormat, temp, status); - toInsertInto.insert(_pos + this->pos, temp); + UnicodeString temp; + numberFormat->format(numberToFormat, temp, status); + toInsertInto.insert(_pos + this->pos, temp); + } + else { + // We have gone beyond double precision. Something has to give. + // We're favoring accuracy of the large number over potential rules + // that round like a CompactDecimalFormat, which is not a common use case. + // + // Perform a transformation on the number that is dependent + // on the type of substitution this is, then just call its + // rule set's format() method to format the result + int64_t numberToFormat = transformNumber(number); + UnicodeString temp; + numberFormat->format(numberToFormat, temp, status); + toInsertInto.insert(_pos + this->pos, temp); + } } } @@ -809,22 +820,20 @@ UBool MultiplierSubstitution::operator==(const NFSubstitution& rhs) const * regular rule. */ ModulusSubstitution::ModulusSubstitution(int32_t _pos, - double _divisor, + const NFRule* rule, const NFRule* predecessor, const NFRuleSet* _ruleSet, const UnicodeString& description, UErrorCode& status) : NFSubstitution(_pos, _ruleSet, description, status) - , divisor(_divisor) + , divisor(rule->getDivisor()) , ruleToUse(NULL) { - ldivisor = util64_fromDouble(_divisor); - // the owning rule's divisor controls the behavior of this // substitution: rather than keeping a backpointer to the rule, // we keep a copy of the divisor - if (ldivisor == 0) { + if (divisor == 0) { status = U_PARSE_ERROR; } diff --git a/deps/icu-small/source/i18n/nfsubs.h b/deps/icu-small/source/i18n/nfsubs.h index 4fb0c06caf600e..e77f7ada8c7fe3 100644 --- a/deps/icu-small/source/i18n/nfsubs.h +++ b/deps/icu-small/source/i18n/nfsubs.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: nfsubs.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -91,7 +91,7 @@ class NFSubstitution : public UObject { * @param radix The radix of the divisor * @param exponent The exponent of the divisor */ - virtual void setDivisor(int32_t radix, int32_t exponent, UErrorCode& status); + virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status); /** * Replaces result with the string describing the substitution. diff --git a/deps/icu-small/source/i18n/nortrans.cpp b/deps/icu-small/source/i18n/nortrans.cpp index da0206776ced93..589c82482ec9b9 100644 --- a/deps/icu-small/source/i18n/nortrans.cpp +++ b/deps/icu-small/source/i18n/nortrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/nortrans.h b/deps/icu-small/source/i18n/nortrans.h index 79d1be3b072179..d309452f9a4d6a 100644 --- a/deps/icu-small/source/i18n/nortrans.h +++ b/deps/icu-small/source/i18n/nortrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/nounit.cpp b/deps/icu-small/source/i18n/nounit.cpp new file mode 100644 index 00000000000000..db07387c590af8 --- /dev/null +++ b/deps/icu-small/source/i18n/nounit.cpp @@ -0,0 +1,42 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/nounit.h" +#include "uassert.h" + +#if !UCONFIG_NO_FORMATTING + +U_NAMESPACE_BEGIN + +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NoUnit) + +NoUnit U_EXPORT2 NoUnit::base() { + return NoUnit("base"); +} + +NoUnit U_EXPORT2 NoUnit::percent() { + return NoUnit("percent"); +} + +NoUnit U_EXPORT2 NoUnit::permille() { + return NoUnit("permille"); +} + +NoUnit::NoUnit(const char* subtype) { + initNoUnit(subtype); +} + +NoUnit::NoUnit(const NoUnit& other) : MeasureUnit(other) { +} + +UObject* NoUnit::clone() const { + return new NoUnit(*this); +} + +NoUnit::~NoUnit() { +} + + +U_NAMESPACE_END + +#endif diff --git a/deps/icu-small/source/i18n/nultrans.cpp b/deps/icu-small/source/i18n/nultrans.cpp index 600873e3735f41..62d1290ac75e93 100644 --- a/deps/icu-small/source/i18n/nultrans.cpp +++ b/deps/icu-small/source/i18n/nultrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/nultrans.h b/deps/icu-small/source/i18n/nultrans.h index a9856bde5b2b2e..a01b04e9ba1ec9 100644 --- a/deps/icu-small/source/i18n/nultrans.h +++ b/deps/icu-small/source/i18n/nultrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/number_affixutils.cpp b/deps/icu-small/source/i18n/number_affixutils.cpp new file mode 100644 index 00000000000000..4dfdbc7ab708fc --- /dev/null +++ b/deps/icu-small/source/i18n/number_affixutils.cpp @@ -0,0 +1,403 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "number_affixutils.h" +#include "unicode/utf16.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +int32_t AffixUtils::estimateLength(const CharSequence &patternString, UErrorCode &status) { + AffixPatternState state = STATE_BASE; + int32_t offset = 0; + int32_t length = 0; + for (; offset < patternString.length();) { + UChar32 cp = patternString.codePointAt(offset); + + switch (state) { + case STATE_BASE: + if (cp == u'\'') { + // First quote + state = STATE_FIRST_QUOTE; + } else { + // Unquoted symbol + length++; + } + break; + case STATE_FIRST_QUOTE: + if (cp == u'\'') { + // Repeated quote + length++; + state = STATE_BASE; + } else { + // Quoted code point + length++; + state = STATE_INSIDE_QUOTE; + } + break; + case STATE_INSIDE_QUOTE: + if (cp == u'\'') { + // End of quoted sequence + state = STATE_AFTER_QUOTE; + } else { + // Quoted code point + length++; + } + break; + case STATE_AFTER_QUOTE: + if (cp == u'\'') { + // Double quote inside of quoted sequence + length++; + state = STATE_INSIDE_QUOTE; + } else { + // Unquoted symbol + length++; + } + break; + default: + U_ASSERT(false); + } + + offset += U16_LENGTH(cp); + } + + switch (state) { + case STATE_FIRST_QUOTE: + case STATE_INSIDE_QUOTE: + status = U_ILLEGAL_ARGUMENT_ERROR; + default: + break; + } + + return length; +} + +UnicodeString AffixUtils::escape(const CharSequence &input) { + AffixPatternState state = STATE_BASE; + int32_t offset = 0; + UnicodeString output; + for (; offset < input.length();) { + UChar32 cp = input.codePointAt(offset); + + switch (cp) { + case u'\'': + output.append(u"''", -1); + break; + + case u'-': + case u'+': + case u'%': + case u'‰': + case u'¤': + if (state == STATE_BASE) { + output.append(u'\''); + output.append(cp); + state = STATE_INSIDE_QUOTE; + } else { + output.append(cp); + } + break; + + default: + if (state == STATE_INSIDE_QUOTE) { + output.append(u'\''); + output.append(cp); + state = STATE_BASE; + } else { + output.append(cp); + } + break; + } + offset += U16_LENGTH(cp); + } + + if (state == STATE_INSIDE_QUOTE) { + output.append(u'\''); + } + + return output; +} + +Field AffixUtils::getFieldForType(AffixPatternType type) { + switch (type) { + case TYPE_MINUS_SIGN: + return Field::UNUM_SIGN_FIELD; + case TYPE_PLUS_SIGN: + return Field::UNUM_SIGN_FIELD; + case TYPE_PERCENT: + return Field::UNUM_PERCENT_FIELD; + case TYPE_PERMILLE: + return Field::UNUM_PERMILL_FIELD; + case TYPE_CURRENCY_SINGLE: + return Field::UNUM_CURRENCY_FIELD; + case TYPE_CURRENCY_DOUBLE: + return Field::UNUM_CURRENCY_FIELD; + case TYPE_CURRENCY_TRIPLE: + return Field::UNUM_CURRENCY_FIELD; + case TYPE_CURRENCY_QUAD: + return Field::UNUM_CURRENCY_FIELD; + case TYPE_CURRENCY_QUINT: + return Field::UNUM_CURRENCY_FIELD; + case TYPE_CURRENCY_OVERFLOW: + return Field::UNUM_CURRENCY_FIELD; + default: + U_ASSERT(false); + return Field::UNUM_FIELD_COUNT; // suppress "control reaches end of non-void function" + } +} + +int32_t +AffixUtils::unescape(const CharSequence &affixPattern, NumberStringBuilder &output, int32_t position, + const SymbolProvider &provider, UErrorCode &status) { + int32_t length = 0; + AffixTag tag; + while (hasNext(tag, affixPattern)) { + tag = nextToken(tag, affixPattern, status); + if (U_FAILURE(status)) { return length; } + if (tag.type == TYPE_CURRENCY_OVERFLOW) { + // Don't go to the provider for this special case + length += output.insertCodePoint(position + length, 0xFFFD, UNUM_CURRENCY_FIELD, status); + } else if (tag.type < 0) { + length += output.insert( + position + length, provider.getSymbol(tag.type), getFieldForType(tag.type), status); + } else { + length += output.insertCodePoint(position + length, tag.codePoint, UNUM_FIELD_COUNT, status); + } + } + return length; +} + +int32_t AffixUtils::unescapedCodePointCount(const CharSequence &affixPattern, + const SymbolProvider &provider, UErrorCode &status) { + int32_t length = 0; + AffixTag tag; + while (hasNext(tag, affixPattern)) { + tag = nextToken(tag, affixPattern, status); + if (U_FAILURE(status)) { return length; } + if (tag.type == TYPE_CURRENCY_OVERFLOW) { + length += 1; + } else if (tag.type < 0) { + length += provider.getSymbol(tag.type).length(); + } else { + length += U16_LENGTH(tag.codePoint); + } + } + return length; +} + +bool +AffixUtils::containsType(const CharSequence &affixPattern, AffixPatternType type, UErrorCode &status) { + if (affixPattern.length() == 0) { + return false; + } + AffixTag tag; + while (hasNext(tag, affixPattern)) { + tag = nextToken(tag, affixPattern, status); + if (U_FAILURE(status)) { return false; } + if (tag.type == type) { + return true; + } + } + return false; +} + +bool AffixUtils::hasCurrencySymbols(const CharSequence &affixPattern, UErrorCode &status) { + if (affixPattern.length() == 0) { + return false; + } + AffixTag tag; + while (hasNext(tag, affixPattern)) { + tag = nextToken(tag, affixPattern, status); + if (U_FAILURE(status)) { return false; } + if (tag.type < 0 && getFieldForType(tag.type) == UNUM_CURRENCY_FIELD) { + return true; + } + } + return false; +} + +UnicodeString AffixUtils::replaceType(const CharSequence &affixPattern, AffixPatternType type, + char16_t replacementChar, UErrorCode &status) { + UnicodeString output = affixPattern.toUnicodeString(); + if (affixPattern.length() == 0) { + return output; + }; + AffixTag tag; + while (hasNext(tag, affixPattern)) { + tag = nextToken(tag, affixPattern, status); + if (U_FAILURE(status)) { return output; } + if (tag.type == type) { + output.replace(tag.offset - 1, 1, replacementChar); + } + } + return output; +} + +AffixTag AffixUtils::nextToken(AffixTag tag, const CharSequence &patternString, UErrorCode &status) { + int32_t offset = tag.offset; + int32_t state = tag.state; + for (; offset < patternString.length();) { + UChar32 cp = patternString.codePointAt(offset); + int32_t count = U16_LENGTH(cp); + + switch (state) { + case STATE_BASE: + switch (cp) { + case u'\'': + state = STATE_FIRST_QUOTE; + offset += count; + // continue to the next code point + break; + case u'-': + return makeTag(offset + count, TYPE_MINUS_SIGN, STATE_BASE, 0); + case u'+': + return makeTag(offset + count, TYPE_PLUS_SIGN, STATE_BASE, 0); + case u'%': + return makeTag(offset + count, TYPE_PERCENT, STATE_BASE, 0); + case u'‰': + return makeTag(offset + count, TYPE_PERMILLE, STATE_BASE, 0); + case u'¤': + state = STATE_FIRST_CURR; + offset += count; + // continue to the next code point + break; + default: + return makeTag(offset + count, TYPE_CODEPOINT, STATE_BASE, cp); + } + break; + case STATE_FIRST_QUOTE: + if (cp == u'\'') { + return makeTag(offset + count, TYPE_CODEPOINT, STATE_BASE, cp); + } else { + return makeTag(offset + count, TYPE_CODEPOINT, STATE_INSIDE_QUOTE, cp); + } + case STATE_INSIDE_QUOTE: + if (cp == u'\'') { + state = STATE_AFTER_QUOTE; + offset += count; + // continue to the next code point + break; + } else { + return makeTag(offset + count, TYPE_CODEPOINT, STATE_INSIDE_QUOTE, cp); + } + case STATE_AFTER_QUOTE: + if (cp == u'\'') { + return makeTag(offset + count, TYPE_CODEPOINT, STATE_INSIDE_QUOTE, cp); + } else { + state = STATE_BASE; + // re-evaluate this code point + break; + } + case STATE_FIRST_CURR: + if (cp == u'¤') { + state = STATE_SECOND_CURR; + offset += count; + // continue to the next code point + break; + } else { + return makeTag(offset, TYPE_CURRENCY_SINGLE, STATE_BASE, 0); + } + case STATE_SECOND_CURR: + if (cp == u'¤') { + state = STATE_THIRD_CURR; + offset += count; + // continue to the next code point + break; + } else { + return makeTag(offset, TYPE_CURRENCY_DOUBLE, STATE_BASE, 0); + } + case STATE_THIRD_CURR: + if (cp == u'¤') { + state = STATE_FOURTH_CURR; + offset += count; + // continue to the next code point + break; + } else { + return makeTag(offset, TYPE_CURRENCY_TRIPLE, STATE_BASE, 0); + } + case STATE_FOURTH_CURR: + if (cp == u'¤') { + state = STATE_FIFTH_CURR; + offset += count; + // continue to the next code point + break; + } else { + return makeTag(offset, TYPE_CURRENCY_QUAD, STATE_BASE, 0); + } + case STATE_FIFTH_CURR: + if (cp == u'¤') { + state = STATE_OVERFLOW_CURR; + offset += count; + // continue to the next code point + break; + } else { + return makeTag(offset, TYPE_CURRENCY_QUINT, STATE_BASE, 0); + } + case STATE_OVERFLOW_CURR: + if (cp == u'¤') { + offset += count; + // continue to the next code point and loop back to this state + break; + } else { + return makeTag(offset, TYPE_CURRENCY_OVERFLOW, STATE_BASE, 0); + } + default: + U_ASSERT(false); + } + } + // End of string + switch (state) { + case STATE_BASE: + // No more tokens in string. + return {-1}; + case STATE_FIRST_QUOTE: + case STATE_INSIDE_QUOTE: + // For consistent behavior with the JDK and ICU 58, set an error here. + status = U_ILLEGAL_ARGUMENT_ERROR; + return {-1}; + case STATE_AFTER_QUOTE: + // No more tokens in string. + return {-1}; + case STATE_FIRST_CURR: + return makeTag(offset, TYPE_CURRENCY_SINGLE, STATE_BASE, 0); + case STATE_SECOND_CURR: + return makeTag(offset, TYPE_CURRENCY_DOUBLE, STATE_BASE, 0); + case STATE_THIRD_CURR: + return makeTag(offset, TYPE_CURRENCY_TRIPLE, STATE_BASE, 0); + case STATE_FOURTH_CURR: + return makeTag(offset, TYPE_CURRENCY_QUAD, STATE_BASE, 0); + case STATE_FIFTH_CURR: + return makeTag(offset, TYPE_CURRENCY_QUINT, STATE_BASE, 0); + case STATE_OVERFLOW_CURR: + return makeTag(offset, TYPE_CURRENCY_OVERFLOW, STATE_BASE, 0); + default: + U_ASSERT(false); + return {-1}; // suppress "control reaches end of non-void function" + } +} + +bool AffixUtils::hasNext(const AffixTag &tag, const CharSequence &string) { + // First check for the {-1} and default initializer syntax. + if (tag.offset < 0) { + return false; + } else if (tag.offset == 0) { + return string.length() > 0; + } + // The rest of the fields are safe to use now. + // Special case: the last character in string is an end quote. + if (tag.state == STATE_INSIDE_QUOTE && tag.offset == string.length() - 1 && + string.charAt(tag.offset) == u'\'') { + return false; + } else if (tag.state != STATE_BASE) { + return true; + } else { + return tag.offset < string.length(); + } +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_affixutils.h b/deps/icu-small/source/i18n/number_affixutils.h new file mode 100644 index 00000000000000..8358a6ab49dfa7 --- /dev/null +++ b/deps/icu-small/source/i18n/number_affixutils.h @@ -0,0 +1,228 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_AFFIXUTILS_H__ +#define __NUMBER_AFFIXUTILS_H__ + +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "number_types.h" +#include "unicode/stringpiece.h" +#include "unicode/unistr.h" +#include "number_stringbuilder.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +enum AffixPatternState { + STATE_BASE = 0, + STATE_FIRST_QUOTE = 1, + STATE_INSIDE_QUOTE = 2, + STATE_AFTER_QUOTE = 3, + STATE_FIRST_CURR = 4, + STATE_SECOND_CURR = 5, + STATE_THIRD_CURR = 6, + STATE_FOURTH_CURR = 7, + STATE_FIFTH_CURR = 8, + STATE_OVERFLOW_CURR = 9 +}; + +// enum AffixPatternType defined in internals.h + +struct AffixTag { + int32_t offset; + UChar32 codePoint; + AffixPatternState state; + AffixPatternType type; + + AffixTag() : offset(0), state(STATE_BASE) {} + + AffixTag(int32_t offset) : offset(offset) {} + + AffixTag(int32_t offset, UChar32 codePoint, AffixPatternState state, AffixPatternType type) + : offset(offset), codePoint(codePoint), state(state), type(type) + {} +}; + +// Exported as U_I18N_API because it is a base class for other exported types +class U_I18N_API SymbolProvider { + public: + virtual ~SymbolProvider() = default; + + // TODO: Could this be more efficient if it returned by reference? + virtual UnicodeString getSymbol(AffixPatternType type) const = 0; +}; + +/** + * Performs manipulations on affix patterns: the prefix and suffix strings associated with a decimal + * format pattern. For example: + * + * + * + * + * + * + * + *
Affix PatternExample Unescaped (Formatted) String
abcabc
ab-ab−
ab'-'ab-
ab''ab'
+ * + * To manually iterate over tokens in a literal string, use the following pattern, which is designed + * to be efficient. + * + *

+ * long tag = 0L;
+ * while (AffixPatternUtils.hasNext(tag, patternString)) {
+ *   tag = AffixPatternUtils.nextToken(tag, patternString);
+ *   int typeOrCp = AffixPatternUtils.getTypeOrCp(tag);
+ *   switch (typeOrCp) {
+ *     case AffixPatternUtils.TYPE_MINUS_SIGN:
+ *       // Current token is a minus sign.
+ *       break;
+ *     case AffixPatternUtils.TYPE_PLUS_SIGN:
+ *       // Current token is a plus sign.
+ *       break;
+ *     case AffixPatternUtils.TYPE_PERCENT:
+ *       // Current token is a percent sign.
+ *       break;
+ *     // ... other types ...
+ *     default:
+ *       // Current token is an arbitrary code point.
+ *       // The variable typeOrCp is the code point.
+ *       break;
+ *   }
+ * }
+ * 
+ */ +class U_I18N_API AffixUtils { + + public: + + /** + * Estimates the number of code points present in an unescaped version of the affix pattern string + * (one that would be returned by {@link #unescape}), assuming that all interpolated symbols + * consume one code point and that currencies consume as many code points as their symbol width. + * Used for computing padding width. + * + * @param patternString The original string whose width will be estimated. + * @return The length of the unescaped string. + */ + static int32_t estimateLength(const CharSequence &patternString, UErrorCode &status); + + /** + * Takes a string and escapes (quotes) characters that have special meaning in the affix pattern + * syntax. This function does not reverse-lookup symbols. + * + *

Example input: "-$x"; example output: "'-'$x" + * + * @param input The string to be escaped. + * @return The resulting UnicodeString. + */ + static UnicodeString escape(const CharSequence &input); + + static Field getFieldForType(AffixPatternType type); + + /** + * Executes the unescape state machine. Replaces the unquoted characters "-", "+", "%", "‰", and + * "¤" with the corresponding symbols provided by the {@link SymbolProvider}, and inserts the + * result into the NumberStringBuilder at the requested location. + * + *

Example input: "'-'¤x"; example output: "-$x" + * + * @param affixPattern The original string to be unescaped. + * @param output The NumberStringBuilder to mutate with the result. + * @param position The index into the NumberStringBuilder to insert the string. + * @param provider An object to generate locale symbols. + */ + static int32_t + unescape(const CharSequence &affixPattern, NumberStringBuilder &output, int32_t position, + const SymbolProvider &provider, UErrorCode &status); + + /** + * Sames as {@link #unescape}, but only calculates the code point count. More efficient than {@link #unescape} + * if you only need the length but not the string itself. + * + * @param affixPattern The original string to be unescaped. + * @param provider An object to generate locale symbols. + * @return The same return value as if you called {@link #unescape}. + */ + static int32_t unescapedCodePointCount(const CharSequence &affixPattern, + const SymbolProvider &provider, UErrorCode &status); + + /** + * Checks whether the given affix pattern contains at least one token of the given type, which is + * one of the constants "TYPE_" in {@link AffixPatternUtils}. + * + * @param affixPattern The affix pattern to check. + * @param type The token type. + * @return true if the affix pattern contains the given token type; false otherwise. + */ + static bool + containsType(const CharSequence &affixPattern, AffixPatternType type, UErrorCode &status); + + /** + * Checks whether the specified affix pattern has any unquoted currency symbols ("¤"). + * + * @param affixPattern The string to check for currency symbols. + * @return true if the literal has at least one unquoted currency symbol; false otherwise. + */ + static bool hasCurrencySymbols(const CharSequence &affixPattern, UErrorCode &status); + + /** + * Replaces all occurrences of tokens with the given type with the given replacement char. + * + * @param affixPattern The source affix pattern (does not get modified). + * @param type The token type. + * @param replacementChar The char to substitute in place of chars of the given token type. + * @return A string containing the new affix pattern. + */ + static UnicodeString + replaceType(const CharSequence &affixPattern, AffixPatternType type, char16_t replacementChar, + UErrorCode &status); + + /** + * Returns the next token from the affix pattern. + * + * @param tag A bitmask used for keeping track of state from token to token. The initial value + * should be 0L. + * @param patternString The affix pattern. + * @return The bitmask tag to pass to the next call of this method to retrieve the following token + * (never negative), or -1 if there were no more tokens in the affix pattern. + * @see #hasNext + */ + static AffixTag nextToken(AffixTag tag, const CharSequence &patternString, UErrorCode &status); + + /** + * Returns whether the affix pattern string has any more tokens to be retrieved from a call to + * {@link #nextToken}. + * + * @param tag The bitmask tag of the previous token, as returned by {@link #nextToken}. + * @param string The affix pattern. + * @return true if there are more tokens to consume; false otherwise. + */ + static bool hasNext(const AffixTag &tag, const CharSequence &string); + + private: + /** + * Encodes the given values into a tag struct. + * The order of the arguments is consistent with Java, but the order of the stored + * fields is not necessarily the same. + */ + static inline AffixTag + makeTag(int32_t offset, AffixPatternType type, AffixPatternState state, UChar32 cp) { + return {offset, cp, state, type}; + } +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_AFFIXUTILS_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_compact.cpp b/deps/icu-small/source/i18n/number_compact.cpp new file mode 100644 index 00000000000000..8ceee1378b24cb --- /dev/null +++ b/deps/icu-small/source/i18n/number_compact.cpp @@ -0,0 +1,326 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "resource.h" +#include "number_compact.h" +#include "unicode/ustring.h" +#include "unicode/ures.h" +#include "cstring.h" +#include "charstr.h" +#include "uresimp.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +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""; + +/** Produces a string like "NumberElements/latn/patternsShort/decimalFormat". */ +void getResourceBundleKey(const char *nsName, CompactStyle compactStyle, CompactType compactType, + CharString &sb, UErrorCode &status) { + sb.clear(); + sb.append("NumberElements/", status); + sb.append(nsName, status); + sb.append(compactStyle == CompactStyle::UNUM_SHORT ? "/patternsShort" : "/patternsLong", status); + sb.append(compactType == CompactType::TYPE_DECIMAL ? "/decimalFormat" : "/currencyFormat", status); +} + +int32_t getIndex(int32_t magnitude, StandardPlural::Form plural) { + return magnitude * StandardPlural::COUNT + plural; +} + +int32_t countZeros(const UChar *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; + for (int32_t i = 0; i < patternLength; i++) { + if (patternString[i] == u'0') { + numZeros++; + } else if (numZeros > 0) { + break; // zeros should always be contiguous + } + } + return numZeros; +} + +} // namespace + +// NOTE: patterns and multipliers both get zero-initialized. +CompactData::CompactData() : patterns(), multipliers(), largestMagnitude(0), isEmpty(TRUE) { +} + +void CompactData::populate(const Locale &locale, const char *nsName, CompactStyle compactStyle, + CompactType compactType, UErrorCode &status) { + CompactDataSink sink(*this); + LocalUResourceBundlePointer rb(ures_open(nullptr, locale.getName(), &status)); + if (U_FAILURE(status)) { return; } + + bool nsIsLatn = strcmp(nsName, "latn") == 0; + bool compactIsShort = compactStyle == CompactStyle::UNUM_SHORT; + + // Fall back to latn numbering system and/or short compact style. + CharString resourceKey; + getResourceBundleKey(nsName, compactStyle, compactType, resourceKey, status); + UErrorCode localStatus = U_ZERO_ERROR; + ures_getAllItemsWithFallback(rb.getAlias(), resourceKey.data(), sink, localStatus); + if (isEmpty && !nsIsLatn) { + getResourceBundleKey("latn", compactStyle, compactType, resourceKey, status); + localStatus = U_ZERO_ERROR; + ures_getAllItemsWithFallback(rb.getAlias(), resourceKey.data(), sink, localStatus); + } + if (isEmpty && !compactIsShort) { + getResourceBundleKey(nsName, CompactStyle::UNUM_SHORT, compactType, resourceKey, status); + localStatus = U_ZERO_ERROR; + ures_getAllItemsWithFallback(rb.getAlias(), resourceKey.data(), sink, localStatus); + } + if (isEmpty && !nsIsLatn && !compactIsShort) { + getResourceBundleKey("latn", CompactStyle::UNUM_SHORT, compactType, resourceKey, status); + localStatus = U_ZERO_ERROR; + ures_getAllItemsWithFallback(rb.getAlias(), resourceKey.data(), sink, localStatus); + } + + // The last fallback should be guaranteed to return data. + if (isEmpty) { + status = U_INTERNAL_PROGRAM_ERROR; + } +} + +int32_t CompactData::getMultiplier(int32_t magnitude) const { + if (magnitude < 0) { + return 0; + } + if (magnitude > largestMagnitude) { + magnitude = largestMagnitude; + } + return multipliers[magnitude]; +} + +const UChar *CompactData::getPattern(int32_t magnitude, StandardPlural::Form plural) const { + if (magnitude < 0) { + return nullptr; + } + if (magnitude > largestMagnitude) { + magnitude = largestMagnitude; + } + const UChar *patternString = patterns[getIndex(magnitude, plural)]; + if (patternString == nullptr && plural != StandardPlural::OTHER) { + // Fall back to "other" plural variant + patternString = patterns[getIndex(magnitude, StandardPlural::OTHER)]; + } + if (patternString == USE_FALLBACK) { // == is intended + // Return null if USE_FALLBACK is present + patternString = nullptr; + } + return patternString; +} + +void CompactData::getUniquePatterns(UVector &output, UErrorCode &status) const { + U_ASSERT(output.isEmpty()); + // NOTE: In C++, this is done more manually with a UVector. + // In Java, we can take advantage of JDK HashSet. + for (auto pattern : patterns) { + if (pattern == nullptr || pattern == USE_FALLBACK) { + continue; + } + + // 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(output[i])) == 0) { + goto continue_outer; + } + } + + // The string was not found; add it to the UVector. + // ANDY: This requires a const_cast. Why? + output.addElement(const_cast(pattern), status); + + continue_outer: + continue; + } +} + +void CompactData::CompactDataSink::put(const char *key, ResourceValue &value, UBool /*noFallback*/, + UErrorCode &status) { + // traverse into the table of powers of ten + ResourceTable powersOfTenTable = value.getTable(status); + if (U_FAILURE(status)) { return; } + for (int i3 = 0; powersOfTenTable.getKeyAndValue(i3, key, value); ++i3) { + + // Assumes that the keys are always of the form "10000" where the magnitude is the + // length of the key minus one. We expect magnitudes to be less than MAX_DIGITS. + auto magnitude = static_cast (strlen(key) - 1); + int8_t multiplier = data.multipliers[magnitude]; + U_ASSERT(magnitude < COMPACT_MAX_DIGITS); + + // Iterate over the plural variants ("one", "other", etc) + ResourceTable pluralVariantsTable = value.getTable(status); + if (U_FAILURE(status)) { return; } + for (int i4 = 0; pluralVariantsTable.getKeyAndValue(i4, key, value); ++i4) { + + // Skip this magnitude/plural if we already have it from a child locale. + // Note: This also skips USE_FALLBACK entries. + StandardPlural::Form plural = StandardPlural::fromString(key, status); + if (U_FAILURE(status)) { return; } + if (data.patterns[getIndex(magnitude, plural)] != nullptr) { + continue; + } + + // 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); + if (U_FAILURE(status)) { return; } + if (u_strcmp(patternString, u"0") == 0) { + patternString = USE_FALLBACK; + patternLength = 0; + } + + // Save the pattern string. We will parse it lazily. + data.patterns[getIndex(magnitude, plural)] = patternString; + + // If necessary, compute the multiplier: the difference between the magnitude + // and the number of zeros in the pattern. + if (multiplier == 0) { + int32_t numZeros = countZeros(patternString, patternLength); + if (numZeros > 0) { // numZeros==0 in certain cases, like Somali "Kun" + multiplier = static_cast (numZeros - magnitude - 1); + } + } + } + + // Save the multiplier. + if (data.multipliers[magnitude] == 0) { + data.multipliers[magnitude] = multiplier; + if (magnitude > data.largestMagnitude) { + data.largestMagnitude = magnitude; + } + data.isEmpty = false; + } else { + U_ASSERT(data.multipliers[magnitude] == multiplier); + } + } +} + +/////////////////////////////////////////////////////////// +/// END OF CompactData.java; BEGIN CompactNotation.java /// +/////////////////////////////////////////////////////////// + +CompactHandler::CompactHandler(CompactStyle compactStyle, const Locale &locale, const char *nsName, + CompactType compactType, const PluralRules *rules, + MutablePatternModifier *buildReference, const MicroPropsGenerator *parent, + UErrorCode &status) + : rules(rules), parent(parent) { + data.populate(locale, nsName, compactStyle, compactType, status); + if (buildReference != nullptr) { + // Safe code path + precomputeAllModifiers(*buildReference, status); + safe = TRUE; + } else { + // Unsafe code path + safe = FALSE; + } +} + +CompactHandler::~CompactHandler() { + for (int32_t i = 0; i < precomputedModsLength; i++) { + delete precomputedMods[i].mod; + } +} + +void CompactHandler::precomputeAllModifiers(MutablePatternModifier &buildReference, UErrorCode &status) { + if (U_FAILURE(status)) { return; } + + // Initial capacity of 12 for 0K, 00K, 000K, ...M, ...B, and ...T + UVector allPatterns(12, status); + if (U_FAILURE(status)) { return; } + data.getUniquePatterns(allPatterns, status); + if (U_FAILURE(status)) { return; } + + // C++ only: ensure that precomputedMods has room. + precomputedModsLength = allPatterns.size(); + if (precomputedMods.getCapacity() < precomputedModsLength) { + precomputedMods.resize(allPatterns.size(), status); + if (U_FAILURE(status)) { return; } + } + + for (int32_t i = 0; i < precomputedModsLength; i++) { + auto patternString = static_cast(allPatterns[i]); + UnicodeString hello(patternString); + CompactModInfo &info = precomputedMods[i]; + ParsedPatternInfo patternInfo; + PatternParser::parseToPatternInfo(UnicodeString(patternString), patternInfo, status); + if (U_FAILURE(status)) { return; } + buildReference.setPatternInfo(&patternInfo); + info.mod = buildReference.createImmutable(status); + if (U_FAILURE(status)) { return; } + info.numDigits = patternInfo.positive.integerTotal; + info.patternString = patternString; + } +} + +void CompactHandler::processQuantity(DecimalQuantity &quantity, MicroProps µs, + UErrorCode &status) const { + parent->processQuantity(quantity, micros, status); + if (U_FAILURE(status)) { return; } + + // Treat zero as if it had magnitude 0 + int magnitude; + if (quantity.isZero()) { + magnitude = 0; + micros.rounding.apply(quantity, status); + } else { + // TODO: Revisit chooseMultiplierAndApply + int multiplier = micros.rounding.chooseMultiplierAndApply(quantity, data, status); + magnitude = quantity.isZero() ? 0 : quantity.getMagnitude(); + magnitude -= multiplier; + } + + StandardPlural::Form plural = quantity.getStandardPlural(rules); + const UChar *patternString = data.getPattern(magnitude, plural); + int numDigits = -1; + if (patternString == nullptr) { + // Use the default (non-compact) modifier. + // No need to take any action. + } else if (safe) { + // Safe code path. + // Java uses a hash set here for O(1) lookup. C++ uses a linear search. + // TODO: Benchmark this and maybe change to a binary search or hash table. + int32_t i = 0; + for (; i < precomputedModsLength; i++) { + const CompactModInfo &info = precomputedMods[i]; + if (u_strcmp(patternString, info.patternString) == 0) { + info.mod->applyToMicros(micros, quantity); + numDigits = info.numDigits; + break; + } + } + // It should be guaranteed that we found the entry. + U_ASSERT(i < precomputedModsLength); + } else { + // Unsafe code path. + // Overwrite the PatternInfo in the existing modMiddle. + // C++ Note: Use unsafePatternInfo for proper lifecycle. + ParsedPatternInfo &patternInfo = const_cast(this)->unsafePatternInfo; + PatternParser::parseToPatternInfo(UnicodeString(patternString), patternInfo, status); + static_cast(const_cast(micros.modMiddle)) + ->setPatternInfo(&patternInfo); + numDigits = patternInfo.positive.integerTotal; + } + + // FIXME: Deal with numDigits == 0 (Awaiting a test case) + (void)numDigits; + + // We already performed rounding. Do not perform it again. + micros.rounding = Rounder::constructPassThrough(); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_compact.h b/deps/icu-small/source/i18n/number_compact.h new file mode 100644 index 00000000000000..2344abf535a962 --- /dev/null +++ b/deps/icu-small/source/i18n/number_compact.h @@ -0,0 +1,91 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_COMPACT_H__ +#define __NUMBER_COMPACT_H__ + +#include "standardplural.h" +#include "number_types.h" +#include "unicode/unum.h" +#include "uvector.h" +#include "resource.h" +#include "number_patternmodifier.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +static const int32_t COMPACT_MAX_DIGITS = 15; + +class CompactData : public MultiplierProducer { + public: + CompactData(); + + void populate(const Locale &locale, const char *nsName, CompactStyle compactStyle, + CompactType compactType, UErrorCode &status); + + int32_t getMultiplier(int32_t magnitude) const U_OVERRIDE; + + const UChar *getPattern(int32_t magnitude, StandardPlural::Form plural) const; + + void getUniquePatterns(UVector &output, UErrorCode &status) const; + + private: + const UChar *patterns[(COMPACT_MAX_DIGITS + 1) * StandardPlural::COUNT]; + int8_t multipliers[COMPACT_MAX_DIGITS + 1]; + int8_t largestMagnitude; + UBool isEmpty; + + class CompactDataSink : public ResourceSink { + public: + explicit CompactDataSink(CompactData &data) : data(data) {} + + void put(const char *key, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) U_OVERRIDE; + + private: + CompactData &data; + }; +}; + +struct CompactModInfo { + const ImmutablePatternModifier *mod; + const UChar* patternString; + int32_t numDigits; +}; + +class CompactHandler : public MicroPropsGenerator, public UMemory { + public: + CompactHandler(CompactStyle compactStyle, const Locale &locale, const char *nsName, + CompactType compactType, const PluralRules *rules, + MutablePatternModifier *buildReference, const MicroPropsGenerator *parent, + UErrorCode &status); + + ~CompactHandler() U_OVERRIDE; + + void + processQuantity(DecimalQuantity &quantity, MicroProps µs, UErrorCode &status) const U_OVERRIDE; + + private: + const PluralRules *rules; + const MicroPropsGenerator *parent; + // Initial capacity of 12 for 0K, 00K, 000K, ...M, ...B, and ...T + MaybeStackArray precomputedMods; + int32_t precomputedModsLength = 0; + CompactData data; + ParsedPatternInfo unsafePatternInfo; + UBool safe; + + /** Used by the safe code path */ + void precomputeAllModifiers(MutablePatternModifier &buildReference, UErrorCode &status); +}; + + +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_COMPACT_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_decimalquantity.cpp b/deps/icu-small/source/i18n/number_decimalquantity.cpp new file mode 100644 index 00000000000000..72463576666bb1 --- /dev/null +++ b/deps/icu-small/source/i18n/number_decimalquantity.cpp @@ -0,0 +1,1011 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "uassert.h" +#include +#include "cmemory.h" +#include "decNumber.h" +#include +#include "number_decimalquantity.h" +#include "decContext.h" +#include "decNumber.h" +#include "number_roundingutils.h" +#include "unicode/plurrule.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + +int8_t NEGATIVE_FLAG = 1; +int8_t INFINITY_FLAG = 2; +int8_t NAN_FLAG = 4; + +static constexpr int32_t DEFAULT_DIGITS = 34; +typedef MaybeStackHeaderAndArray DecNumberWithStorage; + +/** Helper function to convert a decNumber-compatible string into a decNumber. */ +void stringToDecNumber(StringPiece n, DecNumberWithStorage &dn) { + decContext set; + uprv_decContextDefault(&set, DEC_INIT_BASE); + uprv_decContextSetRounding(&set, DEC_ROUND_HALF_EVEN); + set.traps = 0; // no traps, thank you + if (n.length() > DEFAULT_DIGITS) { + dn.resize(n.length(), 0); + set.digits = n.length(); + } else { + set.digits = DEFAULT_DIGITS; + } + uprv_decNumberFromString(dn.getAlias(), n.data(), &set); + U_ASSERT(DECDPUN == 1); +} + +/** Helper function for safe subtraction (no overflow). */ +inline int32_t safeSubtract(int32_t a, int32_t b) { + // Note: In C++, signed integer subtraction is undefined behavior. + int32_t diff = static_cast(static_cast(a) - static_cast(b)); + if (b < 0 && diff < a) { return INT32_MAX; } + if (b > 0 && diff > a) { return INT32_MIN; } + return diff; +} + +static double DOUBLE_MULTIPLIERS[] = { + 1e0, + 1e1, + 1e2, + 1e3, + 1e4, + 1e5, + 1e6, + 1e7, + 1e8, + 1e9, + 1e10, + 1e11, + 1e12, + 1e13, + 1e14, + 1e15, + 1e16, + 1e17, + 1e18, + 1e19, + 1e20, + 1e21}; + +} // namespace + + +DecimalQuantity::DecimalQuantity() { + setBcdToZero(); + flags = 0; +} + +DecimalQuantity::~DecimalQuantity() { + if (usingBytes) { + uprv_free(fBCD.bcdBytes.ptr); + fBCD.bcdBytes.ptr = nullptr; + usingBytes = false; + } +} + +DecimalQuantity::DecimalQuantity(const DecimalQuantity &other) { + *this = other; +} + +DecimalQuantity &DecimalQuantity::operator=(const DecimalQuantity &other) { + if (this == &other) { + return *this; + } + copyBcdFrom(other); + lOptPos = other.lOptPos; + lReqPos = other.lReqPos; + rReqPos = other.rReqPos; + rOptPos = other.rOptPos; + scale = other.scale; + precision = other.precision; + flags = other.flags; + origDouble = other.origDouble; + origDelta = other.origDelta; + isApproximate = other.isApproximate; + return *this; +} + +void DecimalQuantity::clear() { + lOptPos = INT32_MAX; + lReqPos = 0; + rReqPos = 0; + rOptPos = INT32_MIN; + flags = 0; + setBcdToZero(); // sets scale, precision, hasDouble, origDouble, origDelta, and BCD data +} + +void DecimalQuantity::setIntegerLength(int32_t minInt, int32_t maxInt) { + // Validation should happen outside of DecimalQuantity, e.g., in the Rounder class. + U_ASSERT(minInt >= 0); + U_ASSERT(maxInt >= minInt); + + // Save values into internal state + // Negation is safe for minFrac/maxFrac because -Integer.MAX_VALUE > Integer.MIN_VALUE + lOptPos = maxInt; + lReqPos = minInt; +} + +void DecimalQuantity::setFractionLength(int32_t minFrac, int32_t maxFrac) { + // Validation should happen outside of DecimalQuantity, e.g., in the Rounder class. + U_ASSERT(minFrac >= 0); + U_ASSERT(maxFrac >= minFrac); + + // Save values into internal state + // Negation is safe for minFrac/maxFrac because -Integer.MAX_VALUE > Integer.MIN_VALUE + rReqPos = -minFrac; + rOptPos = -maxFrac; +} + +uint64_t DecimalQuantity::getPositionFingerprint() const { + uint64_t fingerprint = 0; + fingerprint ^= lOptPos; + fingerprint ^= (lReqPos << 16); + fingerprint ^= (static_cast(rReqPos) << 32); + fingerprint ^= (static_cast(rOptPos) << 48); + return fingerprint; +} + +void DecimalQuantity::roundToIncrement(double roundingIncrement, RoundingMode roundingMode, + int32_t minMaxFrac, UErrorCode& status) { + // TODO: This is innefficient. Improve? + // TODO: Should we convert to decNumber instead? + double temp = toDouble(); + temp /= roundingIncrement; + setToDouble(temp); + roundToMagnitude(0, roundingMode, status); + temp = toDouble(); + temp *= roundingIncrement; + setToDouble(temp); + // Since we reset the value to a double, we need to specify the rounding boundary + // in order to get the DecimalQuantity out of approximation mode. + roundToMagnitude(-minMaxFrac, roundingMode, status); +} + +void DecimalQuantity::multiplyBy(int32_t multiplicand) { + if (isInfinite() || isZero() || isNaN()) { + return; + } + // TODO: Should we convert to decNumber instead? + double temp = toDouble(); + temp *= multiplicand; + setToDouble(temp); +} + +int32_t DecimalQuantity::getMagnitude() const { + U_ASSERT(precision != 0); + return scale + precision - 1; +} + +void DecimalQuantity::adjustMagnitude(int32_t delta) { + if (precision != 0) { + scale += delta; + origDelta += delta; + } +} + +StandardPlural::Form DecimalQuantity::getStandardPlural(const PluralRules *rules) const { + if (rules == nullptr) { + // Fail gracefully if the user didn't provide a PluralRules + return StandardPlural::Form::OTHER; + } else { + UnicodeString ruleString = rules->select(*this); + return StandardPlural::orOtherFromString(ruleString); + } +} + +double DecimalQuantity::getPluralOperand(PluralOperand operand) const { + // If this assertion fails, you need to call roundToInfinity() or some other rounding method. + // See the comment at the top of this file explaining the "isApproximate" field. + U_ASSERT(!isApproximate); + + switch (operand) { + case PLURAL_OPERAND_I: + return static_cast(toLong()); + case PLURAL_OPERAND_F: + return static_cast(toFractionLong(true)); + case PLURAL_OPERAND_T: + return static_cast(toFractionLong(false)); + case PLURAL_OPERAND_V: + return fractionCount(); + case PLURAL_OPERAND_W: + return fractionCountWithoutTrailingZeros(); + default: + return std::abs(toDouble()); + } +} + +int32_t DecimalQuantity::getUpperDisplayMagnitude() const { + // If this assertion fails, you need to call roundToInfinity() or some other rounding method. + // See the comment in the header file explaining the "isApproximate" field. + U_ASSERT(!isApproximate); + + int32_t magnitude = scale + precision; + int32_t result = (lReqPos > magnitude) ? lReqPos : (lOptPos < magnitude) ? lOptPos : magnitude; + return result - 1; +} + +int32_t DecimalQuantity::getLowerDisplayMagnitude() const { + // If this assertion fails, you need to call roundToInfinity() or some other rounding method. + // See the comment in the header file explaining the "isApproximate" field. + U_ASSERT(!isApproximate); + + int32_t magnitude = scale; + int32_t result = (rReqPos < magnitude) ? rReqPos : (rOptPos > magnitude) ? rOptPos : magnitude; + return result; +} + +int8_t DecimalQuantity::getDigit(int32_t magnitude) const { + // If this assertion fails, you need to call roundToInfinity() or some other rounding method. + // See the comment at the top of this file explaining the "isApproximate" field. + U_ASSERT(!isApproximate); + + return getDigitPos(magnitude - scale); +} + +int32_t DecimalQuantity::fractionCount() const { + return -getLowerDisplayMagnitude(); +} + +int32_t DecimalQuantity::fractionCountWithoutTrailingZeros() const { + return -scale > 0 ? -scale : 0; // max(-scale, 0) +} + +bool DecimalQuantity::isNegative() const { + return (flags & NEGATIVE_FLAG) != 0; +} + +bool DecimalQuantity::isInfinite() const { + return (flags & INFINITY_FLAG) != 0; +} + +bool DecimalQuantity::isNaN() const { + return (flags & NAN_FLAG) != 0; +} + +bool DecimalQuantity::isZero() const { + return precision == 0; +} + +DecimalQuantity &DecimalQuantity::setToInt(int32_t n) { + setBcdToZero(); + flags = 0; + if (n < 0) { + flags |= NEGATIVE_FLAG; + n = -n; + } + if (n != 0) { + _setToInt(n); + compact(); + } + return *this; +} + +void DecimalQuantity::_setToInt(int32_t n) { + if (n == INT32_MIN) { + readLongToBcd(-static_cast(n)); + } else { + readIntToBcd(n); + } +} + +DecimalQuantity &DecimalQuantity::setToLong(int64_t n) { + setBcdToZero(); + flags = 0; + if (n < 0) { + flags |= NEGATIVE_FLAG; + n = -n; + } + if (n != 0) { + _setToLong(n); + compact(); + } + return *this; +} + +void DecimalQuantity::_setToLong(int64_t n) { + if (n == INT64_MIN) { + static const char *int64minStr = "9.223372036854775808E+18"; + DecNumberWithStorage dn; + stringToDecNumber(int64minStr, dn); + readDecNumberToBcd(dn.getAlias()); + } else if (n <= INT32_MAX) { + readIntToBcd(static_cast(n)); + } else { + readLongToBcd(n); + } +} + +DecimalQuantity &DecimalQuantity::setToDouble(double n) { + setBcdToZero(); + flags = 0; + // signbit() from handles +0.0 vs -0.0 + if (std::signbit(n) != 0) { + flags |= NEGATIVE_FLAG; + n = -n; + } + if (std::isnan(n) != 0) { + flags |= NAN_FLAG; + } else if (std::isfinite(n) == 0) { + flags |= INFINITY_FLAG; + } else if (n != 0) { + _setToDoubleFast(n); + compact(); + } + return *this; +} + +void DecimalQuantity::_setToDoubleFast(double n) { + isApproximate = true; + origDouble = n; + origDelta = 0; + + // Make sure the double is an IEEE 754 double. If not, fall back to the slow path right now. + // TODO: Make a fast path for other types of doubles. + if (!std::numeric_limits::is_iec559) { + convertToAccurateDouble(); + // Turn off the approximate double flag, since the value is now exact. + isApproximate = false; + origDouble = 0.0; + return; + } + + // To get the bits from the double, use memcpy, which takes care of endianness. + uint64_t ieeeBits; + uprv_memcpy(&ieeeBits, &n, sizeof(n)); + int32_t exponent = static_cast((ieeeBits & 0x7ff0000000000000L) >> 52) - 0x3ff; + + // Not all integers can be represented exactly for exponent > 52 + if (exponent <= 52 && static_cast(n) == n) { + _setToLong(static_cast(n)); + return; + } + + // 3.3219... is log2(10) + auto fracLength = static_cast ((52 - exponent) / 3.32192809489); + if (fracLength >= 0) { + int32_t i = fracLength; + // 1e22 is the largest exact double. + for (; i >= 22; i -= 22) n *= 1e22; + n *= DOUBLE_MULTIPLIERS[i]; + } else { + int32_t i = fracLength; + // 1e22 is the largest exact double. + for (; i <= -22; i += 22) n /= 1e22; + n /= DOUBLE_MULTIPLIERS[-i]; + } + auto result = static_cast(std::round(n)); + if (result != 0) { + _setToLong(result); + scale -= fracLength; + } +} + +void DecimalQuantity::convertToAccurateDouble() { + double n = origDouble; + U_ASSERT(n != 0); + int32_t delta = origDelta; + setBcdToZero(); + + // Call the slow oracle function (Double.toString in Java, sprintf in C++). + // The constant DBL_DIG defines a platform-specific number of digits in a double. + // However, this tends to be too low (see #11318). Instead, we always use 14 decimal places. + static constexpr size_t CAP = 1 + 14 + 8; // Extra space for '+', '.', e+NNN, and '\0' + char dstr[CAP]; + snprintf(dstr, CAP, "%+1.14e", n); + + // uprv_decNumberFromString() will parse the string expecting '.' as a + // decimal separator, however sprintf() can use ',' in certain locales. + // Overwrite a ',' with '.' here before proceeding. + char *decimalSeparator = strchr(dstr, ','); + if (decimalSeparator != nullptr) { + *decimalSeparator = '.'; + } + + StringPiece sp(dstr); + DecNumberWithStorage dn; + stringToDecNumber(dstr, dn); + _setToDecNumber(dn.getAlias()); + + scale += delta; + explicitExactDouble = true; +} + +DecimalQuantity &DecimalQuantity::setToDecNumber(StringPiece n) { + setBcdToZero(); + flags = 0; + + DecNumberWithStorage dn; + stringToDecNumber(n, dn); + + // The code path for decNumber is modeled after BigDecimal in Java. + if (decNumberIsNegative(dn.getAlias())) { + flags |= NEGATIVE_FLAG; + } + if (!decNumberIsZero(dn.getAlias())) { + _setToDecNumber(dn.getAlias()); + } + return *this; +} + +void DecimalQuantity::_setToDecNumber(decNumber *n) { + // Java fastpaths for ints here. In C++, just always read directly from the decNumber. + readDecNumberToBcd(n); + compact(); +} + +int64_t DecimalQuantity::toLong() const { + int64_t result = 0L; + for (int32_t magnitude = scale + precision - 1; magnitude >= 0; magnitude--) { + result = result * 10 + getDigitPos(magnitude - scale); + } + return result; +} + +int64_t DecimalQuantity::toFractionLong(bool includeTrailingZeros) const { + int64_t result = 0L; + int32_t magnitude = -1; + for (; (magnitude >= scale || (includeTrailingZeros && magnitude >= rReqPos)) && + magnitude >= rOptPos; magnitude--) { + result = result * 10 + getDigitPos(magnitude - scale); + } + return result; +} + +double DecimalQuantity::toDouble() const { + if (isApproximate) { + return toDoubleFromOriginal(); + } + + if (isNaN()) { + return NAN; + } else if (isInfinite()) { + return isNegative() ? -INFINITY : INFINITY; + } + + int64_t tempLong = 0L; + int32_t lostDigits = precision - (precision < 17 ? precision : 17); + for (int shift = precision - 1; shift >= lostDigits; shift--) { + tempLong = tempLong * 10 + getDigitPos(shift); + } + double result = static_cast(tempLong); + int32_t _scale = scale + lostDigits; + if (_scale >= 0) { + // 1e22 is the largest exact double. + int32_t i = _scale; + for (; i >= 22; i -= 22) result *= 1e22; + result *= DOUBLE_MULTIPLIERS[i]; + } else { + // 1e22 is the largest exact double. + int32_t i = _scale; + for (; i <= -22; i += 22) result /= 1e22; + result /= DOUBLE_MULTIPLIERS[-i]; + } + if (isNegative()) { result = -result; } + return result; +} + +double DecimalQuantity::toDoubleFromOriginal() const { + double result = origDouble; + int32_t delta = origDelta; + if (delta >= 0) { + // 1e22 is the largest exact double. + for (; delta >= 22; delta -= 22) result *= 1e22; + result *= DOUBLE_MULTIPLIERS[delta]; + } else { + // 1e22 is the largest exact double. + for (; delta <= -22; delta += 22) result /= 1e22; + result /= DOUBLE_MULTIPLIERS[-delta]; + } + if (isNegative()) { result *= -1; } + return result; +} + +void DecimalQuantity::roundToMagnitude(int32_t magnitude, RoundingMode roundingMode, UErrorCode& status) { + // The position in the BCD at which rounding will be performed; digits to the right of position + // will be rounded away. + // TODO: Andy: There was a test failure because of integer overflow here. Should I do + // "safe subtraction" everywhere in the code? What's the nicest way to do it? + int position = safeSubtract(magnitude, scale); + + if (position <= 0 && !isApproximate) { + // All digits are to the left of the rounding magnitude. + } else if (precision == 0) { + // No rounding for zero. + } else { + // Perform rounding logic. + // "leading" = most significant digit to the right of rounding + // "trailing" = least significant digit to the left of rounding + int8_t leadingDigit = getDigitPos(safeSubtract(position, 1)); + int8_t trailingDigit = getDigitPos(position); + + // Compute which section of the number we are in. + // EDGE means we are at the bottom or top edge, like 1.000 or 1.999 (used by doubles) + // LOWER means we are between the bottom edge and the midpoint, like 1.391 + // MIDPOINT means we are exactly in the middle, like 1.500 + // UPPER means we are between the midpoint and the top edge, like 1.916 + roundingutils::Section section = roundingutils::SECTION_MIDPOINT; + if (!isApproximate) { + if (leadingDigit < 5) { + section = roundingutils::SECTION_LOWER; + } else if (leadingDigit > 5) { + section = roundingutils::SECTION_UPPER; + } else { + for (int p = safeSubtract(position, 2); p >= 0; p--) { + if (getDigitPos(p) != 0) { + section = roundingutils::SECTION_UPPER; + break; + } + } + } + } else { + int32_t p = safeSubtract(position, 2); + int32_t minP = uprv_max(0, precision - 14); + if (leadingDigit == 0) { + section = roundingutils::SECTION_LOWER_EDGE; + for (; p >= minP; p--) { + if (getDigitPos(p) != 0) { + section = roundingutils::SECTION_LOWER; + break; + } + } + } else if (leadingDigit == 4) { + for (; p >= minP; p--) { + if (getDigitPos(p) != 9) { + section = roundingutils::SECTION_LOWER; + break; + } + } + } else if (leadingDigit == 5) { + for (; p >= minP; p--) { + if (getDigitPos(p) != 0) { + section = roundingutils::SECTION_UPPER; + break; + } + } + } else if (leadingDigit == 9) { + section = roundingutils::SECTION_UPPER_EDGE; + for (; p >= minP; p--) { + if (getDigitPos(p) != 9) { + section = roundingutils::SECTION_UPPER; + break; + } + } + } else if (leadingDigit < 5) { + section = roundingutils::SECTION_LOWER; + } else { + section = roundingutils::SECTION_UPPER; + } + + bool roundsAtMidpoint = roundingutils::roundsAtMidpoint(roundingMode); + if (safeSubtract(position, 1) < precision - 14 || + (roundsAtMidpoint && section == roundingutils::SECTION_MIDPOINT) || + (!roundsAtMidpoint && section < 0 /* i.e. at upper or lower edge */)) { + // Oops! This means that we have to get the exact representation of the double, because + // the zone of uncertainty is along the rounding boundary. + convertToAccurateDouble(); + roundToMagnitude(magnitude, roundingMode, status); // start over + return; + } + + // Turn off the approximate double flag, since the value is now confirmed to be exact. + isApproximate = false; + origDouble = 0.0; + origDelta = 0; + + if (position <= 0) { + // All digits are to the left of the rounding magnitude. + return; + } + + // Good to continue rounding. + if (section == -1) { section = roundingutils::SECTION_LOWER; } + if (section == -2) { section = roundingutils::SECTION_UPPER; } + } + + bool roundDown = roundingutils::getRoundingDirection((trailingDigit % 2) == 0, + isNegative(), + section, + roundingMode, + status); + if (U_FAILURE(status)) { + return; + } + + // Perform truncation + if (position >= precision) { + setBcdToZero(); + scale = magnitude; + } else { + shiftRight(position); + } + + // Bubble the result to the higher digits + if (!roundDown) { + if (trailingDigit == 9) { + int bubblePos = 0; + // Note: in the long implementation, the most digits BCD can have at this point is 15, + // so bubblePos <= 15 and getDigitPos(bubblePos) is safe. + for (; getDigitPos(bubblePos) == 9; bubblePos++) {} + shiftRight(bubblePos); // shift off the trailing 9s + } + int8_t digit0 = getDigitPos(0); + U_ASSERT(digit0 != 9); + setDigitPos(0, static_cast(digit0 + 1)); + precision += 1; // in case an extra digit got added + } + + compact(); + } +} + +void DecimalQuantity::roundToInfinity() { + if (isApproximate) { + convertToAccurateDouble(); + } +} + +void DecimalQuantity::appendDigit(int8_t value, int32_t leadingZeros, bool appendAsInteger) { + U_ASSERT(leadingZeros >= 0); + + // Zero requires special handling to maintain the invariant that the least-significant digit + // in the BCD is nonzero. + if (value == 0) { + if (appendAsInteger && precision != 0) { + scale += leadingZeros + 1; + } + return; + } + + // Deal with trailing zeros + if (scale > 0) { + leadingZeros += scale; + if (appendAsInteger) { + scale = 0; + } + } + + // Append digit + shiftLeft(leadingZeros + 1); + setDigitPos(0, value); + + // Fix scale if in integer mode + if (appendAsInteger) { + scale += leadingZeros + 1; + } +} + +UnicodeString DecimalQuantity::toPlainString() const { + UnicodeString sb; + if (isNegative()) { + sb.append(u'-'); + } + for (int m = getUpperDisplayMagnitude(); m >= getLowerDisplayMagnitude(); m--) { + sb.append(getDigit(m) + u'0'); + if (m == 0) { sb.append(u'.'); } + } + return sb; +} + +//////////////////////////////////////////////////// +/// End of DecimalQuantity_AbstractBCD.java /// +/// Start of DecimalQuantity_DualStorageBCD.java /// +//////////////////////////////////////////////////// + +int8_t DecimalQuantity::getDigitPos(int32_t position) const { + if (usingBytes) { + if (position < 0 || position > precision) { return 0; } + return fBCD.bcdBytes.ptr[position]; + } else { + if (position < 0 || position >= 16) { return 0; } + return (int8_t) ((fBCD.bcdLong >> (position * 4)) & 0xf); + } +} + +void DecimalQuantity::setDigitPos(int32_t position, int8_t value) { + U_ASSERT(position >= 0); + if (usingBytes) { + ensureCapacity(position + 1); + fBCD.bcdBytes.ptr[position] = value; + } else if (position >= 16) { + switchStorage(); + ensureCapacity(position + 1); + fBCD.bcdBytes.ptr[position] = value; + } else { + int shift = position * 4; + fBCD.bcdLong = (fBCD.bcdLong & ~(0xfL << shift)) | ((long) value << shift); + } +} + +void DecimalQuantity::shiftLeft(int32_t numDigits) { + if (!usingBytes && precision + numDigits > 16) { + switchStorage(); + } + if (usingBytes) { + ensureCapacity(precision + numDigits); + int i = precision + numDigits - 1; + for (; i >= numDigits; i--) { + fBCD.bcdBytes.ptr[i] = fBCD.bcdBytes.ptr[i - numDigits]; + } + for (; i >= 0; i--) { + fBCD.bcdBytes.ptr[i] = 0; + } + } else { + fBCD.bcdLong <<= (numDigits * 4); + } + scale -= numDigits; + precision += numDigits; +} + +void DecimalQuantity::shiftRight(int32_t numDigits) { + if (usingBytes) { + int i = 0; + for (; i < precision - numDigits; i++) { + fBCD.bcdBytes.ptr[i] = fBCD.bcdBytes.ptr[i + numDigits]; + } + for (; i < precision; i++) { + fBCD.bcdBytes.ptr[i] = 0; + } + } else { + fBCD.bcdLong >>= (numDigits * 4); + } + scale += numDigits; + precision -= numDigits; +} + +void DecimalQuantity::setBcdToZero() { + if (usingBytes) { + uprv_free(fBCD.bcdBytes.ptr); + fBCD.bcdBytes.ptr = nullptr; + usingBytes = false; + } + fBCD.bcdLong = 0L; + scale = 0; + precision = 0; + isApproximate = false; + origDouble = 0; + origDelta = 0; +} + +void DecimalQuantity::readIntToBcd(int32_t n) { + U_ASSERT(n != 0); + // ints always fit inside the long implementation. + uint64_t result = 0L; + int i = 16; + for (; n != 0; n /= 10, i--) { + result = (result >> 4) + ((static_cast(n) % 10) << 60); + } + U_ASSERT(!usingBytes); + fBCD.bcdLong = result >> (i * 4); + scale = 0; + precision = 16 - i; +} + +void DecimalQuantity::readLongToBcd(int64_t n) { + U_ASSERT(n != 0); + if (n >= 10000000000000000L) { + ensureCapacity(); + int i = 0; + for (; n != 0L; n /= 10L, i++) { + fBCD.bcdBytes.ptr[i] = static_cast(n % 10); + } + U_ASSERT(usingBytes); + scale = 0; + precision = i; + } else { + uint64_t result = 0L; + int i = 16; + for (; n != 0L; n /= 10L, i--) { + result = (result >> 4) + ((n % 10) << 60); + } + U_ASSERT(i >= 0); + U_ASSERT(!usingBytes); + fBCD.bcdLong = result >> (i * 4); + scale = 0; + precision = 16 - i; + } +} + +void DecimalQuantity::readDecNumberToBcd(decNumber *dn) { + if (dn->digits > 16) { + ensureCapacity(dn->digits); + for (int32_t i = 0; i < dn->digits; i++) { + fBCD.bcdBytes.ptr[i] = dn->lsu[i]; + } + } else { + uint64_t result = 0L; + for (int32_t i = 0; i < dn->digits; i++) { + result |= static_cast(dn->lsu[i]) << (4 * i); + } + fBCD.bcdLong = result; + } + scale = dn->exponent; + precision = dn->digits; +} + +void DecimalQuantity::compact() { + if (usingBytes) { + int32_t delta = 0; + for (; delta < precision && fBCD.bcdBytes.ptr[delta] == 0; delta++); + if (delta == precision) { + // Number is zero + setBcdToZero(); + return; + } else { + // Remove trailing zeros + shiftRight(delta); + } + + // Compute precision + int32_t leading = precision - 1; + for (; leading >= 0 && fBCD.bcdBytes.ptr[leading] == 0; leading--); + precision = leading + 1; + + // Switch storage mechanism if possible + if (precision <= 16) { + switchStorage(); + } + + } else { + if (fBCD.bcdLong == 0L) { + // Number is zero + setBcdToZero(); + return; + } + + // Compact the number (remove trailing zeros) + // TODO: Use a more efficient algorithm here and below. There is a logarithmic one. + int32_t delta = 0; + for (; delta < precision && getDigitPos(delta) == 0; delta++); + fBCD.bcdLong >>= delta * 4; + scale += delta; + + // Compute precision + int32_t leading = precision - 1; + for (; leading >= 0 && getDigitPos(leading) == 0; leading--); + precision = leading + 1; + } +} + +void DecimalQuantity::ensureCapacity() { + ensureCapacity(40); +} + +void DecimalQuantity::ensureCapacity(int32_t capacity) { + if (capacity == 0) { return; } + int32_t oldCapacity = usingBytes ? fBCD.bcdBytes.len : 0; + if (!usingBytes) { + // TODO: There is nothing being done to check for memory allocation failures. + // TODO: Consider indexing by nybbles instead of bytes in C++, so that we can + // make these arrays half the size. + fBCD.bcdBytes.ptr = static_cast(uprv_malloc(capacity * sizeof(int8_t))); + fBCD.bcdBytes.len = capacity; + // Initialize the byte array to zeros (this is done automatically in Java) + uprv_memset(fBCD.bcdBytes.ptr, 0, capacity * sizeof(int8_t)); + } else if (oldCapacity < capacity) { + auto bcd1 = static_cast(uprv_malloc(capacity * 2 * sizeof(int8_t))); + uprv_memcpy(bcd1, fBCD.bcdBytes.ptr, oldCapacity * sizeof(int8_t)); + // Initialize the rest of the byte array to zeros (this is done automatically in Java) + uprv_memset(fBCD.bcdBytes.ptr + oldCapacity, 0, (capacity - oldCapacity) * sizeof(int8_t)); + uprv_free(fBCD.bcdBytes.ptr); + fBCD.bcdBytes.ptr = bcd1; + fBCD.bcdBytes.len = capacity * 2; + } + usingBytes = true; +} + +void DecimalQuantity::switchStorage() { + if (usingBytes) { + // Change from bytes to long + uint64_t bcdLong = 0L; + for (int i = precision - 1; i >= 0; i--) { + bcdLong <<= 4; + bcdLong |= fBCD.bcdBytes.ptr[i]; + } + uprv_free(fBCD.bcdBytes.ptr); + fBCD.bcdBytes.ptr = nullptr; + fBCD.bcdLong = bcdLong; + usingBytes = false; + } else { + // Change from long to bytes + // Copy the long into a local variable since it will get munged when we allocate the bytes + uint64_t bcdLong = fBCD.bcdLong; + ensureCapacity(); + for (int i = 0; i < precision; i++) { + fBCD.bcdBytes.ptr[i] = static_cast(bcdLong & 0xf); + bcdLong >>= 4; + } + U_ASSERT(usingBytes); + } +} + +void DecimalQuantity::copyBcdFrom(const DecimalQuantity &other) { + setBcdToZero(); + if (other.usingBytes) { + ensureCapacity(other.precision); + uprv_memcpy(fBCD.bcdBytes.ptr, other.fBCD.bcdBytes.ptr, other.precision * sizeof(int8_t)); + } else { + fBCD.bcdLong = other.fBCD.bcdLong; + } +} + +const char16_t* DecimalQuantity::checkHealth() const { + if (usingBytes) { + if (precision == 0) { return u"Zero precision but we are in byte mode"; } + int32_t capacity = fBCD.bcdBytes.len; + if (precision > capacity) { return u"Precision exceeds length of byte array"; } + if (getDigitPos(precision - 1) == 0) { return u"Most significant digit is zero in byte mode"; } + if (getDigitPos(0) == 0) { return u"Least significant digit is zero in long mode"; } + for (int i = 0; i < precision; i++) { + if (getDigitPos(i) >= 10) { return u"Digit exceeding 10 in byte array"; } + if (getDigitPos(i) < 0) { return u"Digit below 0 in byte array"; } + } + for (int i = precision; i < capacity; i++) { + if (getDigitPos(i) != 0) { return u"Nonzero digits outside of range in byte array"; } + } + } else { + if (precision == 0 && fBCD.bcdLong != 0) { + return u"Value in bcdLong even though precision is zero"; + } + if (precision > 16) { return u"Precision exceeds length of long"; } + if (precision != 0 && getDigitPos(precision - 1) == 0) { + return u"Most significant digit is zero in long mode"; + } + if (precision != 0 && getDigitPos(0) == 0) { + return u"Least significant digit is zero in long mode"; + } + for (int i = 0; i < precision; i++) { + if (getDigitPos(i) >= 10) { return u"Digit exceeding 10 in long"; } + if (getDigitPos(i) < 0) { return u"Digit below 0 in long (?!)"; } + } + for (int i = precision; i < 16; i++) { + if (getDigitPos(i) != 0) { return u"Nonzero digits outside of range in long"; } + } + } + + // No error + return nullptr; +} + +UnicodeString DecimalQuantity::toString() const { + MaybeStackArray digits(precision + 1); + for (int32_t i = 0; i < precision; i++) { + digits[i] = getDigitPos(precision - i - 1) + '0'; + } + digits[precision] = 0; // terminate buffer + char buffer8[100]; + snprintf( + buffer8, + sizeof(buffer8), + "", + (lOptPos > 999 ? 999 : lOptPos), + lReqPos, + rReqPos, + (rOptPos < -999 ? -999 : rOptPos), + (usingBytes ? "bytes" : "long"), + (precision == 0 ? "0" : digits.getAlias()), + "E", + scale); + return UnicodeString(buffer8, -1, US_INV); +} + +UnicodeString DecimalQuantity::toNumberString() const { + MaybeStackArray digits(precision + 11); + for (int32_t i = 0; i < precision; i++) { + digits[i] = getDigitPos(precision - i - 1) + '0'; + } + snprintf(digits.getAlias() + precision, 11, "E%d", scale); + return UnicodeString(digits.getAlias(), -1, US_INV); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_decimalquantity.h b/deps/icu-small/source/i18n/number_decimalquantity.h new file mode 100644 index 00000000000000..e9ec1fb2c20cd7 --- /dev/null +++ b/deps/icu-small/source/i18n/number_decimalquantity.h @@ -0,0 +1,442 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_DECIMALQUANTITY_H__ +#define __NUMBER_DECIMALQUANTITY_H__ + +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "unicode/umachine.h" +#include "decNumber.h" +#include "standardplural.h" +#include "plurrule_impl.h" +#include "number_types.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +/** + * An class for representing a number to be processed by the decimal formatting pipeline. Includes + * methods for rounding, plural rules, and decimal digit extraction. + * + *

By design, this is NOT IMMUTABLE and NOT THREAD SAFE. It is intended to be an intermediate + * object holding state during a pass through the decimal formatting pipeline. + * + *

Represents numbers and digit display properties using Binary Coded Decimal (BCD). + * + *

Java has multiple implementations for testing, but C++ has only one implementation. + */ +class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { + public: + /** Copy constructor. */ + DecimalQuantity(const DecimalQuantity &other); + + DecimalQuantity(); + + ~DecimalQuantity(); + + /** + * Sets this instance to be equal to another instance. + * + * @param other The instance to copy from. + */ + DecimalQuantity &operator=(const DecimalQuantity &other); + + /** + * Sets the minimum and maximum integer digits that this {@link DecimalQuantity} should generate. + * This method does not perform rounding. + * + * @param minInt The minimum number of integer digits. + * @param maxInt The maximum number of integer digits. + */ + void setIntegerLength(int32_t minInt, int32_t maxInt); + + /** + * Sets the minimum and maximum fraction digits that this {@link DecimalQuantity} should generate. + * This method does not perform rounding. + * + * @param minFrac The minimum number of fraction digits. + * @param maxFrac The maximum number of fraction digits. + */ + void setFractionLength(int32_t minFrac, int32_t maxFrac); + + /** + * Rounds the number to a specified interval, such as 0.05. + * + *

If rounding to a power of ten, use the more efficient {@link #roundToMagnitude} instead. + * + * @param roundingIncrement The increment to which to round. + * @param mathContext The {@link RoundingMode} to use if rounding is necessary. + */ + void roundToIncrement(double roundingIncrement, RoundingMode roundingMode, + int32_t minMaxFrac, UErrorCode& status); + + /** + * Rounds the number to a specified magnitude (power of ten). + * + * @param roundingMagnitude The power of ten to which to round. For example, a value of -2 will + * round to 2 decimal places. + * @param mathContext The {@link RoundingMode} to use if rounding is necessary. + */ + void roundToMagnitude(int32_t magnitude, RoundingMode roundingMode, UErrorCode& status); + + /** + * Rounds the number to an infinite number of decimal points. This has no effect except for + * forcing the double in {@link DecimalQuantity_AbstractBCD} to adopt its exact representation. + */ + void roundToInfinity(); + + /** + * Multiply the internal value. + * + * @param multiplicand The value by which to multiply. + */ + void multiplyBy(int32_t multiplicand); + + /** + * Scales the number by a power of ten. For example, if the value is currently "1234.56", calling + * this method with delta=-3 will change the value to "1.23456". + * + * @param delta The number of magnitudes of ten to change by. + */ + void adjustMagnitude(int32_t delta); + + /** + * @return The power of ten corresponding to the most significant nonzero digit. + * The number must not be zero. + */ + int32_t getMagnitude() const; + + /** @return Whether the value represented by this {@link DecimalQuantity} is zero. */ + bool isZero() const; + + /** @return Whether the value represented by this {@link DecimalQuantity} is less than zero. */ + bool isNegative() const; + + /** @return Whether the value represented by this {@link DecimalQuantity} is infinite. */ + bool isInfinite() const U_OVERRIDE; + + /** @return Whether the value represented by this {@link DecimalQuantity} is not a number. */ + bool isNaN() const U_OVERRIDE; + + int64_t toLong() const; + + int64_t toFractionLong(bool includeTrailingZeros) const; + + /** @return The value contained in this {@link DecimalQuantity} approximated as a double. */ + double toDouble() const; + + DecimalQuantity &setToInt(int32_t n); + + DecimalQuantity &setToLong(int64_t n); + + DecimalQuantity &setToDouble(double n); + + /** decNumber is similar to BigDecimal in Java. */ + + DecimalQuantity &setToDecNumber(StringPiece n); + + /** + * Appends a digit, optionally with one or more leading zeros, to the end of the value represented + * by this DecimalQuantity. + * + *

The primary use of this method is to construct numbers during a parsing loop. It allows + * parsing to take advantage of the digit list infrastructure primarily designed for formatting. + * + * @param value The digit to append. + * @param leadingZeros The number of zeros to append before the digit. For example, if the value + * in this instance starts as 12.3, and you append a 4 with 1 leading zero, the value becomes + * 12.304. + * @param appendAsInteger If true, increase the magnitude of existing digits to make room for the + * new digit. If false, append to the end like a fraction digit. If true, there must not be + * any fraction digits already in the number. + * @internal + * @deprecated This API is ICU internal only. + */ + void appendDigit(int8_t value, int32_t leadingZeros, bool appendAsInteger); + + /** + * Computes the plural form for this number based on the specified set of rules. + * + * @param rules A {@link PluralRules} object representing the set of rules. + * @return The {@link StandardPlural} according to the PluralRules. If the plural form is not in + * the set of standard plurals, {@link StandardPlural#OTHER} is returned instead. + */ + StandardPlural::Form getStandardPlural(const PluralRules *rules) const; + + double getPluralOperand(PluralOperand operand) const U_OVERRIDE; + + /** + * Gets the digit at the specified magnitude. For example, if the represented number is 12.3, + * getDigit(-1) returns 3, since 3 is the digit corresponding to 10^-1. + * + * @param magnitude The magnitude of the digit. + * @return The digit at the specified magnitude. + */ + int8_t getDigit(int32_t magnitude) const; + + /** + * Gets the largest power of ten that needs to be displayed. The value returned by this function + * will be bounded between minInt and maxInt. + * + * @return The highest-magnitude digit to be displayed. + */ + int32_t getUpperDisplayMagnitude() const; + + /** + * Gets the smallest power of ten that needs to be displayed. The value returned by this function + * will be bounded between -minFrac and -maxFrac. + * + * @return The lowest-magnitude digit to be displayed. + */ + int32_t getLowerDisplayMagnitude() const; + + int32_t fractionCount() const; + + int32_t fractionCountWithoutTrailingZeros() const; + + void clear(); + + /** This method is for internal testing only. */ + uint64_t getPositionFingerprint() const; + +// /** +// * If the given {@link FieldPosition} is a {@link UFieldPosition}, populates it with the fraction +// * length and fraction long value. If the argument is not a {@link UFieldPosition}, nothing +// * happens. +// * +// * @param fp The {@link UFieldPosition} to populate. +// */ +// void populateUFieldPosition(FieldPosition fp); + + /** + * Checks whether the bytes stored in this instance are all valid. For internal unit testing only. + * + * @return An error message if this instance is invalid, or null if this instance is healthy. + */ + const char16_t* checkHealth() const; + + UnicodeString toString() const; + + /* Returns the string in exponential notation. */ + UnicodeString toNumberString() const; + + /* Returns the string without exponential notation. Slightly slower than toNumberString(). */ + UnicodeString toPlainString() const; + + /** Visible for testing */ + inline bool isUsingBytes() { return usingBytes; } + + /** Visible for testing */ + inline bool isExplicitExactDouble() { return explicitExactDouble; }; + + private: + /** + * The power of ten corresponding to the least significant digit in the BCD. For example, if this + * object represents the number "3.14", the BCD will be "0x314" and the scale will be -2. + * + *

Note that in {@link java.math.BigDecimal}, the scale is defined differently: the number of + * digits after the decimal place, which is the negative of our definition of scale. + */ + int32_t scale; + + /** + * The number of digits in the BCD. For example, "1007" has BCD "0x1007" and precision 4. The + * maximum precision is 16 since a long can hold only 16 digits. + * + *

This value must be re-calculated whenever the value in bcd changes by using {@link + * #computePrecisionAndCompact()}. + */ + int32_t precision; + + /** + * A bitmask of properties relating to the number represented by this object. + * + * @see #NEGATIVE_FLAG + * @see #INFINITY_FLAG + * @see #NAN_FLAG + */ + int8_t flags; + + // The following three fields relate to the double-to-ascii fast path algorithm. + // When a double is given to DecimalQuantityBCD, it is converted to using a fast algorithm. The + // fast algorithm guarantees correctness to only the first ~12 digits of the double. The process + // of rounding the number ensures that the converted digits are correct, falling back to a slow- + // path algorithm if required. Therefore, if a DecimalQuantity is constructed from a double, it + // is *required* that roundToMagnitude(), roundToIncrement(), or roundToInfinity() is called. If + // you don't round, assertions will fail in certain other methods if you try calling them. + + /** + * Whether the value in the BCD comes from the double fast path without having been rounded to + * ensure correctness + */ + UBool isApproximate; + + /** + * The original number provided by the user and which is represented in BCD. Used when we need to + * re-compute the BCD for an exact double representation. + */ + double origDouble; + + /** + * The change in magnitude relative to the original double. Used when we need to re-compute the + * BCD for an exact double representation. + */ + int32_t origDelta; + + // Four positions: left optional '(', left required '[', right required ']', right optional ')'. + // These four positions determine which digits are displayed in the output string. They do NOT + // affect rounding. These positions are internal-only and can be specified only by the public + // endpoints like setFractionLength, setIntegerLength, and setSignificantDigits, among others. + // + // * Digits between lReqPos and rReqPos are in the "required zone" and are always displayed. + // * Digits between lOptPos and rOptPos but outside the required zone are in the "optional zone" + // and are displayed unless they are trailing off the left or right edge of the number and + // have a numerical value of zero. In order to be "trailing", the digits need to be beyond + // the decimal point in their respective directions. + // * Digits outside of the "optional zone" are never displayed. + // + // See the table below for illustrative examples. + // + // +---------+---------+---------+---------+------------+------------------------+--------------+ + // | lOptPos | lReqPos | rReqPos | rOptPos | number | positions | en-US string | + // +---------+---------+---------+---------+------------+------------------------+--------------+ + // | 5 | 2 | -1 | -5 | 1234.567 | ( 12[34.5]67 ) | 1,234.567 | + // | 3 | 2 | -1 | -5 | 1234.567 | 1(2[34.5]67 ) | 234.567 | + // | 3 | 2 | -1 | -2 | 1234.567 | 1(2[34.5]6)7 | 234.56 | + // | 6 | 4 | 2 | -5 | 123456789. | 123(45[67]89. ) | 456,789. | + // | 6 | 4 | 2 | 1 | 123456789. | 123(45[67]8)9. | 456,780. | + // | -1 | -1 | -3 | -4 | 0.123456 | 0.1([23]4)56 | .0234 | + // | 6 | 4 | -2 | -2 | 12.3 | ( [ 12.3 ]) | 0012.30 | + // +---------+---------+---------+---------+------------+------------------------+--------------+ + // + int32_t lOptPos = INT32_MAX; + int32_t lReqPos = 0; + int32_t rReqPos = 0; + int32_t rOptPos = INT32_MIN; + + /** + * The BCD of the 16 digits of the number represented by this object. Every 4 bits of the long map + * to one digit. For example, the number "12345" in BCD is "0x12345". + * + *

Whenever bcd changes internally, {@link #compact()} must be called, except in special cases + * like setting the digit to zero. + */ + union { + struct { + int8_t *ptr; + int32_t len; + } bcdBytes; + uint64_t bcdLong; + } fBCD; + + bool usingBytes = false; + + /** + * Whether this {@link DecimalQuantity} has been explicitly converted to an exact double. true if + * backed by a double that was explicitly converted via convertToAccurateDouble; false otherwise. + * Used for testing. + */ + bool explicitExactDouble = false; + + /** + * Returns a single digit from the BCD list. No internal state is changed by calling this method. + * + * @param position The position of the digit to pop, counted in BCD units from the least + * significant digit. If outside the range supported by the implementation, zero is returned. + * @return The digit at the specified location. + */ + int8_t getDigitPos(int32_t position) const; + + /** + * Sets the digit in the BCD list. This method only sets the digit; it is the caller's + * responsibility to call {@link #compact} after setting the digit. + * + * @param position The position of the digit to pop, counted in BCD units from the least + * significant digit. If outside the range supported by the implementation, an AssertionError + * is thrown. + * @param value The digit to set at the specified location. + */ + void setDigitPos(int32_t position, int8_t value); + + /** + * Adds zeros to the end of the BCD list. This will result in an invalid BCD representation; it is + * the caller's responsibility to do further manipulation and then call {@link #compact}. + * + * @param numDigits The number of zeros to add. + */ + void shiftLeft(int32_t numDigits); + + void shiftRight(int32_t numDigits); + + /** + * Sets the internal representation to zero. Clears any values stored in scale, precision, + * hasDouble, origDouble, origDelta, and BCD data. + */ + void setBcdToZero(); + + /** + * Sets the internal BCD state to represent the value in the given int. The int is guaranteed to + * be either positive. The internal state is guaranteed to be empty when this method is called. + * + * @param n The value to consume. + */ + void readIntToBcd(int32_t n); + + /** + * Sets the internal BCD state to represent the value in the given long. The long is guaranteed to + * be either positive. The internal state is guaranteed to be empty when this method is called. + * + * @param n The value to consume. + */ + void readLongToBcd(int64_t n); + + void readDecNumberToBcd(decNumber *dn); + + void copyBcdFrom(const DecimalQuantity &other); + + /** + * Removes trailing zeros from the BCD (adjusting the scale as required) and then computes the + * precision. The precision is the number of digits in the number up through the greatest nonzero + * digit. + * + *

This method must always be called when bcd changes in order for assumptions to be correct in + * methods like {@link #fractionCount()}. + */ + void compact(); + + void _setToInt(int32_t n); + + void _setToLong(int64_t n); + + void _setToDoubleFast(double n); + + void _setToDecNumber(decNumber *n); + + void convertToAccurateDouble(); + + double toDoubleFromOriginal() const; + + /** Ensure that a byte array of at least 40 digits is allocated. */ + void ensureCapacity(); + + void ensureCapacity(int32_t capacity); + + /** Switches the internal storage mechanism between the 64-bit long and the byte array. */ + void switchStorage(); +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_DECIMALQUANTITY_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_decimfmtprops.cpp b/deps/icu-small/source/i18n/number_decimfmtprops.cpp new file mode 100644 index 00000000000000..cc57cfce6ac1fa --- /dev/null +++ b/deps/icu-small/source/i18n/number_decimfmtprops.cpp @@ -0,0 +1,102 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "number_decimfmtprops.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +DecimalFormatProperties::DecimalFormatProperties() { + clear(); +} + +void DecimalFormatProperties::clear() { + compactStyle.nullify(); + currency.nullify(); + currencyPluralInfo.fPtr.adoptInstead(nullptr); + currencyUsage.nullify(); + decimalPatternMatchRequired = false; + decimalSeparatorAlwaysShown = false; + exponentSignAlwaysShown = false; + formatWidth = -1; + groupingSize = -1; + magnitudeMultiplier = 0; + maximumFractionDigits = -1; + maximumIntegerDigits = -1; + maximumSignificantDigits = -1; + minimumExponentDigits = -1; + minimumFractionDigits = -1; + minimumGroupingDigits = -1; + minimumIntegerDigits = -1; + minimumSignificantDigits = -1; + multiplier = 0; + negativePrefix.setToBogus(); + negativePrefixPattern.setToBogus(); + negativeSuffix.setToBogus(); + negativeSuffixPattern.setToBogus(); + padPosition.nullify(); + padString.setToBogus(); + parseCaseSensitive = false; + parseIntegerOnly = false; + parseLenient = false; + parseNoExponent = false; + parseToBigDecimal = false; + positivePrefix.setToBogus(); + positivePrefixPattern.setToBogus(); + positiveSuffix.setToBogus(); + positiveSuffixPattern.setToBogus(); + roundingIncrement = 0.0; + roundingMode.nullify(); + secondaryGroupingSize = -1; + signAlwaysShown = false; +} + +bool DecimalFormatProperties::operator==(const DecimalFormatProperties &other) const { + bool eq = true; + eq = eq && compactStyle == other.compactStyle; + eq = eq && currency == other.currency; + eq = eq && currencyPluralInfo.fPtr.getAlias() == other.currencyPluralInfo.fPtr.getAlias(); + eq = eq && currencyUsage == other.currencyUsage; + eq = eq && decimalPatternMatchRequired == other.decimalPatternMatchRequired; + eq = eq && decimalSeparatorAlwaysShown == other.decimalSeparatorAlwaysShown; + eq = eq && exponentSignAlwaysShown == other.exponentSignAlwaysShown; + eq = eq && formatWidth == other.formatWidth; + eq = eq && groupingSize == other.groupingSize; + eq = eq && magnitudeMultiplier == other.magnitudeMultiplier; + eq = eq && maximumFractionDigits == other.maximumFractionDigits; + eq = eq && maximumIntegerDigits == other.maximumIntegerDigits; + eq = eq && maximumSignificantDigits == other.maximumSignificantDigits; + eq = eq && minimumExponentDigits == other.minimumExponentDigits; + eq = eq && minimumFractionDigits == other.minimumFractionDigits; + eq = eq && minimumGroupingDigits == other.minimumGroupingDigits; + eq = eq && minimumIntegerDigits == other.minimumIntegerDigits; + eq = eq && minimumSignificantDigits == other.minimumSignificantDigits; + eq = eq && multiplier == other.multiplier; + eq = eq && negativePrefix == other.negativePrefix; + eq = eq && negativePrefixPattern == other.negativePrefixPattern; + eq = eq && negativeSuffix == other.negativeSuffix; + eq = eq && negativeSuffixPattern == other.negativeSuffixPattern; + eq = eq && padPosition == other.padPosition; + eq = eq && padString == other.padString; + eq = eq && parseCaseSensitive == other.parseCaseSensitive; + eq = eq && parseIntegerOnly == other.parseIntegerOnly; + eq = eq && parseLenient == other.parseLenient; + eq = eq && parseNoExponent == other.parseNoExponent; + eq = eq && parseToBigDecimal == other.parseToBigDecimal; + eq = eq && positivePrefix == other.positivePrefix; + eq = eq && positivePrefixPattern == other.positivePrefixPattern; + eq = eq && positiveSuffix == other.positiveSuffix; + eq = eq && positiveSuffixPattern == other.positiveSuffixPattern; + eq = eq && roundingIncrement == other.roundingIncrement; + eq = eq && roundingMode == other.roundingMode; + eq = eq && secondaryGroupingSize == other.secondaryGroupingSize; + eq = eq && signAlwaysShown == other.signAlwaysShown; + return eq; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_decimfmtprops.h b/deps/icu-small/source/i18n/number_decimfmtprops.h new file mode 100644 index 00000000000000..15c1f102ed56ae --- /dev/null +++ b/deps/icu-small/source/i18n/number_decimfmtprops.h @@ -0,0 +1,112 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_DECIMFMTPROPS_H__ +#define __NUMBER_DECIMFMTPROPS_H__ + +#include "unicode/unistr.h" +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "unicode/plurrule.h" +#include "unicode/currpinf.h" +#include "unicode/unum.h" +#include "unicode/localpointer.h" +#include "number_types.h" + +U_NAMESPACE_BEGIN + +// Export an explicit template instantiation of the LocalPointer that is used as a +// data member of CurrencyPluralInfoWrapper. +// (MSVC requires this, even though it should not be necessary.) +#if defined (_MSC_VER) +// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!= +#pragma warning(suppress: 4661) +template class U_I18N_API LocalPointerBase; +template class U_I18N_API LocalPointer; +#endif + +namespace number { +namespace impl { + +// TODO: Figure out a nicer way to deal with CurrencyPluralInfo. +// Exported as U_I18N_API because it is a public member field of exported DecimalFormatProperties +struct U_I18N_API CurrencyPluralInfoWrapper { + LocalPointer fPtr; + + CurrencyPluralInfoWrapper() {} + CurrencyPluralInfoWrapper(const CurrencyPluralInfoWrapper& other) { + if (!other.fPtr.isNull()) { + fPtr.adoptInstead(new CurrencyPluralInfo(*other.fPtr)); + } + } +}; + +// Exported as U_I18N_API because it is needed for the unit test PatternStringTest +struct U_I18N_API DecimalFormatProperties { + + public: + NullableValue compactStyle; + NullableValue currency; + CurrencyPluralInfoWrapper currencyPluralInfo; + NullableValue currencyUsage; + bool decimalPatternMatchRequired; + bool decimalSeparatorAlwaysShown; + bool exponentSignAlwaysShown; + int32_t formatWidth; + int32_t groupingSize; + int32_t magnitudeMultiplier; + int32_t maximumFractionDigits; + int32_t maximumIntegerDigits; + int32_t maximumSignificantDigits; + int32_t minimumExponentDigits; + int32_t minimumFractionDigits; + int32_t minimumGroupingDigits; + int32_t minimumIntegerDigits; + int32_t minimumSignificantDigits; + int32_t multiplier; + UnicodeString negativePrefix; + UnicodeString negativePrefixPattern; + UnicodeString negativeSuffix; + UnicodeString negativeSuffixPattern; + NullableValue padPosition; + UnicodeString padString; + bool parseCaseSensitive; + bool parseIntegerOnly; + bool parseLenient; + bool parseNoExponent; + bool parseToBigDecimal; + //PluralRules pluralRules; + UnicodeString positivePrefix; + UnicodeString positivePrefixPattern; + UnicodeString positiveSuffix; + UnicodeString positiveSuffixPattern; + double roundingIncrement; + NullableValue roundingMode; + int32_t secondaryGroupingSize; + bool signAlwaysShown; + + DecimalFormatProperties(); + + //DecimalFormatProperties(const DecimalFormatProperties &other) = default; + + DecimalFormatProperties &operator=(const DecimalFormatProperties &other) = default; + + bool operator==(const DecimalFormatProperties &other) const; + + void clear(); +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_DECIMFMTPROPS_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_fluent.cpp b/deps/icu-small/source/i18n/number_fluent.cpp new file mode 100644 index 00000000000000..76c3a7ce5c5d16 --- /dev/null +++ b/deps/icu-small/source/i18n/number_fluent.cpp @@ -0,0 +1,369 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "uassert.h" +#include "unicode/numberformatter.h" +#include "number_decimalquantity.h" +#include "number_formatimpl.h" +#include "umutex.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +template +Derived NumberFormatterSettings::notation(const Notation ¬ation) const { + Derived copy(*this); + // NOTE: Slicing is OK. + copy.fMacros.notation = notation; + return copy; +} + +template +Derived NumberFormatterSettings::unit(const icu::MeasureUnit &unit) const { + Derived copy(*this); + // NOTE: Slicing occurs here. However, CurrencyUnit can be restored from MeasureUnit. + // TimeUnit may be affected, but TimeUnit is not as relevant to number formatting. + copy.fMacros.unit = unit; + return copy; +} + +template +Derived NumberFormatterSettings::adoptUnit(const icu::MeasureUnit *unit) const { + Derived copy(*this); + // Just copy the unit into the MacroProps by value, and delete it since we have ownership. + // NOTE: Slicing occurs here. However, CurrencyUnit can be restored from MeasureUnit. + // TimeUnit may be affected, but TimeUnit is not as relevant to number formatting. + if (unit != nullptr) { + copy.fMacros.unit = *unit; + delete unit; + } + return copy; +} + +template +Derived NumberFormatterSettings::rounding(const Rounder &rounder) const { + Derived copy(*this); + // NOTE: Slicing is OK. + copy.fMacros.rounder = rounder; + return copy; +} + +template +Derived NumberFormatterSettings::grouping(const Grouper &grouper) const { + Derived copy(*this); + copy.fMacros.grouper = grouper; + return copy; +} + +template +Derived NumberFormatterSettings::integerWidth(const IntegerWidth &style) const { + Derived copy(*this); + copy.fMacros.integerWidth = style; + return copy; +} + +template +Derived NumberFormatterSettings::symbols(const DecimalFormatSymbols &symbols) const { + Derived copy(*this); + copy.fMacros.symbols.setTo(symbols); + return copy; +} + +template +Derived NumberFormatterSettings::adoptSymbols(const NumberingSystem *ns) const { + Derived copy(*this); + copy.fMacros.symbols.setTo(ns); + return copy; +} + +template +Derived NumberFormatterSettings::unitWidth(const UNumberUnitWidth &width) const { + Derived copy(*this); + copy.fMacros.unitWidth = width; + return copy; +} + +template +Derived NumberFormatterSettings::sign(const UNumberSignDisplay &style) const { + Derived copy(*this); + copy.fMacros.sign = style; + return copy; +} + +template +Derived NumberFormatterSettings::decimal(const UNumberDecimalSeparatorDisplay &style) const { + Derived copy(*this); + copy.fMacros.decimal = style; + return copy; +} + +template +Derived NumberFormatterSettings::padding(const Padder &padder) const { + Derived copy(*this); + copy.fMacros.padder = padder; + return copy; +} + +template +Derived NumberFormatterSettings::threshold(int32_t threshold) const { + Derived copy(*this); + copy.fMacros.threshold = threshold; + return copy; +} + +// Declare all classes that implement NumberFormatterSettings +// See https://stackoverflow.com/a/495056/1407170 +template +class icu::number::NumberFormatterSettings; +template +class icu::number::NumberFormatterSettings; + + +UnlocalizedNumberFormatter NumberFormatter::with() { + UnlocalizedNumberFormatter result; + return result; +} + +LocalizedNumberFormatter NumberFormatter::withLocale(const Locale &locale) { + return with().locale(locale); +} + +// Make the child class constructor that takes the parent class call the parent class's copy constructor +UnlocalizedNumberFormatter::UnlocalizedNumberFormatter( + const NumberFormatterSettings &other) + : NumberFormatterSettings(other) { +} + +// Make the child class constructor that takes the parent class call the parent class's copy constructor +// For LocalizedNumberFormatter, also copy over the extra fields +LocalizedNumberFormatter::LocalizedNumberFormatter( + const NumberFormatterSettings &other) + : NumberFormatterSettings(other) { + // No additional copies required +} + +LocalizedNumberFormatter::LocalizedNumberFormatter(const MacroProps ¯os, const Locale &locale) { + fMacros = macros; + fMacros.locale = locale; +} + +LocalizedNumberFormatter UnlocalizedNumberFormatter::locale(const Locale &locale) const { + return LocalizedNumberFormatter(fMacros, locale); +} + +SymbolsWrapper::SymbolsWrapper(const SymbolsWrapper &other) { + doCopyFrom(other); +} + +SymbolsWrapper &SymbolsWrapper::operator=(const SymbolsWrapper &other) { + if (this == &other) { + return *this; + } + doCleanup(); + doCopyFrom(other); + return *this; +} + +SymbolsWrapper::~SymbolsWrapper() { + doCleanup(); +} + +void SymbolsWrapper::setTo(const DecimalFormatSymbols &dfs) { + doCleanup(); + fType = SYMPTR_DFS; + fPtr.dfs = new DecimalFormatSymbols(dfs); +} + +void SymbolsWrapper::setTo(const NumberingSystem *ns) { + doCleanup(); + fType = SYMPTR_NS; + fPtr.ns = ns; +} + +void SymbolsWrapper::doCopyFrom(const SymbolsWrapper &other) { + fType = other.fType; + switch (fType) { + case SYMPTR_NONE: + // No action necessary + break; + case SYMPTR_DFS: + // Memory allocation failures are exposed in copyErrorTo() + if (other.fPtr.dfs != nullptr) { + fPtr.dfs = new DecimalFormatSymbols(*other.fPtr.dfs); + } else { + fPtr.dfs = nullptr; + } + break; + case SYMPTR_NS: + // Memory allocation failures are exposed in copyErrorTo() + if (other.fPtr.ns != nullptr) { + fPtr.ns = new NumberingSystem(*other.fPtr.ns); + } else { + fPtr.ns = nullptr; + } + break; + } +} + +void SymbolsWrapper::doCleanup() { + switch (fType) { + case SYMPTR_NONE: + // No action necessary + break; + case SYMPTR_DFS: + delete fPtr.dfs; + break; + case SYMPTR_NS: + delete fPtr.ns; + break; + } +} + +bool SymbolsWrapper::isDecimalFormatSymbols() const { + return fType == SYMPTR_DFS; +} + +bool SymbolsWrapper::isNumberingSystem() const { + return fType == SYMPTR_NS; +} + +const DecimalFormatSymbols* SymbolsWrapper::getDecimalFormatSymbols() const { + U_ASSERT(fType == SYMPTR_DFS); + return fPtr.dfs; +} + +const NumberingSystem* SymbolsWrapper::getNumberingSystem() const { + U_ASSERT(fType == SYMPTR_NS); + return fPtr.ns; +} + +LocalizedNumberFormatter::~LocalizedNumberFormatter() { + delete fCompiled; +} + +FormattedNumber LocalizedNumberFormatter::formatInt(int64_t value, UErrorCode &status) const { + if (U_FAILURE(status)) { return FormattedNumber(U_ILLEGAL_ARGUMENT_ERROR); } + auto results = new NumberFormatterResults(); + if (results == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return FormattedNumber(status); + } + results->quantity.setToLong(value); + return formatImpl(results, status); +} + +FormattedNumber LocalizedNumberFormatter::formatDouble(double value, UErrorCode &status) const { + if (U_FAILURE(status)) { return FormattedNumber(U_ILLEGAL_ARGUMENT_ERROR); } + auto results = new NumberFormatterResults(); + if (results == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return FormattedNumber(status); + } + results->quantity.setToDouble(value); + return formatImpl(results, status); +} + +FormattedNumber LocalizedNumberFormatter::formatDecimal(StringPiece value, UErrorCode &status) const { + if (U_FAILURE(status)) { return FormattedNumber(U_ILLEGAL_ARGUMENT_ERROR); } + auto results = new NumberFormatterResults(); + if (results == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return FormattedNumber(status); + } + results->quantity.setToDecNumber(value); + return formatImpl(results, status); +} + +FormattedNumber +LocalizedNumberFormatter::formatImpl(impl::NumberFormatterResults *results, UErrorCode &status) const { + // fUnsafeCallCount contains memory to be interpreted as an atomic int, most commonly + // std::atomic. Since the type of atomic int is platform-dependent, we cast the + // bytes in fUnsafeCallCount to u_atomic_int32_t, a typedef for the platform-dependent + // atomic int type defined in umutex.h. + static_assert(sizeof(u_atomic_int32_t) <= sizeof(fUnsafeCallCount), + "Atomic integer size on this platform exceeds the size allocated by fUnsafeCallCount"); + u_atomic_int32_t* callCount = reinterpret_cast( + const_cast(this)->fUnsafeCallCount); + + // A positive value in the atomic int indicates that the data structure is not yet ready; + // a negative value indicates that it is ready. If, after the increment, the atomic int + // is exactly threshold, then it is the current thread's job to build the data structure. + // Note: We set the callCount to INT32_MIN so that if another thread proceeds to increment + // the atomic int, the value remains below zero. + int32_t currentCount = umtx_loadAcquire(*callCount); + if (0 <= currentCount && currentCount <= fMacros.threshold && fMacros.threshold > 0) { + currentCount = umtx_atomic_inc(callCount); + } + + if (currentCount == fMacros.threshold && fMacros.threshold > 0) { + // Build the data structure and then use it (slow to fast path). + const NumberFormatterImpl* compiled = + NumberFormatterImpl::fromMacros(fMacros, status); + U_ASSERT(fCompiled == nullptr); + const_cast(this)->fCompiled = compiled; + umtx_storeRelease(*callCount, INT32_MIN); + compiled->apply(results->quantity, results->string, status); + } else if (currentCount < 0) { + // The data structure is already built; use it (fast path). + U_ASSERT(fCompiled != nullptr); + fCompiled->apply(results->quantity, results->string, status); + } else { + // Format the number without building the data structure (slow path). + NumberFormatterImpl::applyStatic(fMacros, results->quantity, results->string, status); + } + + // Do not save the results object if we encountered a failure. + if (U_SUCCESS(status)) { + return FormattedNumber(results); + } else { + delete results; + return FormattedNumber(status); + } +} + +UnicodeString FormattedNumber::toString() const { + if (fResults == nullptr) { + // TODO: http://bugs.icu-project.org/trac/ticket/13437 + return {}; + } + return fResults->string.toUnicodeString(); +} + +Appendable &FormattedNumber::appendTo(Appendable &appendable) { + if (fResults == nullptr) { + // TODO: http://bugs.icu-project.org/trac/ticket/13437 + return appendable; + } + appendable.appendString(fResults->string.chars(), fResults->string.length()); + return appendable; +} + +void FormattedNumber::populateFieldPosition(FieldPosition &fieldPosition, UErrorCode &status) { + if (U_FAILURE(status)) { return; } + if (fResults == nullptr) { + status = fErrorCode; + return; + } + fResults->string.populateFieldPosition(fieldPosition, 0, status); +} + +void +FormattedNumber::populateFieldPositionIterator(FieldPositionIterator &iterator, UErrorCode &status) { + if (U_FAILURE(status)) { return; } + if (fResults == nullptr) { + status = fErrorCode; + return; + } + fResults->string.populateFieldPositionIterator(iterator, status); +} + +FormattedNumber::~FormattedNumber() { + delete fResults; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_formatimpl.cpp b/deps/icu-small/source/i18n/number_formatimpl.cpp new file mode 100644 index 00000000000000..9986ce6d8c606b --- /dev/null +++ b/deps/icu-small/source/i18n/number_formatimpl.cpp @@ -0,0 +1,464 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "cstring.h" +#include "unicode/ures.h" +#include "uresimp.h" +#include "charstr.h" +#include "number_formatimpl.h" +#include "unicode/numfmt.h" +#include "number_patternstring.h" +#include "number_utils.h" +#include "unicode/numberformatter.h" +#include "unicode/dcfmtsym.h" +#include "number_scientific.h" +#include "number_compact.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + +// NOTE: In Java, the method to get a pattern from the resource bundle exists in NumberFormat. +// In C++, we have to implement that logic here. +// TODO: Make Java and C++ consistent? + +enum CldrPatternStyle { + CLDR_PATTERN_STYLE_DECIMAL, + CLDR_PATTERN_STYLE_CURRENCY, + CLDR_PATTERN_STYLE_ACCOUNTING, + CLDR_PATTERN_STYLE_PERCENT + // TODO: Consider scientific format. +}; + +const char16_t * +doGetPattern(UResourceBundle *res, const char *nsName, const char *patternKey, UErrorCode &publicStatus, + UErrorCode &localStatus) { + // Construct the path into the resource bundle + CharString key; + key.append("NumberElements/", publicStatus); + key.append(nsName, publicStatus); + key.append("/patterns/", publicStatus); + key.append(patternKey, publicStatus); + if (U_FAILURE(publicStatus)) { + return u""; + } + return ures_getStringByKeyWithFallback(res, key.data(), nullptr, &localStatus); +} + +const char16_t *getPatternForStyle(const Locale &locale, const char *nsName, CldrPatternStyle style, + UErrorCode &status) { + const char *patternKey; + switch (style) { + case CLDR_PATTERN_STYLE_DECIMAL: + patternKey = "decimalFormat"; + break; + case CLDR_PATTERN_STYLE_CURRENCY: + patternKey = "currencyFormat"; + break; + case CLDR_PATTERN_STYLE_ACCOUNTING: + patternKey = "accountingFormat"; + break; + case CLDR_PATTERN_STYLE_PERCENT: + default: + patternKey = "percentFormat"; + break; + } + LocalUResourceBundlePointer res(ures_open(nullptr, locale.getName(), &status)); + if (U_FAILURE(status)) { return u""; } + + // Attempt to get the pattern with the native numbering system. + UErrorCode localStatus = U_ZERO_ERROR; + const char16_t *pattern; + pattern = doGetPattern(res.getAlias(), nsName, patternKey, status, localStatus); + if (U_FAILURE(status)) { return u""; } + + // Fall back to latn if native numbering system does not have the right pattern + if (U_FAILURE(localStatus) && uprv_strcmp("latn", nsName) != 0) { + localStatus = U_ZERO_ERROR; + pattern = doGetPattern(res.getAlias(), "latn", patternKey, status, localStatus); + if (U_FAILURE(status)) { return u""; } + } + + return pattern; +} + +inline bool unitIsCurrency(const MeasureUnit &unit) { + return uprv_strcmp("currency", unit.getType()) == 0; +} + +inline bool unitIsNoUnit(const MeasureUnit &unit) { + return uprv_strcmp("none", unit.getType()) == 0; +} + +inline bool unitIsPercent(const MeasureUnit &unit) { + return uprv_strcmp("percent", unit.getSubtype()) == 0; +} + +inline bool unitIsPermille(const MeasureUnit &unit) { + return uprv_strcmp("permille", unit.getSubtype()) == 0; +} + +} // namespace + +NumberFormatterImpl *NumberFormatterImpl::fromMacros(const MacroProps ¯os, UErrorCode &status) { + return new NumberFormatterImpl(macros, true, status); +} + +void NumberFormatterImpl::applyStatic(const MacroProps ¯os, DecimalQuantity &inValue, + NumberStringBuilder &outString, UErrorCode &status) { + NumberFormatterImpl impl(macros, false, status); + impl.applyUnsafe(inValue, outString, status); +} + +// NOTE: C++ SPECIFIC DIFFERENCE FROM JAVA: +// The "safe" apply method uses a new MicroProps. In the MicroPropsGenerator, fMicros is copied into the new instance. +// The "unsafe" method simply re-uses fMicros, eliminating the extra copy operation. +// See MicroProps::processQuantity() for details. + +void NumberFormatterImpl::apply(DecimalQuantity &inValue, NumberStringBuilder &outString, + UErrorCode &status) const { + if (U_FAILURE(status)) { return; } + MicroProps micros; + fMicroPropsGenerator->processQuantity(inValue, micros, status); + if (U_FAILURE(status)) { return; } + microsToString(micros, inValue, outString, status); +} + +void NumberFormatterImpl::applyUnsafe(DecimalQuantity &inValue, NumberStringBuilder &outString, + UErrorCode &status) { + if (U_FAILURE(status)) { return; } + fMicroPropsGenerator->processQuantity(inValue, fMicros, status); + if (U_FAILURE(status)) { return; } + microsToString(fMicros, inValue, outString, status); +} + +NumberFormatterImpl::NumberFormatterImpl(const MacroProps ¯os, bool safe, UErrorCode &status) { + fMicroPropsGenerator = macrosToMicroGenerator(macros, safe, status); +} + +////////// + +const MicroPropsGenerator * +NumberFormatterImpl::macrosToMicroGenerator(const MacroProps ¯os, bool safe, UErrorCode &status) { + const MicroPropsGenerator *chain = &fMicros; + + // Check that macros is error-free before continuing. + if (macros.copyErrorTo(status)) { + return nullptr; + } + + // TODO: Accept currency symbols from DecimalFormatSymbols? + + // Pre-compute a few values for efficiency. + bool isCurrency = unitIsCurrency(macros.unit); + bool isNoUnit = unitIsNoUnit(macros.unit); + bool isPercent = isNoUnit && unitIsPercent(macros.unit); + bool isPermille = isNoUnit && unitIsPermille(macros.unit); + bool isCldrUnit = !isCurrency && !isNoUnit; + bool isAccounting = + macros.sign == UNUM_SIGN_ACCOUNTING || macros.sign == UNUM_SIGN_ACCOUNTING_ALWAYS; + CurrencyUnit currency(kDefaultCurrency, status); + if (isCurrency) { + currency = CurrencyUnit(macros.unit, status); // Restore CurrencyUnit from MeasureUnit + } + UNumberUnitWidth unitWidth = UNUM_UNIT_WIDTH_SHORT; + if (macros.unitWidth != UNUM_UNIT_WIDTH_COUNT) { + unitWidth = macros.unitWidth; + } + + // Select the numbering system. + LocalPointer nsLocal; + const NumberingSystem *ns; + if (macros.symbols.isNumberingSystem()) { + ns = macros.symbols.getNumberingSystem(); + } else { + // TODO: Is there a way to avoid creating the NumberingSystem object? + ns = NumberingSystem::createInstance(macros.locale, status); + // Give ownership to the function scope. + nsLocal.adoptInstead(ns); + } + const char *nsName = U_SUCCESS(status) ? ns->getName() : "latn"; + + // Load and parse the pattern string. It is used for grouping sizes and affixes only. + CldrPatternStyle patternStyle; + if (isPercent || isPermille) { + patternStyle = CLDR_PATTERN_STYLE_PERCENT; + } else if (!isCurrency || unitWidth == UNUM_UNIT_WIDTH_FULL_NAME) { + patternStyle = CLDR_PATTERN_STYLE_DECIMAL; + } else if (isAccounting) { + // NOTE: Although ACCOUNTING and ACCOUNTING_ALWAYS are only supported in currencies right now, + // the API contract allows us to add support to other units in the future. + patternStyle = CLDR_PATTERN_STYLE_ACCOUNTING; + } else { + patternStyle = CLDR_PATTERN_STYLE_CURRENCY; + } + const char16_t *pattern = getPatternForStyle(macros.locale, nsName, patternStyle, status); + auto patternInfo = new ParsedPatternInfo(); + fPatternInfo.adoptInstead(patternInfo); + PatternParser::parseToPatternInfo(UnicodeString(pattern), *patternInfo, status); + + ///////////////////////////////////////////////////////////////////////////////////// + /// START POPULATING THE DEFAULT MICROPROPS AND BUILDING THE MICROPROPS GENERATOR /// + ///////////////////////////////////////////////////////////////////////////////////// + + // Symbols + if (macros.symbols.isDecimalFormatSymbols()) { + fMicros.symbols = macros.symbols.getDecimalFormatSymbols(); + } else { + fMicros.symbols = new DecimalFormatSymbols(macros.locale, *ns, status); + // Give ownership to the NumberFormatterImpl. + fSymbols.adoptInstead(fMicros.symbols); + } + + // Rounding strategy + if (!macros.rounder.isBogus()) { + fMicros.rounding = macros.rounder; + } else if (macros.notation.fType == Notation::NTN_COMPACT) { + fMicros.rounding = Rounder::integer().withMinDigits(2); + } else if (isCurrency) { + fMicros.rounding = Rounder::currency(UCURR_USAGE_STANDARD); + } else { + fMicros.rounding = Rounder::maxFraction(6); + } + fMicros.rounding.setLocaleData(currency, status); + + // Grouping strategy + if (!macros.grouper.isBogus()) { + fMicros.grouping = macros.grouper; + } else if (macros.notation.fType == Notation::NTN_COMPACT) { + // Compact notation uses minGrouping by default since ICU 59 + fMicros.grouping = Grouper::minTwoDigits(); + } else { + fMicros.grouping = Grouper::defaults(); + } + fMicros.grouping.setLocaleData(*fPatternInfo); + + // Padding strategy + if (!macros.padder.isBogus()) { + fMicros.padding = macros.padder; + } else { + fMicros.padding = Padder::none(); + } + + // Integer width + if (!macros.integerWidth.isBogus()) { + fMicros.integerWidth = macros.integerWidth; + } else { + fMicros.integerWidth = IntegerWidth::zeroFillTo(1); + } + + // Sign display + if (macros.sign != UNUM_SIGN_COUNT) { + fMicros.sign = macros.sign; + } else { + fMicros.sign = UNUM_SIGN_AUTO; + } + + // Decimal mark display + if (macros.decimal != UNUM_DECIMAL_SEPARATOR_COUNT) { + fMicros.decimal = macros.decimal; + } else { + fMicros.decimal = UNUM_DECIMAL_SEPARATOR_AUTO; + } + + // Use monetary separator symbols + fMicros.useCurrency = isCurrency; + + // Inner modifier (scientific notation) + if (macros.notation.fType == Notation::NTN_SCIENTIFIC) { + fScientificHandler.adoptInstead(new ScientificHandler(¯os.notation, fMicros.symbols, chain)); + chain = fScientificHandler.getAlias(); + } else { + // No inner modifier required + fMicros.modInner = &fMicros.helpers.emptyStrongModifier; + } + + // Middle modifier (patterns, positive/negative, currency symbols, percent) + auto patternModifier = new MutablePatternModifier(false); + fPatternModifier.adoptInstead(patternModifier); + patternModifier->setPatternInfo(fPatternInfo.getAlias()); + patternModifier->setPatternAttributes(fMicros.sign, isPermille); + if (patternModifier->needsPlurals()) { + patternModifier->setSymbols( + fMicros.symbols, + currency, + unitWidth, + resolvePluralRules(macros.rules, macros.locale, status)); + } else { + patternModifier->setSymbols(fMicros.symbols, currency, unitWidth, nullptr); + } + if (safe) { + fImmutablePatternModifier.adoptInstead(patternModifier->createImmutableAndChain(chain, status)); + chain = fImmutablePatternModifier.getAlias(); + } else { + patternModifier->addToChain(chain); + chain = patternModifier; + } + + // Outer modifier (CLDR units and currency long names) + if (isCldrUnit) { + fLongNameHandler.adoptInstead( + new LongNameHandler( + LongNameHandler::forMeasureUnit( + macros.locale, + macros.unit, + unitWidth, + resolvePluralRules(macros.rules, macros.locale, status), + chain, + status))); + chain = fLongNameHandler.getAlias(); + } else if (isCurrency && unitWidth == UNUM_UNIT_WIDTH_FULL_NAME) { + fLongNameHandler.adoptInstead( + new LongNameHandler( + LongNameHandler::forCurrencyLongNames( + macros.locale, + currency, + resolvePluralRules(macros.rules, macros.locale, status), + chain, + status))); + chain = fLongNameHandler.getAlias(); + } else { + // No outer modifier required + fMicros.modOuter = &fMicros.helpers.emptyWeakModifier; + } + + // Compact notation + // NOTE: Compact notation can (but might not) override the middle modifier and rounding. + // It therefore needs to go at the end of the chain. + if (macros.notation.fType == Notation::NTN_COMPACT) { + CompactType compactType = (isCurrency && unitWidth != UNUM_UNIT_WIDTH_FULL_NAME) + ? CompactType::TYPE_CURRENCY : CompactType::TYPE_DECIMAL; + fCompactHandler.adoptInstead( + new CompactHandler( + macros.notation.fUnion.compactStyle, + macros.locale, + nsName, + compactType, + resolvePluralRules(macros.rules, macros.locale, status), + safe ? patternModifier : nullptr, + chain, + status)); + chain = fCompactHandler.getAlias(); + } + + return chain; +} + +const PluralRules * +NumberFormatterImpl::resolvePluralRules(const PluralRules *rulesPtr, const Locale &locale, + UErrorCode &status) { + if (rulesPtr != nullptr) { + return rulesPtr; + } + // Lazily create PluralRules + if (fRules.isNull()) { + fRules.adoptInstead(PluralRules::forLocale(locale, status)); + } + return fRules.getAlias(); +} + +int32_t NumberFormatterImpl::microsToString(const MicroProps µs, DecimalQuantity &quantity, + NumberStringBuilder &string, UErrorCode &status) { + micros.rounding.apply(quantity, status); + micros.integerWidth.apply(quantity, status); + int32_t length = writeNumber(micros, quantity, string, status); + // NOTE: When range formatting is added, these modifiers can bubble up. + // For now, apply them all here at once. + // Always apply the inner modifier (which is "strong"). + length += micros.modInner->apply(string, 0, length, status); + if (micros.padding.isValid()) { + length += micros.padding + .padAndApply(*micros.modMiddle, *micros.modOuter, string, 0, length, status); + } else { + length += micros.modMiddle->apply(string, 0, length, status); + length += micros.modOuter->apply(string, 0, length, status); + } + return length; +} + +int32_t NumberFormatterImpl::writeNumber(const MicroProps µs, DecimalQuantity &quantity, + NumberStringBuilder &string, UErrorCode &status) { + int32_t length = 0; + if (quantity.isInfinite()) { + length += string.insert( + length, + micros.symbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kInfinitySymbol), + UNUM_INTEGER_FIELD, + status); + + } else if (quantity.isNaN()) { + length += string.insert( + length, + micros.symbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kNaNSymbol), + UNUM_INTEGER_FIELD, + status); + + } else { + // Add the integer digits + length += writeIntegerDigits(micros, quantity, string, status); + + // Add the decimal point + if (quantity.getLowerDisplayMagnitude() < 0 || micros.decimal == UNUM_DECIMAL_SEPARATOR_ALWAYS) { + length += string.insert( + length, + micros.useCurrency ? micros.symbols->getSymbol( + DecimalFormatSymbols::ENumberFormatSymbol::kMonetarySeparatorSymbol) : micros + .symbols + ->getSymbol( + DecimalFormatSymbols::ENumberFormatSymbol::kDecimalSeparatorSymbol), + UNUM_DECIMAL_SEPARATOR_FIELD, + status); + } + + // Add the fraction digits + length += writeFractionDigits(micros, quantity, string, status); + } + + return length; +} + +int32_t NumberFormatterImpl::writeIntegerDigits(const MicroProps µs, DecimalQuantity &quantity, + NumberStringBuilder &string, UErrorCode &status) { + int length = 0; + int integerCount = quantity.getUpperDisplayMagnitude() + 1; + for (int i = 0; i < integerCount; i++) { + // Add grouping separator + if (micros.grouping.groupAtPosition(i, quantity)) { + length += string.insert( + 0, + micros.useCurrency ? micros.symbols->getSymbol( + DecimalFormatSymbols::ENumberFormatSymbol::kMonetaryGroupingSeparatorSymbol) + : micros.symbols->getSymbol( + DecimalFormatSymbols::ENumberFormatSymbol::kGroupingSeparatorSymbol), + UNUM_GROUPING_SEPARATOR_FIELD, + status); + } + + // Get and append the next digit value + int8_t nextDigit = quantity.getDigit(i); + length += string.insert( + 0, getDigitFromSymbols(nextDigit, *micros.symbols), UNUM_INTEGER_FIELD, status); + } + return length; +} + +int32_t NumberFormatterImpl::writeFractionDigits(const MicroProps µs, DecimalQuantity &quantity, + NumberStringBuilder &string, UErrorCode &status) { + int length = 0; + int fractionCount = -quantity.getLowerDisplayMagnitude(); + for (int i = 0; i < fractionCount; i++) { + // Get and append the next digit value + int8_t nextDigit = quantity.getDigit(-i - 1); + length += string.append( + getDigitFromSymbols(nextDigit, *micros.symbols), UNUM_FRACTION_FIELD, status); + } + return length; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_formatimpl.h b/deps/icu-small/source/i18n/number_formatimpl.h new file mode 100644 index 00000000000000..cbc04ba30df4c4 --- /dev/null +++ b/deps/icu-small/source/i18n/number_formatimpl.h @@ -0,0 +1,125 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_FORMATIMPL_H__ +#define __NUMBER_FORMATIMPL_H__ + +#include "number_types.h" +#include "number_stringbuilder.h" +#include "number_patternstring.h" +#include "number_utils.h" +#include "number_patternmodifier.h" +#include "number_longnames.h" +#include "number_compact.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +/** + * This is the "brain" of the number formatting pipeline. It ties all the pieces together, taking in a MacroProps and a + * DecimalQuantity and outputting a properly formatted number string. + */ +class NumberFormatterImpl : public UMemory { + public: + /** + * Builds a "safe" MicroPropsGenerator, which is thread-safe and can be used repeatedly. + * The caller owns the returned NumberFormatterImpl. + */ + static NumberFormatterImpl *fromMacros(const MacroProps ¯os, UErrorCode &status); + + /** + * Builds and evaluates an "unsafe" MicroPropsGenerator, which is cheaper but can be used only once. + */ + static void + applyStatic(const MacroProps ¯os, DecimalQuantity &inValue, NumberStringBuilder &outString, + UErrorCode &status); + + /** + * Evaluates the "safe" MicroPropsGenerator created by "fromMacros". + */ + void apply(DecimalQuantity &inValue, NumberStringBuilder &outString, UErrorCode &status) const; + + private: + // Head of the MicroPropsGenerator linked list: + const MicroPropsGenerator *fMicroPropsGenerator = nullptr; + + // Tail of the list: + MicroProps fMicros; + + // Other fields possibly used by the number formatting pipeline: + // TODO: Convert some of these LocalPointers to value objects to reduce the number of news? + LocalPointer fSymbols; + LocalPointer fRules; + LocalPointer fPatternInfo; + LocalPointer fScientificHandler; + LocalPointer fPatternModifier; + LocalPointer fImmutablePatternModifier; + LocalPointer fLongNameHandler; + LocalPointer fCompactHandler; + + + NumberFormatterImpl(const MacroProps ¯os, bool safe, UErrorCode &status); + + void applyUnsafe(DecimalQuantity &inValue, NumberStringBuilder &outString, UErrorCode &status); + + /** + * If rulesPtr is non-null, return it. Otherwise, return a PluralRules owned by this object for the + * specified locale, creating it if necessary. + */ + const PluralRules * + resolvePluralRules(const PluralRules *rulesPtr, const Locale &locale, UErrorCode &status); + + /** + * Synthesizes the MacroProps into a MicroPropsGenerator. All information, including the locale, is encoded into the + * MicroPropsGenerator, except for the quantity itself, which is left abstract and must be provided to the returned + * MicroPropsGenerator instance. + * + * @see MicroPropsGenerator + * @param macros + * The {@link MacroProps} to consume. This method does not mutate the MacroProps instance. + * @param safe + * If true, the returned MicroPropsGenerator will be thread-safe. If false, the returned value will + * not be thread-safe, intended for a single "one-shot" use only. Building the thread-safe + * object is more expensive. + */ + const MicroPropsGenerator * + macrosToMicroGenerator(const MacroProps ¯os, bool safe, UErrorCode &status); + + /** + * Synthesizes the output string from a MicroProps and DecimalQuantity. + * + * @param micros + * The MicroProps after the quantity has been consumed. Will not be mutated. + * @param quantity + * The DecimalQuantity to be rendered. May be mutated. + * @param string + * The output string. Will be mutated. + */ + static int32_t + microsToString(const MicroProps µs, DecimalQuantity &quantity, NumberStringBuilder &string, + UErrorCode &status); + + static int32_t + writeNumber(const MicroProps µs, DecimalQuantity &quantity, NumberStringBuilder &string, + UErrorCode &status); + + static int32_t + writeIntegerDigits(const MicroProps µs, DecimalQuantity &quantity, NumberStringBuilder &string, + UErrorCode &status); + + static int32_t + writeFractionDigits(const MicroProps µs, DecimalQuantity &quantity, NumberStringBuilder &string, + UErrorCode &status); +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_FORMATIMPL_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_grouping.cpp b/deps/icu-small/source/i18n/number_grouping.cpp new file mode 100644 index 00000000000000..15362825cc68ce --- /dev/null +++ b/deps/icu-small/source/i18n/number_grouping.cpp @@ -0,0 +1,55 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "unicode/numberformatter.h" +#include "number_patternstring.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +Grouper Grouper::defaults() { + return {-2, -2, false}; +} + +Grouper Grouper::minTwoDigits() { + return {-2, -2, true}; +} + +Grouper Grouper::none() { + return {-1, -1, false}; +} + +void Grouper::setLocaleData(const impl::ParsedPatternInfo &patternInfo) { + if (fGrouping1 != -2) { + return; + } + auto grouping1 = static_cast (patternInfo.positive.groupingSizes & 0xffff); + auto grouping2 = static_cast ((patternInfo.positive.groupingSizes >> 16) & 0xffff); + auto grouping3 = static_cast ((patternInfo.positive.groupingSizes >> 32) & 0xffff); + if (grouping2 == -1) { + grouping1 = -1; + } + if (grouping3 == -1) { + grouping2 = grouping1; + } + fGrouping1 = grouping1; + fGrouping2 = grouping2; +} + +bool Grouper::groupAtPosition(int32_t position, const impl::DecimalQuantity &value) const { + U_ASSERT(fGrouping1 > -2); + if (fGrouping1 == -1 || fGrouping1 == 0) { + // Either -1 or 0 means "no grouping" + return false; + } + position -= fGrouping1; + return position >= 0 && (position % fGrouping2) == 0 + && value.getUpperDisplayMagnitude() - fGrouping1 + 1 >= (fMin2 ? 2 : 1); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_integerwidth.cpp b/deps/icu-small/source/i18n/number_integerwidth.cpp new file mode 100644 index 00000000000000..10dacfc4acb96f --- /dev/null +++ b/deps/icu-small/source/i18n/number_integerwidth.cpp @@ -0,0 +1,48 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "unicode/numberformatter.h" +#include "number_types.h" +#include "number_decimalquantity.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +IntegerWidth::IntegerWidth(int8_t minInt, int8_t maxInt) { + fUnion.minMaxInt.fMinInt = minInt; + fUnion.minMaxInt.fMaxInt = maxInt; +} + +IntegerWidth IntegerWidth::zeroFillTo(int32_t minInt) { + if (minInt >= 0 && minInt <= kMaxIntFracSig) { + return {static_cast(minInt), -1}; + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +IntegerWidth IntegerWidth::truncateAt(int32_t maxInt) { + if (fHasError) { return *this; } // No-op on error + if (maxInt >= 0 && maxInt <= kMaxIntFracSig) { + return {fUnion.minMaxInt.fMinInt, static_cast(maxInt)}; + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +void IntegerWidth::apply(impl::DecimalQuantity &quantity, UErrorCode &status) const { + if (fHasError) { + status = U_ILLEGAL_ARGUMENT_ERROR; + } else if (fUnion.minMaxInt.fMaxInt == -1) { + quantity.setIntegerLength(fUnion.minMaxInt.fMinInt, INT32_MAX); + } else { + quantity.setIntegerLength(fUnion.minMaxInt.fMinInt, fUnion.minMaxInt.fMaxInt); + } +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_longnames.cpp b/deps/icu-small/source/i18n/number_longnames.cpp new file mode 100644 index 00000000000000..88b3413585a0f7 --- /dev/null +++ b/deps/icu-small/source/i18n/number_longnames.cpp @@ -0,0 +1,165 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "unicode/ures.h" +#include "ureslocs.h" +#include "charstr.h" +#include "uresimp.h" +#include "number_longnames.h" +#include +#include "cstring.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + + +////////////////////////// +/// BEGIN DATA LOADING /// +////////////////////////// + +class PluralTableSink : public ResourceSink { + public: + explicit PluralTableSink(UnicodeString *outArray) : outArray(outArray) { + // Initialize the array to bogus strings. + for (int32_t i = 0; i < StandardPlural::Form::COUNT; i++) { + outArray[i].setToBogus(); + } + } + + void put(const char *key, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) U_OVERRIDE { + ResourceTable pluralsTable = value.getTable(status); + if (U_FAILURE(status)) { return; } + for (int i = 0; pluralsTable.getKeyAndValue(i, key, value); ++i) { + // In MeasureUnit data, ignore dnam and per units for now. + if (uprv_strcmp(key, "dnam") == 0 || uprv_strcmp(key, "per") == 0) { + continue; + } + StandardPlural::Form plural = StandardPlural::fromString(key, status); + if (U_FAILURE(status)) { return; } + if (!outArray[plural].isBogus()) { + continue; + } + outArray[plural] = value.getUnicodeString(status); + if (U_FAILURE(status)) { return; } + } + } + + private: + UnicodeString *outArray; +}; + +// NOTE: outArray MUST have room for all StandardPlural values. No bounds checking is performed. + +void getMeasureData(const Locale &locale, const MeasureUnit &unit, const UNumberUnitWidth &width, + UnicodeString *outArray, UErrorCode &status) { + PluralTableSink sink(outArray); + LocalUResourceBundlePointer unitsBundle(ures_open(U_ICUDATA_UNIT, locale.getName(), &status)); + if (U_FAILURE(status)) { return; } + CharString key; + key.append("units", status); + if (width == UNUM_UNIT_WIDTH_NARROW) { + key.append("Narrow", status); + } else if (width == UNUM_UNIT_WIDTH_SHORT) { + key.append("Short", status); + } + key.append("/", status); + key.append(unit.getType(), status); + key.append("/", status); + key.append(unit.getSubtype(), status); + ures_getAllItemsWithFallback(unitsBundle.getAlias(), key.data(), sink, status); +} + +void getCurrencyLongNameData(const Locale &locale, const CurrencyUnit ¤cy, UnicodeString *outArray, + UErrorCode &status) { + // In ICU4J, this method gets a CurrencyData from CurrencyData.provider. + // TODO(ICU4J): Implement this without going through CurrencyData, like in ICU4C? + PluralTableSink sink(outArray); + LocalUResourceBundlePointer unitsBundle(ures_open(U_ICUDATA_CURR, locale.getName(), &status)); + if (U_FAILURE(status)) { return; } + ures_getAllItemsWithFallback(unitsBundle.getAlias(), "CurrencyUnitPatterns", sink, status); + if (U_FAILURE(status)) { return; } + for (int32_t i = 0; i < StandardPlural::Form::COUNT; i++) { + UnicodeString &pattern = outArray[i]; + if (pattern.isBogus()) { + continue; + } + UBool isChoiceFormat = FALSE; + int32_t longNameLen = 0; + const char16_t *longName = ucurr_getPluralName( + currency.getISOCurrency(), + locale.getName(), + &isChoiceFormat, + StandardPlural::getKeyword(static_cast(i)), + &longNameLen, + &status); + // Example pattern from data: "{0} {1}" + // Example output after find-and-replace: "{0} US dollars" + pattern.findAndReplace(UnicodeString(u"{1}"), UnicodeString(longName, longNameLen)); + } +} + +//////////////////////// +/// END DATA LOADING /// +//////////////////////// + +} // namespace + +LongNameHandler +LongNameHandler::forMeasureUnit(const Locale &loc, const MeasureUnit &unit, const UNumberUnitWidth &width, + const PluralRules *rules, const MicroPropsGenerator *parent, + UErrorCode &status) { + LongNameHandler result(rules, parent); + UnicodeString simpleFormats[StandardPlural::Form::COUNT]; + getMeasureData(loc, unit, width, simpleFormats, status); + if (U_FAILURE(status)) { return result; } + // TODO: What field to use for units? + simpleFormatsToModifiers(simpleFormats, UNUM_FIELD_COUNT, result.fModifiers, status); + return result; +} + +LongNameHandler LongNameHandler::forCurrencyLongNames(const Locale &loc, const CurrencyUnit ¤cy, + const PluralRules *rules, + const MicroPropsGenerator *parent, + UErrorCode &status) { + LongNameHandler result(rules, parent); + UnicodeString simpleFormats[StandardPlural::Form::COUNT]; + getCurrencyLongNameData(loc, currency, simpleFormats, status); + if (U_FAILURE(status)) { return result; } + simpleFormatsToModifiers(simpleFormats, UNUM_CURRENCY_FIELD, result.fModifiers, status); + return result; +} + +void LongNameHandler::simpleFormatsToModifiers(const UnicodeString *simpleFormats, Field field, + SimpleModifier *output, UErrorCode &status) { + for (int32_t i = 0; i < StandardPlural::Form::COUNT; i++) { + UnicodeString simpleFormat = simpleFormats[i]; + if (simpleFormat.isBogus()) { + simpleFormat = simpleFormats[StandardPlural::Form::OTHER]; + } + if (simpleFormat.isBogus()) { + // There should always be data in the "other" plural variant. + status = U_INTERNAL_PROGRAM_ERROR; + return; + } + SimpleFormatter compiledFormatter(simpleFormat, 1, 1, status); + output[i] = SimpleModifier(compiledFormatter, field, false); + } +} + +void LongNameHandler::processQuantity(DecimalQuantity &quantity, MicroProps µs, + UErrorCode &status) const { + parent->processQuantity(quantity, micros, status); + // TODO: Avoid the copy here? + DecimalQuantity copy(quantity); + micros.rounding.apply(copy, status); + micros.modOuter = &fModifiers[copy.getStandardPlural(rules)]; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_longnames.h b/deps/icu-small/source/i18n/number_longnames.h new file mode 100644 index 00000000000000..22ecbac30e1ebc --- /dev/null +++ b/deps/icu-small/source/i18n/number_longnames.h @@ -0,0 +1,48 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_LONGNAMES_H__ +#define __NUMBER_LONGNAMES_H__ + +#include "unicode/uversion.h" +#include "number_utils.h" +#include "number_modifiers.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +class LongNameHandler : public MicroPropsGenerator, public UMemory { + public: + static LongNameHandler + forCurrencyLongNames(const Locale &loc, const CurrencyUnit ¤cy, const PluralRules *rules, + const MicroPropsGenerator *parent, UErrorCode &status); + + static LongNameHandler + forMeasureUnit(const Locale &loc, const MeasureUnit &unit, const UNumberUnitWidth &width, + const PluralRules *rules, const MicroPropsGenerator *parent, UErrorCode &status); + + void + processQuantity(DecimalQuantity &quantity, MicroProps µs, UErrorCode &status) const U_OVERRIDE; + + private: + SimpleModifier fModifiers[StandardPlural::Form::COUNT]; + const PluralRules *rules; + const MicroPropsGenerator *parent; + + LongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent) + : rules(rules), parent(parent) {} + + static void simpleFormatsToModifiers(const UnicodeString *simpleFormats, Field field, + SimpleModifier *output, UErrorCode &status); +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_LONGNAMES_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_modifiers.cpp b/deps/icu-small/source/i18n/number_modifiers.cpp new file mode 100644 index 00000000000000..a19b12d11ed7a2 --- /dev/null +++ b/deps/icu-small/source/i18n/number_modifiers.cpp @@ -0,0 +1,303 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "umutex.h" +#include "ucln_cmn.h" +#include "ucln_in.h" +#include "number_modifiers.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + +// TODO: This is copied from simpleformatter.cpp +const int32_t ARG_NUM_LIMIT = 0x100; + +// These are the default currency spacing UnicodeSets in CLDR. +// Pre-compute them for performance. +// The Java unit test testCurrencySpacingPatternStability() will start failing if these change in CLDR. +icu::UInitOnce gDefaultCurrencySpacingInitOnce = U_INITONCE_INITIALIZER; + +UnicodeSet *UNISET_DIGIT = nullptr; +UnicodeSet *UNISET_NOTS = nullptr; + +UBool U_CALLCONV cleanupDefaultCurrencySpacing() { + delete UNISET_DIGIT; + UNISET_DIGIT = nullptr; + delete UNISET_NOTS; + UNISET_NOTS = nullptr; + return TRUE; +} + +void U_CALLCONV initDefaultCurrencySpacing(UErrorCode &status) { + ucln_i18n_registerCleanup(UCLN_I18N_CURRENCY_SPACING, cleanupDefaultCurrencySpacing); + UNISET_DIGIT = new UnicodeSet(UnicodeString(u"[:digit:]"), status); + UNISET_NOTS = new UnicodeSet(UnicodeString(u"[:^S:]"), status); + if (UNISET_DIGIT == nullptr || UNISET_NOTS == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return; + } + UNISET_DIGIT->freeze(); + UNISET_NOTS->freeze(); +} + +} // namespace + + +int32_t ConstantAffixModifier::apply(NumberStringBuilder &output, int leftIndex, int rightIndex, + UErrorCode &status) const { + // Insert the suffix first since inserting the prefix will change the rightIndex + int length = output.insert(rightIndex, fSuffix, fField, status); + length += output.insert(leftIndex, fPrefix, fField, status); + return length; +} + +int32_t ConstantAffixModifier::getPrefixLength(UErrorCode &status) const { + (void)status; + return fPrefix.length(); +} + +int32_t ConstantAffixModifier::getCodePointCount(UErrorCode &status) const { + (void)status; + return fPrefix.countChar32() + fSuffix.countChar32(); +} + +bool ConstantAffixModifier::isStrong() const { + return fStrong; +} + +SimpleModifier::SimpleModifier(const SimpleFormatter &simpleFormatter, Field field, bool strong) + : fCompiledPattern(simpleFormatter.compiledPattern), fField(field), fStrong(strong) { + U_ASSERT(1 == + SimpleFormatter::getArgumentLimit(fCompiledPattern.getBuffer(), fCompiledPattern.length())); + if (fCompiledPattern.charAt(1) != 0) { + fPrefixLength = fCompiledPattern.charAt(1) - ARG_NUM_LIMIT; + fSuffixOffset = 3 + fPrefixLength; + } else { + fPrefixLength = 0; + fSuffixOffset = 2; + } + if (3 + fPrefixLength < fCompiledPattern.length()) { + fSuffixLength = fCompiledPattern.charAt(fSuffixOffset) - ARG_NUM_LIMIT; + } else { + fSuffixLength = 0; + } +} + +SimpleModifier::SimpleModifier() + : fField(UNUM_FIELD_COUNT), fStrong(false), fPrefixLength(0), fSuffixLength(0) { +} + +int32_t SimpleModifier::apply(NumberStringBuilder &output, int leftIndex, int rightIndex, + UErrorCode &status) const { + return formatAsPrefixSuffix(output, leftIndex, rightIndex, fField, status); +} + +int32_t SimpleModifier::getPrefixLength(UErrorCode &status) const { + (void)status; + return fPrefixLength; +} + +int32_t SimpleModifier::getCodePointCount(UErrorCode &status) const { + (void)status; + int32_t count = 0; + if (fPrefixLength > 0) { + count += fCompiledPattern.countChar32(2, fPrefixLength); + } + if (fSuffixLength > 0) { + count += fCompiledPattern.countChar32(1 + fSuffixOffset, fSuffixLength); + } + return count; +} + +bool SimpleModifier::isStrong() const { + return fStrong; +} + +int32_t +SimpleModifier::formatAsPrefixSuffix(NumberStringBuilder &result, int32_t startIndex, int32_t endIndex, + Field field, UErrorCode &status) const { + if (fPrefixLength > 0) { + result.insert(startIndex, fCompiledPattern, 2, 2 + fPrefixLength, field, status); + } + if (fSuffixLength > 0) { + result.insert( + endIndex + fPrefixLength, + fCompiledPattern, + 1 + fSuffixOffset, + 1 + fSuffixOffset + fSuffixLength, + field, + status); + } + return fPrefixLength + fSuffixLength; +} + +int32_t ConstantMultiFieldModifier::apply(NumberStringBuilder &output, int leftIndex, int rightIndex, + UErrorCode &status) const { + // Insert the suffix first since inserting the prefix will change the rightIndex + int32_t length = output.insert(rightIndex, fSuffix, status); + length += output.insert(leftIndex, fPrefix, status); + return length; +} + +int32_t ConstantMultiFieldModifier::getPrefixLength(UErrorCode &status) const { + (void)status; + return fPrefix.length(); +} + +int32_t ConstantMultiFieldModifier::getCodePointCount(UErrorCode &status) const { + (void)status; + return fPrefix.codePointCount() + fSuffix.codePointCount(); +} + +bool ConstantMultiFieldModifier::isStrong() const { + return fStrong; +} + +CurrencySpacingEnabledModifier::CurrencySpacingEnabledModifier(const NumberStringBuilder &prefix, + const NumberStringBuilder &suffix, + bool strong, + const DecimalFormatSymbols &symbols, + UErrorCode &status) + : ConstantMultiFieldModifier(prefix, suffix, strong) { + // Check for currency spacing. Do not build the UnicodeSets unless there is + // a currency code point at a boundary. + if (prefix.length() > 0 && prefix.fieldAt(prefix.length() - 1) == UNUM_CURRENCY_FIELD) { + int prefixCp = prefix.getLastCodePoint(); + UnicodeSet prefixUnicodeSet = getUnicodeSet(symbols, IN_CURRENCY, PREFIX, status); + if (prefixUnicodeSet.contains(prefixCp)) { + fAfterPrefixUnicodeSet = getUnicodeSet(symbols, IN_NUMBER, PREFIX, status); + fAfterPrefixUnicodeSet.freeze(); + fAfterPrefixInsert = getInsertString(symbols, PREFIX, status); + } else { + fAfterPrefixUnicodeSet.setToBogus(); + fAfterPrefixInsert.setToBogus(); + } + } else { + fAfterPrefixUnicodeSet.setToBogus(); + fAfterPrefixInsert.setToBogus(); + } + if (suffix.length() > 0 && suffix.fieldAt(0) == UNUM_CURRENCY_FIELD) { + int suffixCp = suffix.getLastCodePoint(); + UnicodeSet suffixUnicodeSet = getUnicodeSet(symbols, IN_CURRENCY, SUFFIX, status); + if (suffixUnicodeSet.contains(suffixCp)) { + fBeforeSuffixUnicodeSet = getUnicodeSet(symbols, IN_NUMBER, SUFFIX, status); + fBeforeSuffixUnicodeSet.freeze(); + fBeforeSuffixInsert = getInsertString(symbols, SUFFIX, status); + } else { + fBeforeSuffixUnicodeSet.setToBogus(); + fBeforeSuffixInsert.setToBogus(); + } + } else { + fBeforeSuffixUnicodeSet.setToBogus(); + fBeforeSuffixInsert.setToBogus(); + } +} + +int32_t CurrencySpacingEnabledModifier::apply(NumberStringBuilder &output, int leftIndex, int rightIndex, + UErrorCode &status) const { + // Currency spacing logic + int length = 0; + if (rightIndex - leftIndex > 0 && !fAfterPrefixUnicodeSet.isBogus() && + fAfterPrefixUnicodeSet.contains(output.codePointAt(leftIndex))) { + // TODO: Should we use the CURRENCY field here? + length += output.insert(leftIndex, fAfterPrefixInsert, UNUM_FIELD_COUNT, status); + } + if (rightIndex - leftIndex > 0 && !fBeforeSuffixUnicodeSet.isBogus() && + fBeforeSuffixUnicodeSet.contains(output.codePointBefore(rightIndex))) { + // TODO: Should we use the CURRENCY field here? + length += output.insert(rightIndex + length, fBeforeSuffixInsert, UNUM_FIELD_COUNT, status); + } + + // Call super for the remaining logic + length += ConstantMultiFieldModifier::apply(output, leftIndex, rightIndex + length, status); + return length; +} + +int32_t +CurrencySpacingEnabledModifier::applyCurrencySpacing(NumberStringBuilder &output, int32_t prefixStart, + int32_t prefixLen, int32_t suffixStart, + int32_t suffixLen, + const DecimalFormatSymbols &symbols, + UErrorCode &status) { + int length = 0; + bool hasPrefix = (prefixLen > 0); + bool hasSuffix = (suffixLen > 0); + bool hasNumber = (suffixStart - prefixStart - prefixLen > 0); // could be empty string + if (hasPrefix && hasNumber) { + length += applyCurrencySpacingAffix(output, prefixStart + prefixLen, PREFIX, symbols, status); + } + if (hasSuffix && hasNumber) { + length += applyCurrencySpacingAffix(output, suffixStart + length, SUFFIX, symbols, status); + } + return length; +} + +int32_t +CurrencySpacingEnabledModifier::applyCurrencySpacingAffix(NumberStringBuilder &output, int32_t index, + EAffix affix, + const DecimalFormatSymbols &symbols, + UErrorCode &status) { + // NOTE: For prefix, output.fieldAt(index-1) gets the last field type in the prefix. + // This works even if the last code point in the prefix is 2 code units because the + // field value gets populated to both indices in the field array. + Field affixField = (affix == PREFIX) ? output.fieldAt(index - 1) : output.fieldAt(index); + if (affixField != UNUM_CURRENCY_FIELD) { + return 0; + } + int affixCp = (affix == PREFIX) ? output.codePointBefore(index) : output.codePointAt(index); + UnicodeSet affixUniset = getUnicodeSet(symbols, IN_CURRENCY, affix, status); + if (!affixUniset.contains(affixCp)) { + return 0; + } + int numberCp = (affix == PREFIX) ? output.codePointAt(index) : output.codePointBefore(index); + UnicodeSet numberUniset = getUnicodeSet(symbols, IN_NUMBER, affix, status); + if (!numberUniset.contains(numberCp)) { + return 0; + } + UnicodeString spacingString = getInsertString(symbols, affix, status); + + // NOTE: This next line *inserts* the spacing string, triggering an arraycopy. + // It would be more efficient if this could be done before affixes were attached, + // so that it could be prepended/appended instead of inserted. + // However, the build code path is more efficient, and this is the most natural + // place to put currency spacing in the non-build code path. + // TODO: Should we use the CURRENCY field here? + return output.insert(index, spacingString, UNUM_FIELD_COUNT, status); +} + +UnicodeSet +CurrencySpacingEnabledModifier::getUnicodeSet(const DecimalFormatSymbols &symbols, EPosition position, + EAffix affix, UErrorCode &status) { + // Ensure the static defaults are initialized: + umtx_initOnce(gDefaultCurrencySpacingInitOnce, &initDefaultCurrencySpacing, status); + if (U_FAILURE(status)) { + return UnicodeSet(); + } + + const UnicodeString& pattern = symbols.getPatternForCurrencySpacing( + position == IN_CURRENCY ? UNUM_CURRENCY_MATCH : UNUM_CURRENCY_SURROUNDING_MATCH, + affix == SUFFIX, + status); + if (pattern.compare(u"[:digit:]", -1) == 0) { + return *UNISET_DIGIT; + } else if (pattern.compare(u"[:^S:]", -1) == 0) { + return *UNISET_NOTS; + } else { + return UnicodeSet(pattern, status); + } +} + +UnicodeString +CurrencySpacingEnabledModifier::getInsertString(const DecimalFormatSymbols &symbols, EAffix affix, + UErrorCode &status) { + return symbols.getPatternForCurrencySpacing(UNUM_CURRENCY_INSERT, affix == SUFFIX, status); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_modifiers.h b/deps/icu-small/source/i18n/number_modifiers.h new file mode 100644 index 00000000000000..1607ed06af59cc --- /dev/null +++ b/deps/icu-small/source/i18n/number_modifiers.h @@ -0,0 +1,258 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_MODIFIERS_H__ +#define __NUMBER_MODIFIERS_H__ + +#include +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "unicode/uniset.h" +#include "unicode/simpleformatter.h" +#include "standardplural.h" +#include "number_stringbuilder.h" +#include "number_types.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +/** + * The canonical implementation of {@link Modifier}, containing a prefix and suffix string. + * TODO: This is not currently being used by real code and could be removed. + */ +class U_I18N_API ConstantAffixModifier : public Modifier, public UObject { + public: + ConstantAffixModifier(const UnicodeString &prefix, const UnicodeString &suffix, Field field, + bool strong) + : fPrefix(prefix), fSuffix(suffix), fField(field), fStrong(strong) {} + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE; + + int32_t getPrefixLength(UErrorCode &status) const U_OVERRIDE; + + int32_t getCodePointCount(UErrorCode &status) const U_OVERRIDE; + + bool isStrong() const U_OVERRIDE; + + private: + UnicodeString fPrefix; + UnicodeString fSuffix; + Field fField; + bool fStrong; +}; + +/** + * The second primary implementation of {@link Modifier}, this one consuming a {@link SimpleFormatter} + * pattern. + */ +class U_I18N_API SimpleModifier : public Modifier, public UMemory { + public: + SimpleModifier(const SimpleFormatter &simpleFormatter, Field field, bool strong); + + // Default constructor for LongNameHandler.h + SimpleModifier(); + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE; + + int32_t getPrefixLength(UErrorCode &status) const U_OVERRIDE; + + int32_t getCodePointCount(UErrorCode &status) const U_OVERRIDE; + + bool isStrong() const U_OVERRIDE; + + /** + * TODO: This belongs in SimpleFormatterImpl. The only reason I haven't moved it there yet is because + * DoubleSidedStringBuilder is an internal class and SimpleFormatterImpl feels like it should not depend on it. + * + *

+ * Formats a value that is already stored inside the StringBuilder result between the indices + * startIndex and endIndex by inserting characters before the start index and after the + * end index. + * + *

+ * This is well-defined only for patterns with exactly one argument. + * + * @param result + * The StringBuilder containing the value argument. + * @param startIndex + * The left index of the value within the string builder. + * @param endIndex + * The right index of the value within the string builder. + * @return The number of characters (UTF-16 code points) that were added to the StringBuilder. + */ + int32_t + formatAsPrefixSuffix(NumberStringBuilder &result, int32_t startIndex, int32_t endIndex, Field field, + UErrorCode &status) const; + + private: + UnicodeString fCompiledPattern; + Field fField; + bool fStrong; + int32_t fPrefixLength; + int32_t fSuffixOffset; + int32_t fSuffixLength; +}; + +/** + * An implementation of {@link Modifier} that allows for multiple types of fields in the same modifier. Constructed + * based on the contents of two {@link NumberStringBuilder} instances (one for the prefix, one for the suffix). + */ +class U_I18N_API ConstantMultiFieldModifier : public Modifier, public UMemory { + public: + ConstantMultiFieldModifier(const NumberStringBuilder &prefix, const NumberStringBuilder &suffix, + bool strong) : fPrefix(prefix), fSuffix(suffix), fStrong(strong) {} + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE; + + int32_t getPrefixLength(UErrorCode &status) const U_OVERRIDE; + + int32_t getCodePointCount(UErrorCode &status) const U_OVERRIDE; + + bool isStrong() const U_OVERRIDE; + + protected: + // NOTE: In Java, these are stored as array pointers. In C++, the NumberStringBuilder is stored by + // value and is treated internally as immutable. + NumberStringBuilder fPrefix; + NumberStringBuilder fSuffix; + bool fStrong; +}; + +/** Identical to {@link ConstantMultiFieldModifier}, but supports currency spacing. */ +class U_I18N_API CurrencySpacingEnabledModifier : public ConstantMultiFieldModifier { + public: + /** Safe code path */ + CurrencySpacingEnabledModifier(const NumberStringBuilder &prefix, const NumberStringBuilder &suffix, + bool strong, const DecimalFormatSymbols &symbols, UErrorCode &status); + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE; + + /** Unsafe code path */ + static int32_t + applyCurrencySpacing(NumberStringBuilder &output, int32_t prefixStart, int32_t prefixLen, + int32_t suffixStart, int32_t suffixLen, const DecimalFormatSymbols &symbols, + UErrorCode &status); + + private: + UnicodeSet fAfterPrefixUnicodeSet; + UnicodeString fAfterPrefixInsert; + UnicodeSet fBeforeSuffixUnicodeSet; + UnicodeString fBeforeSuffixInsert; + + enum EAffix { + PREFIX, SUFFIX + }; + + enum EPosition { + IN_CURRENCY, IN_NUMBER + }; + + /** Unsafe code path */ + static int32_t applyCurrencySpacingAffix(NumberStringBuilder &output, int32_t index, EAffix affix, + const DecimalFormatSymbols &symbols, UErrorCode &status); + + static UnicodeSet + getUnicodeSet(const DecimalFormatSymbols &symbols, EPosition position, EAffix affix, + UErrorCode &status); + + static UnicodeString + getInsertString(const DecimalFormatSymbols &symbols, EAffix affix, UErrorCode &status); +}; + +/** A Modifier that does not do anything. */ +class U_I18N_API EmptyModifier : public Modifier, public UMemory { + public: + explicit EmptyModifier(bool isStrong) : fStrong(isStrong) {} + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE { + (void)output; + (void)leftIndex; + (void)rightIndex; + (void)status; + return 0; + } + + int32_t getPrefixLength(UErrorCode &status) const U_OVERRIDE { + (void)status; + return 0; + } + + int32_t getCodePointCount(UErrorCode &status) const U_OVERRIDE { + (void)status; + return 0; + } + + bool isStrong() const U_OVERRIDE { + return fStrong; + } + + private: + bool fStrong; +}; + +/** + * A ParameterizedModifier by itself is NOT a Modifier. Rather, it wraps a data structure containing two or more + * Modifiers and returns the modifier appropriate for the current situation. + */ +class U_I18N_API ParameterizedModifier : public UMemory { + public: + // NOTE: mods is zero-initialized (to nullptr) + ParameterizedModifier() : mods() { + } + + // No copying! + ParameterizedModifier(const ParameterizedModifier &other) = delete; + + ~ParameterizedModifier() { + for (const Modifier *mod : mods) { + delete mod; + } + } + + void adoptPositiveNegativeModifiers(const Modifier *positive, const Modifier *negative) { + mods[0] = positive; + mods[1] = negative; + } + + /** The modifier is ADOPTED. */ + void adoptSignPluralModifier(bool isNegative, StandardPlural::Form plural, const Modifier *mod) { + mods[getModIndex(isNegative, plural)] = mod; + } + + /** Returns a reference to the modifier; no ownership change. */ + const Modifier *getModifier(bool isNegative) const { + return mods[isNegative ? 1 : 0]; + } + + /** Returns a reference to the modifier; no ownership change. */ + const Modifier *getModifier(bool isNegative, StandardPlural::Form plural) const { + return mods[getModIndex(isNegative, plural)]; + } + + private: + const Modifier *mods[2 * StandardPlural::COUNT]; + + inline static int32_t getModIndex(bool isNegative, StandardPlural::Form plural) { + return static_cast(plural) * 2 + (isNegative ? 1 : 0); + } +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_MODIFIERS_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_notation.cpp b/deps/icu-small/source/i18n/number_notation.cpp new file mode 100644 index 00000000000000..ff0cd9505de299 --- /dev/null +++ b/deps/icu-small/source/i18n/number_notation.cpp @@ -0,0 +1,75 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "unicode/numberformatter.h" +#include "number_types.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + + +ScientificNotation Notation::scientific() { + // NOTE: ISO C++ does not allow C99 designated initializers. + ScientificSettings settings; + settings.fEngineeringInterval = 1; + settings.fRequireMinInt = false; + settings.fMinExponentDigits = 1; + settings.fExponentSignDisplay = UNUM_SIGN_AUTO; + NotationUnion union_; + union_.scientific = settings; + return {NTN_SCIENTIFIC, union_}; +} + +ScientificNotation Notation::engineering() { + ScientificSettings settings; + settings.fEngineeringInterval = 3; + settings.fRequireMinInt = false; + settings.fMinExponentDigits = 1; + settings.fExponentSignDisplay = UNUM_SIGN_AUTO; + NotationUnion union_; + union_.scientific = settings; + return {NTN_SCIENTIFIC, union_}; +} + +Notation Notation::compactShort() { + NotationUnion union_; + union_.compactStyle = CompactStyle::UNUM_SHORT; + return {NTN_COMPACT, union_}; +} + +Notation Notation::compactLong() { + NotationUnion union_; + union_.compactStyle = CompactStyle::UNUM_LONG; + return {NTN_COMPACT, union_}; +} + +Notation Notation::simple() { + return {}; +} + +ScientificNotation +ScientificNotation::withMinExponentDigits(int32_t minExponentDigits) const { + if (minExponentDigits >= 0 && minExponentDigits < kMaxIntFracSig) { + ScientificSettings settings = fUnion.scientific; + settings.fMinExponentDigits = (int8_t) minExponentDigits; + NotationUnion union_ = {settings}; + return {NTN_SCIENTIFIC, union_}; + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +ScientificNotation +ScientificNotation::withExponentSignDisplay(UNumberSignDisplay exponentSignDisplay) const { + ScientificSettings settings = fUnion.scientific; + settings.fExponentSignDisplay = exponentSignDisplay; + NotationUnion union_ = {settings}; + return {NTN_SCIENTIFIC, union_}; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_padding.cpp b/deps/icu-small/source/i18n/number_padding.cpp new file mode 100644 index 00000000000000..a478af60541dde --- /dev/null +++ b/deps/icu-small/source/i18n/number_padding.cpp @@ -0,0 +1,84 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "unicode/numberformatter.h" +#include "number_types.h" +#include "number_stringbuilder.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + +int32_t +addPaddingHelper(UChar32 paddingCp, int32_t requiredPadding, NumberStringBuilder &string, int32_t index, + UErrorCode &status) { + for (int32_t i = 0; i < requiredPadding; i++) { + // TODO: If appending to the end, this will cause actual insertion operations. Improve. + string.insertCodePoint(index, paddingCp, UNUM_FIELD_COUNT, status); + } + return U16_LENGTH(paddingCp) * requiredPadding; +} + +} + +Padder::Padder(UChar32 cp, int32_t width, UNumberFormatPadPosition position) : fWidth(width) { + fUnion.padding.fCp = cp; + fUnion.padding.fPosition = position; +} + +Padder::Padder(int32_t width) : fWidth(width) {} + +Padder Padder::none() { + return {-1}; +} + +Padder Padder::codePoints(UChar32 cp, int32_t targetWidth, UNumberFormatPadPosition position) { + // TODO: Validate the code point? + if (targetWidth >= 0) { + return {cp, targetWidth, position}; + } else { + return {U_NUMBER_PADDING_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +int32_t Padder::padAndApply(const Modifier &mod1, const Modifier &mod2, + NumberStringBuilder &string, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const { + int32_t modLength = mod1.getCodePointCount(status) + mod2.getCodePointCount(status); + int32_t requiredPadding = fWidth - modLength - string.codePointCount(); + U_ASSERT(leftIndex == 0 && + rightIndex == string.length()); // fix the previous line to remove this assertion + + int length = 0; + if (requiredPadding <= 0) { + // Padding is not required. + length += mod1.apply(string, leftIndex, rightIndex, status); + length += mod2.apply(string, leftIndex, rightIndex + length, status); + return length; + } + + PadPosition position = fUnion.padding.fPosition; + UChar32 paddingCp = fUnion.padding.fCp; + if (position == UNUM_PAD_AFTER_PREFIX) { + length += addPaddingHelper(paddingCp, requiredPadding, string, leftIndex, status); + } else if (position == UNUM_PAD_BEFORE_SUFFIX) { + length += addPaddingHelper(paddingCp, requiredPadding, string, rightIndex + length, status); + } + length += mod1.apply(string, leftIndex, rightIndex + length, status); + length += mod2.apply(string, leftIndex, rightIndex + length, status); + if (position == UNUM_PAD_BEFORE_PREFIX) { + length += addPaddingHelper(paddingCp, requiredPadding, string, leftIndex, status); + } else if (position == UNUM_PAD_AFTER_SUFFIX) { + length += addPaddingHelper(paddingCp, requiredPadding, string, rightIndex + length, status); + } + + return length; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_patternmodifier.cpp b/deps/icu-small/source/i18n/number_patternmodifier.cpp new file mode 100644 index 00000000000000..0599f92a4f343b --- /dev/null +++ b/deps/icu-small/source/i18n/number_patternmodifier.cpp @@ -0,0 +1,351 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "cstring.h" +#include "number_patternmodifier.h" +#include "unicode/dcfmtsym.h" +#include "unicode/ucurr.h" +#include "unicode/unistr.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +MutablePatternModifier::MutablePatternModifier(bool isStrong) : fStrong(isStrong) {} + +void MutablePatternModifier::setPatternInfo(const AffixPatternProvider *patternInfo) { + this->patternInfo = patternInfo; +} + +void MutablePatternModifier::setPatternAttributes(UNumberSignDisplay signDisplay, bool perMille) { + this->signDisplay = signDisplay; + this->perMilleReplacesPercent = perMille; +} + +void +MutablePatternModifier::setSymbols(const DecimalFormatSymbols *symbols, const CurrencyUnit ¤cy, + const UNumberUnitWidth unitWidth, const PluralRules *rules) { + U_ASSERT((rules != nullptr) == needsPlurals()); + this->symbols = symbols; + uprv_memcpy(static_cast(this->currencyCode), + currency.getISOCurrency(), + sizeof(char16_t) * 4); + this->unitWidth = unitWidth; + this->rules = rules; +} + +void MutablePatternModifier::setNumberProperties(bool isNegative, StandardPlural::Form plural) { + this->isNegative = isNegative; + this->plural = plural; +} + +bool MutablePatternModifier::needsPlurals() const { + UErrorCode statusLocal = U_ZERO_ERROR; + return patternInfo->containsSymbolType(AffixPatternType::TYPE_CURRENCY_TRIPLE, statusLocal); + // Silently ignore any error codes. +} + +ImmutablePatternModifier *MutablePatternModifier::createImmutable(UErrorCode &status) { + return createImmutableAndChain(nullptr, status); +} + +ImmutablePatternModifier * +MutablePatternModifier::createImmutableAndChain(const MicroPropsGenerator *parent, UErrorCode &status) { + + // TODO: Move StandardPlural VALUES to standardplural.h + static const StandardPlural::Form STANDARD_PLURAL_VALUES[] = { + StandardPlural::Form::ZERO, + StandardPlural::Form::ONE, + StandardPlural::Form::TWO, + StandardPlural::Form::FEW, + StandardPlural::Form::MANY, + StandardPlural::Form::OTHER}; + + auto pm = new ParameterizedModifier(); + if (pm == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return nullptr; + } + + if (needsPlurals()) { + // Slower path when we require the plural keyword. + for (StandardPlural::Form plural : STANDARD_PLURAL_VALUES) { + setNumberProperties(false, plural); + pm->adoptSignPluralModifier(false, plural, createConstantModifier(status)); + setNumberProperties(true, plural); + pm->adoptSignPluralModifier(true, plural, createConstantModifier(status)); + } + if (U_FAILURE(status)) { + delete pm; + return nullptr; + } + return new ImmutablePatternModifier(pm, rules, parent); // adopts pm + } else { + // Faster path when plural keyword is not needed. + setNumberProperties(false, StandardPlural::Form::COUNT); + Modifier *positive = createConstantModifier(status); + setNumberProperties(true, StandardPlural::Form::COUNT); + Modifier *negative = createConstantModifier(status); + pm->adoptPositiveNegativeModifiers(positive, negative); + if (U_FAILURE(status)) { + delete pm; + return nullptr; + } + return new ImmutablePatternModifier(pm, nullptr, parent); // adopts pm + } +} + +ConstantMultiFieldModifier *MutablePatternModifier::createConstantModifier(UErrorCode &status) { + NumberStringBuilder a; + NumberStringBuilder b; + insertPrefix(a, 0, status); + insertSuffix(b, 0, status); + if (patternInfo->hasCurrencySign()) { + return new CurrencySpacingEnabledModifier(a, b, fStrong, *symbols, status); + } else { + return new ConstantMultiFieldModifier(a, b, fStrong); + } +} + +ImmutablePatternModifier::ImmutablePatternModifier(ParameterizedModifier *pm, const PluralRules *rules, + const MicroPropsGenerator *parent) + : pm(pm), rules(rules), parent(parent) {} + +void ImmutablePatternModifier::processQuantity(DecimalQuantity &quantity, MicroProps µs, + UErrorCode &status) const { + parent->processQuantity(quantity, micros, status); + applyToMicros(micros, quantity); +} + +void ImmutablePatternModifier::applyToMicros(MicroProps µs, DecimalQuantity &quantity) const { + if (rules == nullptr) { + micros.modMiddle = pm->getModifier(quantity.isNegative()); + } else { + // TODO: Fix this. Avoid the copy. + DecimalQuantity copy(quantity); + copy.roundToInfinity(); + StandardPlural::Form plural = copy.getStandardPlural(rules); + micros.modMiddle = pm->getModifier(quantity.isNegative(), plural); + } +} + +/** Used by the unsafe code path. */ +MicroPropsGenerator &MutablePatternModifier::addToChain(const MicroPropsGenerator *parent) { + this->parent = parent; + return *this; +} + +void MutablePatternModifier::processQuantity(DecimalQuantity &fq, MicroProps µs, + UErrorCode &status) const { + parent->processQuantity(fq, micros, status); + // The unsafe code path performs self-mutation, so we need a const_cast. + // This method needs to be const because it overrides a const method in the parent class. + auto nonConstThis = const_cast(this); + if (needsPlurals()) { + // TODO: Fix this. Avoid the copy. + DecimalQuantity copy(fq); + micros.rounding.apply(copy, status); + nonConstThis->setNumberProperties(fq.isNegative(), copy.getStandardPlural(rules)); + } else { + nonConstThis->setNumberProperties(fq.isNegative(), StandardPlural::Form::COUNT); + } + micros.modMiddle = this; +} + +int32_t MutablePatternModifier::apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const { + // The unsafe code path performs self-mutation, so we need a const_cast. + // This method needs to be const because it overrides a const method in the parent class. + auto nonConstThis = const_cast(this); + int32_t prefixLen = nonConstThis->insertPrefix(output, leftIndex, status); + int32_t suffixLen = nonConstThis->insertSuffix(output, rightIndex + prefixLen, status); + CurrencySpacingEnabledModifier::applyCurrencySpacing( + output, leftIndex, prefixLen, rightIndex + prefixLen, suffixLen, *symbols, status); + return prefixLen + suffixLen; +} + +int32_t MutablePatternModifier::getPrefixLength(UErrorCode &status) const { + // The unsafe code path performs self-mutation, so we need a const_cast. + // This method needs to be const because it overrides a const method in the parent class. + auto nonConstThis = const_cast(this); + + // Enter and exit CharSequence Mode to get the length. + nonConstThis->enterCharSequenceMode(true); + int result = AffixUtils::unescapedCodePointCount(*this, *this, status); // prefix length + nonConstThis->exitCharSequenceMode(); + return result; +} + +int32_t MutablePatternModifier::getCodePointCount(UErrorCode &status) const { + // The unsafe code path performs self-mutation, so we need a const_cast. + // This method needs to be const because it overrides a const method in the parent class. + auto nonConstThis = const_cast(this); + + // Enter and exit CharSequence Mode to get the length. + nonConstThis->enterCharSequenceMode(true); + int result = AffixUtils::unescapedCodePointCount(*this, *this, status); // prefix length + nonConstThis->exitCharSequenceMode(); + nonConstThis->enterCharSequenceMode(false); + result += AffixUtils::unescapedCodePointCount(*this, *this, status); // suffix length + nonConstThis->exitCharSequenceMode(); + return result; +} + +bool MutablePatternModifier::isStrong() const { + return fStrong; +} + +int32_t MutablePatternModifier::insertPrefix(NumberStringBuilder &sb, int position, UErrorCode &status) { + enterCharSequenceMode(true); + int length = AffixUtils::unescape(*this, sb, position, *this, status); + exitCharSequenceMode(); + return length; +} + +int32_t MutablePatternModifier::insertSuffix(NumberStringBuilder &sb, int position, UErrorCode &status) { + enterCharSequenceMode(false); + int length = AffixUtils::unescape(*this, sb, position, *this, status); + exitCharSequenceMode(); + return length; +} + +UnicodeString MutablePatternModifier::getSymbol(AffixPatternType type) const { + switch (type) { + case AffixPatternType::TYPE_MINUS_SIGN: + return symbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kMinusSignSymbol); + case AffixPatternType::TYPE_PLUS_SIGN: + return symbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kPlusSignSymbol); + case AffixPatternType::TYPE_PERCENT: + return symbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kPercentSymbol); + case AffixPatternType::TYPE_PERMILLE: + return symbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kPerMillSymbol); + case AffixPatternType::TYPE_CURRENCY_SINGLE: { + // UnitWidth ISO and HIDDEN overrides the singular currency symbol. + if (unitWidth == UNumberUnitWidth::UNUM_UNIT_WIDTH_ISO_CODE) { + return UnicodeString(currencyCode, 3); + } else if (unitWidth == UNumberUnitWidth::UNUM_UNIT_WIDTH_HIDDEN) { + return UnicodeString(); + } else { + UErrorCode status = U_ZERO_ERROR; + UBool isChoiceFormat = FALSE; + int32_t symbolLen = 0; + const char16_t *symbol = ucurr_getName( + currencyCode, + symbols->getLocale().getName(), + UCurrNameStyle::UCURR_SYMBOL_NAME, + &isChoiceFormat, + &symbolLen, + &status); + return UnicodeString(symbol, symbolLen); + } + } + case AffixPatternType::TYPE_CURRENCY_DOUBLE: + return UnicodeString(currencyCode, 3); + case AffixPatternType::TYPE_CURRENCY_TRIPLE: { + // NOTE: This is the code path only for patterns containing "¤¤¤". + // Plural currencies set via the API are formatted in LongNameHandler. + // This code path is used by DecimalFormat via CurrencyPluralInfo. + U_ASSERT(plural != StandardPlural::Form::COUNT); + UErrorCode status = U_ZERO_ERROR; + UBool isChoiceFormat = FALSE; + int32_t symbolLen = 0; + const char16_t *symbol = ucurr_getPluralName( + currencyCode, + symbols->getLocale().getName(), + &isChoiceFormat, + StandardPlural::getKeyword(plural), + &symbolLen, + &status); + return UnicodeString(symbol, symbolLen); + } + case AffixPatternType::TYPE_CURRENCY_QUAD: + return UnicodeString(u"\uFFFD"); + case AffixPatternType::TYPE_CURRENCY_QUINT: + return UnicodeString(u"\uFFFD"); + default: + U_ASSERT(false); + return UnicodeString(); + } +} + +/** This method contains the heart of the logic for rendering LDML affix strings. */ +void MutablePatternModifier::enterCharSequenceMode(bool isPrefix) { + U_ASSERT(!inCharSequenceMode); + inCharSequenceMode = true; + + // Should the output render '+' where '-' would normally appear in the pattern? + plusReplacesMinusSign = !isNegative && ( + signDisplay == UNUM_SIGN_ALWAYS || + signDisplay == UNUM_SIGN_ACCOUNTING_ALWAYS) && + patternInfo->positiveHasPlusSign() == false; + + // Should we use the affix from the negative subpattern? (If not, we will use the positive subpattern.) + bool useNegativeAffixPattern = patternInfo->hasNegativeSubpattern() && ( + isNegative || (patternInfo->negativeHasMinusSign() && plusReplacesMinusSign)); + + // Resolve the flags for the affix pattern. + fFlags = 0; + if (useNegativeAffixPattern) { + fFlags |= AffixPatternProvider::AFFIX_NEGATIVE_SUBPATTERN; + } + if (isPrefix) { + fFlags |= AffixPatternProvider::AFFIX_PREFIX; + } + if (plural != StandardPlural::Form::COUNT) { + U_ASSERT(plural == (AffixPatternProvider::AFFIX_PLURAL_MASK & plural)); + fFlags |= plural; + } + + // Should we prepend a sign to the pattern? + if (!isPrefix || useNegativeAffixPattern) { + prependSign = false; + } else if (isNegative) { + prependSign = signDisplay != UNUM_SIGN_NEVER; + } else { + prependSign = plusReplacesMinusSign; + } + + // Finally, compute the length of the affix pattern. + fLength = patternInfo->length(fFlags) + (prependSign ? 1 : 0); +} + +void MutablePatternModifier::exitCharSequenceMode() { + U_ASSERT(inCharSequenceMode); + inCharSequenceMode = false; +} + +int32_t MutablePatternModifier::length() const { + U_ASSERT(inCharSequenceMode); + return fLength; +} + +char16_t MutablePatternModifier::charAt(int32_t index) const { + U_ASSERT(inCharSequenceMode); + char16_t candidate; + if (prependSign && index == 0) { + candidate = u'-'; + } else if (prependSign) { + candidate = patternInfo->charAt(fFlags, index - 1); + } else { + candidate = patternInfo->charAt(fFlags, index); + } + if (plusReplacesMinusSign && candidate == u'-') { + return u'+'; + } + if (perMilleReplacesPercent && candidate == u'%') { + return u'‰'; + } + return candidate; +} + +UnicodeString MutablePatternModifier::toUnicodeString() const { + // Never called by AffixUtils + U_ASSERT(false); + return UnicodeString(); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_patternmodifier.h b/deps/icu-small/source/i18n/number_patternmodifier.h new file mode 100644 index 00000000000000..705037f0ba7173 --- /dev/null +++ b/deps/icu-small/source/i18n/number_patternmodifier.h @@ -0,0 +1,259 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_PATTERNMODIFIER_H__ +#define __NUMBER_PATTERNMODIFIER_H__ + +#include "standardplural.h" +#include "unicode/numberformatter.h" +#include "number_patternstring.h" +#include "number_types.h" +#include "number_modifiers.h" +#include "number_utils.h" + +U_NAMESPACE_BEGIN + +// Export an explicit template instantiation of the LocalPointer that is used as a +// data member of ParameterizedModifier. +// (MSVC requires this, even though it should not be necessary.) +#if defined (_MSC_VER) +// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!= +#pragma warning(suppress: 4661) +template class U_I18N_API LocalPointerBase; +template class U_I18N_API LocalPointer; +#endif + +namespace number { +namespace impl { + +// Forward declaration +class MutablePatternModifier; + +// Exported as U_I18N_API because it is needed for the unit test PatternModifierTest +class U_I18N_API ImmutablePatternModifier : public MicroPropsGenerator, public UMemory { + public: + ~ImmutablePatternModifier() U_OVERRIDE = default; + + void processQuantity(DecimalQuantity &, MicroProps µs, UErrorCode &status) const U_OVERRIDE; + + void applyToMicros(MicroProps µs, DecimalQuantity &quantity) const; + + private: + ImmutablePatternModifier(ParameterizedModifier *pm, const PluralRules *rules, const MicroPropsGenerator *parent); + + const LocalPointer pm; + const PluralRules *rules; + const MicroPropsGenerator *parent; + + friend class MutablePatternModifier; +}; + +/** + * This class is a {@link Modifier} that wraps a decimal format pattern. It applies the pattern's affixes in + * {@link Modifier#apply}. + * + *

+ * In addition to being a Modifier, this class contains the business logic for substituting the correct locale symbols + * into the affixes of the decimal format pattern. + * + *

+ * In order to use this class, create a new instance and call the following four setters: {@link #setPatternInfo}, + * {@link #setPatternAttributes}, {@link #setSymbols}, and {@link #setNumberProperties}. After calling these four + * setters, the instance will be ready for use as a Modifier. + * + *

+ * This is a MUTABLE, NON-THREAD-SAFE class designed for performance. Do NOT save references to this or attempt to use + * it from multiple threads! Instead, you can obtain a safe, immutable decimal format pattern modifier by calling + * {@link MutablePatternModifier#createImmutable}, in effect treating this instance as a builder for the immutable + * variant. + */ +class U_I18N_API MutablePatternModifier + : public MicroPropsGenerator, + public Modifier, + public SymbolProvider, + public CharSequence, + public UMemory { + public: + + ~MutablePatternModifier() U_OVERRIDE = default; + + /** + * @param isStrong + * Whether the modifier should be considered strong. For more information, see + * {@link Modifier#isStrong()}. Most of the time, decimal format pattern modifiers should be considered + * as non-strong. + */ + explicit MutablePatternModifier(bool isStrong); + + /** + * Sets a reference to the parsed decimal format pattern, usually obtained from + * {@link PatternStringParser#parseToPatternInfo(String)}, but any implementation of {@link AffixPatternProvider} is + * accepted. + */ + void setPatternInfo(const AffixPatternProvider *patternInfo); + + /** + * Sets attributes that imply changes to the literal interpretation of the pattern string affixes. + * + * @param signDisplay + * Whether to force a plus sign on positive numbers. + * @param perMille + * Whether to substitute the percent sign in the pattern with a permille sign. + */ + void setPatternAttributes(UNumberSignDisplay signDisplay, bool perMille); + + /** + * Sets locale-specific details that affect the symbols substituted into the pattern string affixes. + * + * @param symbols + * The desired instance of DecimalFormatSymbols. + * @param currency + * The currency to be used when substituting currency values into the affixes. + * @param unitWidth + * The width used to render currencies. + * @param rules + * Required if the triple currency sign, "¤¤¤", appears in the pattern, which can be determined from the + * convenience method {@link #needsPlurals()}. + */ + void + setSymbols(const DecimalFormatSymbols *symbols, const CurrencyUnit ¤cy, UNumberUnitWidth unitWidth, + const PluralRules *rules); + + /** + * Sets attributes of the current number being processed. + * + * @param isNegative + * Whether the number is negative. + * @param plural + * The plural form of the number, required only if the pattern contains the triple currency sign, "¤¤¤" + * (and as indicated by {@link #needsPlurals()}). + */ + void setNumberProperties(bool isNegative, StandardPlural::Form plural); + + /** + * Returns true if the pattern represented by this MurkyModifier requires a plural keyword in order to localize. + * This is currently true only if there is a currency long name placeholder in the pattern ("¤¤¤"). + */ + bool needsPlurals() const; + + /** + * Creates a new quantity-dependent Modifier that behaves the same as the current instance, but which is immutable + * and can be saved for future use. The number properties in the current instance are mutated; all other properties + * are left untouched. + * + *

+ * The resulting modifier cannot be used in a QuantityChain. + * + *

+ * CREATES A NEW HEAP OBJECT; THE CALLER GETS OWNERSHIP. + * + * @return An immutable that supports both positive and negative numbers. + */ + ImmutablePatternModifier *createImmutable(UErrorCode &status); + + /** + * Creates a new quantity-dependent Modifier that behaves the same as the current instance, but which is immutable + * and can be saved for future use. The number properties in the current instance are mutated; all other properties + * are left untouched. + * + *

+ * CREATES A NEW HEAP OBJECT; THE CALLER GETS OWNERSHIP. + * + * @param parent + * The QuantityChain to which to chain this immutable. + * @return An immutable that supports both positive and negative numbers. + */ + ImmutablePatternModifier * + createImmutableAndChain(const MicroPropsGenerator *parent, UErrorCode &status); + + MicroPropsGenerator &addToChain(const MicroPropsGenerator *parent); + + void processQuantity(DecimalQuantity &, MicroProps µs, UErrorCode &status) const U_OVERRIDE; + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE; + + int32_t getPrefixLength(UErrorCode &status) const U_OVERRIDE; + + int32_t getCodePointCount(UErrorCode &status) const U_OVERRIDE; + + bool isStrong() const U_OVERRIDE; + + /** + * Returns the string that substitutes a given symbol type in a pattern. + */ + UnicodeString getSymbol(AffixPatternType type) const U_OVERRIDE; + + int32_t length() const U_OVERRIDE; + + char16_t charAt(int32_t index) const U_OVERRIDE; + + // Use default implementation of codePointAt + + UnicodeString toUnicodeString() const U_OVERRIDE; + + private: + // Modifier details (initialized in constructor) + const bool fStrong; + + // Pattern details (initialized in setPatternInfo and setPatternAttributes) + const AffixPatternProvider *patternInfo; + UNumberSignDisplay signDisplay; + bool perMilleReplacesPercent; + + // Symbol details (initialized in setSymbols) + const DecimalFormatSymbols *symbols; + UNumberUnitWidth unitWidth; + char16_t currencyCode[4]; + const PluralRules *rules; + + // Number details (initialized in setNumberProperties) + bool isNegative; + StandardPlural::Form plural; + + // QuantityChain details (initialized in addToChain) + const MicroPropsGenerator *parent; + + // Transient CharSequence fields (initialized in enterCharSequenceMode) + bool inCharSequenceMode = false; + int32_t fFlags; + int32_t fLength; + bool prependSign; + bool plusReplacesMinusSign; + + /** + * Uses the current properties to create a single {@link ConstantMultiFieldModifier} with currency spacing support + * if required. + * + *

+ * CREATES A NEW HEAP OBJECT; THE CALLER GETS OWNERSHIP. + * + * @param a + * A working NumberStringBuilder object; passed from the outside to prevent the need to create many new + * instances if this method is called in a loop. + * @param b + * Another working NumberStringBuilder object. + * @return The constant modifier object. + */ + ConstantMultiFieldModifier *createConstantModifier(UErrorCode &status); + + int32_t insertPrefix(NumberStringBuilder &sb, int position, UErrorCode &status); + + int32_t insertSuffix(NumberStringBuilder &sb, int position, UErrorCode &status); + + void enterCharSequenceMode(bool isPrefix); + + void exitCharSequenceMode(); +}; + + +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_PATTERNMODIFIER_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_patternstring.cpp b/deps/icu-small/source/i18n/number_patternstring.cpp new file mode 100644 index 00000000000000..c67e3541816547 --- /dev/null +++ b/deps/icu-small/source/i18n/number_patternstring.cpp @@ -0,0 +1,839 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "uassert.h" +#include "number_patternstring.h" +#include "unicode/utf16.h" +#include "number_utils.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +void PatternParser::parseToPatternInfo(const UnicodeString& patternString, ParsedPatternInfo& patternInfo, UErrorCode &status) { + patternInfo.consumePattern(patternString, status); +} + +DecimalFormatProperties +PatternParser::parseToProperties(const UnicodeString& pattern, IgnoreRounding ignoreRounding, + UErrorCode &status) { + DecimalFormatProperties properties; + parseToExistingPropertiesImpl(pattern, properties, ignoreRounding, status); + return properties; +} + +void PatternParser::parseToExistingProperties(const UnicodeString& pattern, DecimalFormatProperties& properties, + IgnoreRounding ignoreRounding, UErrorCode &status) { + parseToExistingPropertiesImpl(pattern, properties, ignoreRounding, status); +} + +char16_t ParsedPatternInfo::charAt(int32_t flags, int32_t index) const { + const Endpoints &endpoints = getEndpoints(flags); + if (index < 0 || index >= endpoints.end - endpoints.start) { + U_ASSERT(false); + } + return pattern.charAt(endpoints.start + index); +} + +int32_t ParsedPatternInfo::length(int32_t flags) const { + return getLengthFromEndpoints(getEndpoints(flags)); +} + +int32_t ParsedPatternInfo::getLengthFromEndpoints(const Endpoints &endpoints) { + return endpoints.end - endpoints.start; +} + +UnicodeString ParsedPatternInfo::getString(int32_t flags) const { + const Endpoints &endpoints = getEndpoints(flags); + if (endpoints.start == endpoints.end) { + return UnicodeString(); + } + // Create a new UnicodeString + return UnicodeString(pattern, endpoints.start, endpoints.end - endpoints.start); +} + +const Endpoints &ParsedPatternInfo::getEndpoints(int32_t flags) const { + bool prefix = (flags & AFFIX_PREFIX) != 0; + bool isNegative = (flags & AFFIX_NEGATIVE_SUBPATTERN) != 0; + bool padding = (flags & AFFIX_PADDING) != 0; + if (isNegative && padding) { + return negative.paddingEndpoints; + } else if (padding) { + return positive.paddingEndpoints; + } else if (prefix && isNegative) { + return negative.prefixEndpoints; + } else if (prefix) { + return positive.prefixEndpoints; + } else if (isNegative) { + return negative.suffixEndpoints; + } else { + return positive.suffixEndpoints; + } +} + +bool ParsedPatternInfo::positiveHasPlusSign() const { + return positive.hasPlusSign; +} + +bool ParsedPatternInfo::hasNegativeSubpattern() const { + return fHasNegativeSubpattern; +} + +bool ParsedPatternInfo::negativeHasMinusSign() const { + return negative.hasMinusSign; +} + +bool ParsedPatternInfo::hasCurrencySign() const { + return positive.hasCurrencySign || (fHasNegativeSubpattern && negative.hasCurrencySign); +} + +bool ParsedPatternInfo::containsSymbolType(AffixPatternType type, UErrorCode &status) const { + return AffixUtils::containsType(UnicodeStringCharSequence(pattern), type, status); +} + +///////////////////////////////////////////////////// +/// BEGIN RECURSIVE DESCENT PARSER IMPLEMENTATION /// +///////////////////////////////////////////////////// + +UChar32 ParsedPatternInfo::ParserState::peek() { + if (offset == pattern.length()) { + return -1; + } else { + return pattern.char32At(offset); + } +} + +UChar32 ParsedPatternInfo::ParserState::next() { + int codePoint = peek(); + offset += U16_LENGTH(codePoint); + return codePoint; +} + +void ParsedPatternInfo::consumePattern(const UnicodeString& patternString, UErrorCode &status) { + if (U_FAILURE(status)) { return; } + this->pattern = patternString; + + // pattern := subpattern (';' subpattern)? + currentSubpattern = &positive; + consumeSubpattern(status); + if (U_FAILURE(status)) { return; } + if (state.peek() == u';') { + state.next(); // consume the ';' + // Don't consume the negative subpattern if it is empty (trailing ';') + if (state.peek() != -1) { + fHasNegativeSubpattern = true; + currentSubpattern = &negative; + consumeSubpattern(status); + if (U_FAILURE(status)) { return; } + } + } + if (state.peek() != -1) { + state.toParseException(u"Found unquoted special character"); + status = U_UNQUOTED_SPECIAL; + } +} + +void ParsedPatternInfo::consumeSubpattern(UErrorCode &status) { + // subpattern := literals? number exponent? literals? + consumePadding(PadPosition::UNUM_PAD_BEFORE_PREFIX, status); + if (U_FAILURE(status)) { return; } + consumeAffix(currentSubpattern->prefixEndpoints, status); + if (U_FAILURE(status)) { return; } + consumePadding(PadPosition::UNUM_PAD_AFTER_PREFIX, status); + if (U_FAILURE(status)) { return; } + consumeFormat(status); + if (U_FAILURE(status)) { return; } + consumeExponent(status); + if (U_FAILURE(status)) { return; } + consumePadding(PadPosition::UNUM_PAD_BEFORE_SUFFIX, status); + if (U_FAILURE(status)) { return; } + consumeAffix(currentSubpattern->suffixEndpoints, status); + if (U_FAILURE(status)) { return; } + consumePadding(PadPosition::UNUM_PAD_AFTER_SUFFIX, status); + if (U_FAILURE(status)) { return; } +} + +void ParsedPatternInfo::consumePadding(PadPosition paddingLocation, UErrorCode &status) { + if (state.peek() != u'*') { + return; + } + if (!currentSubpattern->paddingLocation.isNull()) { + state.toParseException(u"Cannot have multiple pad specifiers"); + status = U_MULTIPLE_PAD_SPECIFIERS; + return; + } + currentSubpattern->paddingLocation = paddingLocation; + state.next(); // consume the '*' + currentSubpattern->paddingEndpoints.start = state.offset; + consumeLiteral(status); + currentSubpattern->paddingEndpoints.end = state.offset; +} + +void ParsedPatternInfo::consumeAffix(Endpoints &endpoints, UErrorCode &status) { + // literals := { literal } + endpoints.start = state.offset; + while (true) { + switch (state.peek()) { + case u'#': + case u'@': + case u';': + case u'*': + case u'.': + case u',': + case u'0': + case u'1': + case u'2': + case u'3': + case u'4': + case u'5': + case u'6': + case u'7': + case u'8': + case u'9': + case -1: + // Characters that cannot appear unquoted in a literal + // break outer; + goto after_outer; + + case u'%': + currentSubpattern->hasPercentSign = true; + break; + + case u'‰': + currentSubpattern->hasPerMilleSign = true; + break; + + case u'¤': + currentSubpattern->hasCurrencySign = true; + break; + + case u'-': + currentSubpattern->hasMinusSign = true; + break; + + case u'+': + currentSubpattern->hasPlusSign = true; + break; + + default: + break; + } + consumeLiteral(status); + if (U_FAILURE(status)) { return; } + } + after_outer: + endpoints.end = state.offset; +} + +void ParsedPatternInfo::consumeLiteral(UErrorCode &status) { + if (state.peek() == -1) { + state.toParseException(u"Expected unquoted literal but found EOL"); + status = U_PATTERN_SYNTAX_ERROR; + return; + } else if (state.peek() == u'\'') { + state.next(); // consume the starting quote + while (state.peek() != u'\'') { + if (state.peek() == -1) { + state.toParseException(u"Expected quoted literal but found EOL"); + status = U_PATTERN_SYNTAX_ERROR; + return; + } else { + state.next(); // consume a quoted character + } + } + state.next(); // consume the ending quote + } else { + // consume a non-quoted literal character + state.next(); + } +} + +void ParsedPatternInfo::consumeFormat(UErrorCode &status) { + consumeIntegerFormat(status); + if (U_FAILURE(status)) { return; } + if (state.peek() == u'.') { + state.next(); // consume the decimal point + currentSubpattern->hasDecimal = true; + currentSubpattern->widthExceptAffixes += 1; + consumeFractionFormat(status); + if (U_FAILURE(status)) { return; } + } +} + +void ParsedPatternInfo::consumeIntegerFormat(UErrorCode &status) { + // Convenience reference: + ParsedSubpatternInfo &result = *currentSubpattern; + + while (true) { + switch (state.peek()) { + case u',': + result.widthExceptAffixes += 1; + result.groupingSizes <<= 16; + break; + + case u'#': + if (result.integerNumerals > 0) { + state.toParseException(u"# cannot follow 0 before decimal point"); + status = U_UNEXPECTED_TOKEN; + return; + } + result.widthExceptAffixes += 1; + result.groupingSizes += 1; + if (result.integerAtSigns > 0) { + result.integerTrailingHashSigns += 1; + } else { + result.integerLeadingHashSigns += 1; + } + result.integerTotal += 1; + break; + + case u'@': + if (result.integerNumerals > 0) { + state.toParseException(u"Cannot mix 0 and @"); + status = U_UNEXPECTED_TOKEN; + return; + } + if (result.integerTrailingHashSigns > 0) { + state.toParseException(u"Cannot nest # inside of a run of @"); + status = U_UNEXPECTED_TOKEN; + return; + } + result.widthExceptAffixes += 1; + result.groupingSizes += 1; + result.integerAtSigns += 1; + result.integerTotal += 1; + break; + + case u'0': + case u'1': + case u'2': + case u'3': + case u'4': + case u'5': + case u'6': + case u'7': + case u'8': + case u'9': + if (result.integerAtSigns > 0) { + state.toParseException(u"Cannot mix @ and 0"); + status = U_UNEXPECTED_TOKEN; + return; + } + result.widthExceptAffixes += 1; + result.groupingSizes += 1; + result.integerNumerals += 1; + result.integerTotal += 1; + if (!result.rounding.isZero() || state.peek() != u'0') { + result.rounding.appendDigit(static_cast(state.peek() - u'0'), 0, true); + } + break; + + default: + goto after_outer; + } + state.next(); // consume the symbol + } + + after_outer: + // Disallow patterns with a trailing ',' or with two ',' next to each other + auto grouping1 = static_cast (result.groupingSizes & 0xffff); + auto grouping2 = static_cast ((result.groupingSizes >> 16) & 0xffff); + auto grouping3 = static_cast ((result.groupingSizes >> 32) & 0xffff); + if (grouping1 == 0 && grouping2 != -1) { + state.toParseException(u"Trailing grouping separator is invalid"); + status = U_UNEXPECTED_TOKEN; + return; + } + if (grouping2 == 0 && grouping3 != -1) { + state.toParseException(u"Grouping width of zero is invalid"); + status = U_PATTERN_SYNTAX_ERROR; + return; + } +} + +void ParsedPatternInfo::consumeFractionFormat(UErrorCode &status) { + // Convenience reference: + ParsedSubpatternInfo &result = *currentSubpattern; + + int32_t zeroCounter = 0; + while (true) { + switch (state.peek()) { + case u'#': + result.widthExceptAffixes += 1; + result.fractionHashSigns += 1; + result.fractionTotal += 1; + zeroCounter++; + break; + + case u'0': + case u'1': + case u'2': + case u'3': + case u'4': + case u'5': + case u'6': + case u'7': + case u'8': + case u'9': + if (result.fractionHashSigns > 0) { + state.toParseException(u"0 cannot follow # after decimal point"); + status = U_UNEXPECTED_TOKEN; + return; + } + result.widthExceptAffixes += 1; + result.fractionNumerals += 1; + result.fractionTotal += 1; + if (state.peek() == u'0') { + zeroCounter++; + } else { + result.rounding + .appendDigit(static_cast(state.peek() - u'0'), zeroCounter, false); + zeroCounter = 0; + } + break; + + default: + return; + } + state.next(); // consume the symbol + } +} + +void ParsedPatternInfo::consumeExponent(UErrorCode &status) { + // Convenience reference: + ParsedSubpatternInfo &result = *currentSubpattern; + + if (state.peek() != u'E') { + return; + } + if ((result.groupingSizes & 0xffff0000L) != 0xffff0000L) { + state.toParseException(u"Cannot have grouping separator in scientific notation"); + status = U_MALFORMED_EXPONENTIAL_PATTERN; + return; + } + state.next(); // consume the E + result.widthExceptAffixes++; + if (state.peek() == u'+') { + state.next(); // consume the + + result.exponentHasPlusSign = true; + result.widthExceptAffixes++; + } + while (state.peek() == u'0') { + state.next(); // consume the 0 + result.exponentZeros += 1; + result.widthExceptAffixes++; + } +} + +/////////////////////////////////////////////////// +/// END RECURSIVE DESCENT PARSER IMPLEMENTATION /// +/////////////////////////////////////////////////// + +void +PatternParser::parseToExistingPropertiesImpl(const UnicodeString& pattern, DecimalFormatProperties &properties, + IgnoreRounding ignoreRounding, UErrorCode &status) { + if (pattern.length() == 0) { + // Backwards compatibility requires that we reset to the default values. + // TODO: Only overwrite the properties that "saveToProperties" normally touches? + properties.clear(); + return; + } + + ParsedPatternInfo patternInfo; + parseToPatternInfo(pattern, patternInfo, status); + if (U_FAILURE(status)) { return; } + patternInfoToProperties(properties, patternInfo, ignoreRounding, status); +} + +void PatternParser::patternInfoToProperties(DecimalFormatProperties &properties, + ParsedPatternInfo& patternInfo, + IgnoreRounding _ignoreRounding, UErrorCode &status) { + // Translate from PatternParseResult to Properties. + // Note that most data from "negative" is ignored per the specification of DecimalFormat. + + const ParsedSubpatternInfo &positive = patternInfo.positive; + + bool ignoreRounding; + if (_ignoreRounding == IGNORE_ROUNDING_NEVER) { + ignoreRounding = false; + } else if (_ignoreRounding == IGNORE_ROUNDING_IF_CURRENCY) { + ignoreRounding = positive.hasCurrencySign; + } else { + U_ASSERT(_ignoreRounding == IGNORE_ROUNDING_ALWAYS); + ignoreRounding = true; + } + + // Grouping settings + auto grouping1 = static_cast (positive.groupingSizes & 0xffff); + auto grouping2 = static_cast ((positive.groupingSizes >> 16) & 0xffff); + auto grouping3 = static_cast ((positive.groupingSizes >> 32) & 0xffff); + if (grouping2 != -1) { + properties.groupingSize = grouping1; + } else { + properties.groupingSize = -1; + } + if (grouping3 != -1) { + properties.secondaryGroupingSize = grouping2; + } else { + properties.secondaryGroupingSize = -1; + } + + // For backwards compatibility, require that the pattern emit at least one min digit. + int minInt, minFrac; + if (positive.integerTotal == 0 && positive.fractionTotal > 0) { + // patterns like ".##" + minInt = 0; + minFrac = uprv_max(1, positive.fractionNumerals); + } else if (positive.integerNumerals == 0 && positive.fractionNumerals == 0) { + // patterns like "#.##" + minInt = 1; + minFrac = 0; + } else { + minInt = positive.integerNumerals; + minFrac = positive.fractionNumerals; + } + + // Rounding settings + // Don't set basic rounding when there is a currency sign; defer to CurrencyUsage + if (positive.integerAtSigns > 0) { + properties.minimumFractionDigits = -1; + properties.maximumFractionDigits = -1; + properties.roundingIncrement = 0.0; + properties.minimumSignificantDigits = positive.integerAtSigns; + properties.maximumSignificantDigits = + positive.integerAtSigns + positive.integerTrailingHashSigns; + } else if (!positive.rounding.isZero()) { + if (!ignoreRounding) { + properties.minimumFractionDigits = minFrac; + properties.maximumFractionDigits = positive.fractionTotal; + properties.roundingIncrement = positive.rounding.toDouble(); + } else { + properties.minimumFractionDigits = -1; + properties.maximumFractionDigits = -1; + properties.roundingIncrement = 0.0; + } + properties.minimumSignificantDigits = -1; + properties.maximumSignificantDigits = -1; + } else { + if (!ignoreRounding) { + properties.minimumFractionDigits = minFrac; + properties.maximumFractionDigits = positive.fractionTotal; + properties.roundingIncrement = 0.0; + } else { + properties.minimumFractionDigits = -1; + properties.maximumFractionDigits = -1; + properties.roundingIncrement = 0.0; + } + properties.minimumSignificantDigits = -1; + properties.maximumSignificantDigits = -1; + } + + // If the pattern ends with a '.' then force the decimal point. + if (positive.hasDecimal && positive.fractionTotal == 0) { + properties.decimalSeparatorAlwaysShown = true; + } else { + properties.decimalSeparatorAlwaysShown = false; + } + + // Scientific notation settings + if (positive.exponentZeros > 0) { + properties.exponentSignAlwaysShown = positive.exponentHasPlusSign; + properties.minimumExponentDigits = positive.exponentZeros; + if (positive.integerAtSigns == 0) { + // patterns without '@' can define max integer digits, used for engineering notation + properties.minimumIntegerDigits = positive.integerNumerals; + properties.maximumIntegerDigits = positive.integerTotal; + } else { + // patterns with '@' cannot define max integer digits + properties.minimumIntegerDigits = 1; + properties.maximumIntegerDigits = -1; + } + } else { + properties.exponentSignAlwaysShown = false; + properties.minimumExponentDigits = -1; + properties.minimumIntegerDigits = minInt; + properties.maximumIntegerDigits = -1; + } + + // Compute the affix patterns (required for both padding and affixes) + UnicodeString posPrefix = patternInfo.getString(AffixPatternProvider::AFFIX_PREFIX); + UnicodeString posSuffix = patternInfo.getString(0); + + // Padding settings + if (!positive.paddingLocation.isNull()) { + // The width of the positive prefix and suffix templates are included in the padding + int paddingWidth = + positive.widthExceptAffixes + AffixUtils::estimateLength(UnicodeStringCharSequence(posPrefix), status) + + AffixUtils::estimateLength(UnicodeStringCharSequence(posSuffix), status); + properties.formatWidth = paddingWidth; + UnicodeString rawPaddingString = patternInfo.getString(AffixPatternProvider::AFFIX_PADDING); + if (rawPaddingString.length() == 1) { + properties.padString = rawPaddingString; + } else if (rawPaddingString.length() == 2) { + if (rawPaddingString.charAt(0) == u'\'') { + properties.padString.setTo(u"'", -1); + } else { + properties.padString = rawPaddingString; + } + } else { + properties.padString = UnicodeString(rawPaddingString, 1, rawPaddingString.length() - 2); + } + properties.padPosition = positive.paddingLocation; + } else { + properties.formatWidth = -1; + properties.padString.setToBogus(); + properties.padPosition.nullify(); + } + + // Set the affixes + // Always call the setter, even if the prefixes are empty, especially in the case of the + // negative prefix pattern, to prevent default values from overriding the pattern. + properties.positivePrefixPattern = posPrefix; + properties.positiveSuffixPattern = posSuffix; + if (patternInfo.fHasNegativeSubpattern) { + properties.negativePrefixPattern = patternInfo.getString( + AffixPatternProvider::AFFIX_NEGATIVE_SUBPATTERN | AffixPatternProvider::AFFIX_PREFIX); + properties.negativeSuffixPattern = patternInfo.getString( + AffixPatternProvider::AFFIX_NEGATIVE_SUBPATTERN); + } else { + properties.negativePrefixPattern.setToBogus(); + properties.negativeSuffixPattern.setToBogus(); + } + + // Set the magnitude multiplier + if (positive.hasPercentSign) { + properties.magnitudeMultiplier = 2; + } else if (positive.hasPerMilleSign) { + properties.magnitudeMultiplier = 3; + } else { + properties.magnitudeMultiplier = 0; + } +} + +/////////////////////////////////////////////////////////////////// +/// End PatternStringParser.java; begin PatternStringUtils.java /// +/////////////////////////////////////////////////////////////////// + +UnicodeString PatternStringUtils::propertiesToPatternString(const DecimalFormatProperties &properties, + UErrorCode &status) { + UnicodeString sb; + + // Convenience references + // The uprv_min() calls prevent DoS + int dosMax = 100; + int groupingSize = uprv_min(properties.secondaryGroupingSize, dosMax); + int firstGroupingSize = uprv_min(properties.groupingSize, dosMax); + int paddingWidth = uprv_min(properties.formatWidth, dosMax); + NullableValue paddingLocation = properties.padPosition; + UnicodeString paddingString = properties.padString; + int minInt = uprv_max(uprv_min(properties.minimumIntegerDigits, dosMax), 0); + int maxInt = uprv_min(properties.maximumIntegerDigits, dosMax); + int minFrac = uprv_max(uprv_min(properties.minimumFractionDigits, dosMax), 0); + int maxFrac = uprv_min(properties.maximumFractionDigits, dosMax); + int minSig = uprv_min(properties.minimumSignificantDigits, dosMax); + int maxSig = uprv_min(properties.maximumSignificantDigits, dosMax); + bool alwaysShowDecimal = properties.decimalSeparatorAlwaysShown; + int exponentDigits = uprv_min(properties.minimumExponentDigits, dosMax); + bool exponentShowPlusSign = properties.exponentSignAlwaysShown; + UnicodeString pp = properties.positivePrefix; + UnicodeString ppp = properties.positivePrefixPattern; + UnicodeString ps = properties.positiveSuffix; + UnicodeString psp = properties.positiveSuffixPattern; + UnicodeString np = properties.negativePrefix; + UnicodeString npp = properties.negativePrefixPattern; + UnicodeString ns = properties.negativeSuffix; + UnicodeString nsp = properties.negativeSuffixPattern; + + // Prefixes + if (!ppp.isBogus()) { + sb.append(ppp); + } + sb.append(AffixUtils::escape(UnicodeStringCharSequence(pp))); + int afterPrefixPos = sb.length(); + + // Figure out the grouping sizes. + int grouping1, grouping2, grouping; + if (groupingSize != uprv_min(dosMax, -1) && firstGroupingSize != uprv_min(dosMax, -1) && + groupingSize != firstGroupingSize) { + grouping = groupingSize; + grouping1 = groupingSize; + grouping2 = firstGroupingSize; + } else if (groupingSize != uprv_min(dosMax, -1)) { + grouping = groupingSize; + grouping1 = 0; + grouping2 = groupingSize; + } else if (firstGroupingSize != uprv_min(dosMax, -1)) { + grouping = groupingSize; + grouping1 = 0; + grouping2 = firstGroupingSize; + } else { + grouping = 0; + grouping1 = 0; + grouping2 = 0; + } + int groupingLength = grouping1 + grouping2 + 1; + + // Figure out the digits we need to put in the pattern. + double roundingInterval = properties.roundingIncrement; + UnicodeString digitsString; + int digitsStringScale = 0; + if (maxSig != uprv_min(dosMax, -1)) { + // Significant Digits. + while (digitsString.length() < minSig) { + digitsString.append(u'@'); + } + while (digitsString.length() < maxSig) { + digitsString.append(u'#'); + } + } else if (roundingInterval != 0.0) { + // Rounding Interval. + digitsStringScale = minFrac; + // TODO: Check for DoS here? + DecimalQuantity incrementQuantity; + incrementQuantity.setToDouble(roundingInterval); + incrementQuantity.adjustMagnitude(minFrac); + incrementQuantity.roundToMagnitude(0, kDefaultMode, status); + UnicodeString str = incrementQuantity.toPlainString(); + if (str.charAt(0) == u'-') { + // TODO: Unsupported operation exception or fail silently? + digitsString.append(str, 1, str.length() - 1); + } else { + digitsString.append(str); + } + } + while (digitsString.length() + digitsStringScale < minInt) { + digitsString.insert(0, u'0'); + } + while (-digitsStringScale < minFrac) { + digitsString.append(u'0'); + digitsStringScale--; + } + + // Write the digits to the string builder + int m0 = uprv_max(groupingLength, digitsString.length() + digitsStringScale); + m0 = (maxInt != dosMax) ? uprv_max(maxInt, m0) - 1 : m0 - 1; + int mN = (maxFrac != dosMax) ? uprv_min(-maxFrac, digitsStringScale) : digitsStringScale; + for (int magnitude = m0; magnitude >= mN; magnitude--) { + int di = digitsString.length() + digitsStringScale - magnitude - 1; + if (di < 0 || di >= digitsString.length()) { + sb.append(u'#'); + } else { + sb.append(digitsString.charAt(di)); + } + if (magnitude > grouping2 && grouping > 0 && (magnitude - grouping2) % grouping == 0) { + sb.append(u','); + } else if (magnitude > 0 && magnitude == grouping2) { + sb.append(u','); + } else if (magnitude == 0 && (alwaysShowDecimal || mN < 0)) { + sb.append(u'.'); + } + } + + // Exponential notation + if (exponentDigits != uprv_min(dosMax, -1)) { + sb.append(u'E'); + if (exponentShowPlusSign) { + sb.append(u'+'); + } + for (int i = 0; i < exponentDigits; i++) { + sb.append(u'0'); + } + } + + // Suffixes + int beforeSuffixPos = sb.length(); + if (!psp.isBogus()) { + sb.append(psp); + } + sb.append(AffixUtils::escape(UnicodeStringCharSequence(ps))); + + // Resolve Padding + if (paddingWidth != -1 && !paddingLocation.isNull()) { + while (paddingWidth - sb.length() > 0) { + sb.insert(afterPrefixPos, u'#'); + beforeSuffixPos++; + } + int addedLength; + switch (paddingLocation.get(status)) { + case PadPosition::UNUM_PAD_BEFORE_PREFIX: + addedLength = escapePaddingString(paddingString, sb, 0, status); + sb.insert(0, u'*'); + afterPrefixPos += addedLength + 1; + beforeSuffixPos += addedLength + 1; + break; + case PadPosition::UNUM_PAD_AFTER_PREFIX: + addedLength = escapePaddingString(paddingString, sb, afterPrefixPos, status); + sb.insert(afterPrefixPos, u'*'); + afterPrefixPos += addedLength + 1; + beforeSuffixPos += addedLength + 1; + break; + case PadPosition::UNUM_PAD_BEFORE_SUFFIX: + escapePaddingString(paddingString, sb, beforeSuffixPos, status); + sb.insert(beforeSuffixPos, u'*'); + break; + case PadPosition::UNUM_PAD_AFTER_SUFFIX: + sb.append(u'*'); + escapePaddingString(paddingString, sb, sb.length(), status); + break; + } + if (U_FAILURE(status)) { return sb; } + } + + // Negative affixes + // Ignore if the negative prefix pattern is "-" and the negative suffix is empty + if (!np.isBogus() || !ns.isBogus() || (npp.isBogus() && !nsp.isBogus()) || + (!npp.isBogus() && (npp.length() != 1 || npp.charAt(0) != u'-' || nsp.length() != 0))) { + sb.append(u';'); + if (!npp.isBogus()) { + sb.append(npp); + } + sb.append(AffixUtils::escape(UnicodeStringCharSequence(np))); + // Copy the positive digit format into the negative. + // This is optional; the pattern is the same as if '#' were appended here instead. + sb.append(sb, afterPrefixPos, beforeSuffixPos); + if (!nsp.isBogus()) { + sb.append(nsp); + } + sb.append(AffixUtils::escape(UnicodeStringCharSequence(ns))); + } + + return sb; +} + +int PatternStringUtils::escapePaddingString(UnicodeString input, UnicodeString& output, int startIndex, + UErrorCode &status) { + (void)status; + if (input.length() == 0) { + input.setTo(kFallbackPaddingString, -1); + } + int startLength = output.length(); + if (input.length() == 1) { + if (input.compare(u"'", -1) == 0) { + output.insert(startIndex, u"''", -1); + } else { + output.insert(startIndex, input); + } + } else { + output.insert(startIndex, u'\''); + int offset = 1; + for (int i = 0; i < input.length(); i++) { + // it's okay to deal in chars here because the quote mark is the only interesting thing. + char16_t ch = input.charAt(i); + if (ch == u'\'') { + output.insert(startIndex + offset, u"''", -1); + offset += 2; + } else { + output.insert(startIndex + offset, ch); + offset += 1; + } + } + output.insert(startIndex + offset, u'\''); + } + return output.length() - startLength; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_patternstring.h b/deps/icu-small/source/i18n/number_patternstring.h new file mode 100644 index 00000000000000..0558e66da52ddd --- /dev/null +++ b/deps/icu-small/source/i18n/number_patternstring.h @@ -0,0 +1,270 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_PATTERNSTRING_H__ +#define __NUMBER_PATTERNSTRING_H__ + + +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "unicode/unum.h" +#include "unicode/unistr.h" +#include "number_types.h" +#include "number_decimalquantity.h" +#include "number_decimfmtprops.h" +#include "number_affixutils.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +// Forward declaration +class PatternParser; + +// Exported as U_I18N_API because it is a public member field of exported ParsedSubpatternInfo +struct U_I18N_API Endpoints { + int32_t start = 0; + int32_t end = 0; +}; + +// Exported as U_I18N_API because it is a public member field of exported ParsedPatternInfo +struct U_I18N_API ParsedSubpatternInfo { + int64_t groupingSizes = 0x0000ffffffff0000L; + int32_t integerLeadingHashSigns = 0; + int32_t integerTrailingHashSigns = 0; + int32_t integerNumerals = 0; + int32_t integerAtSigns = 0; + int32_t integerTotal = 0; // for convenience + int32_t fractionNumerals = 0; + int32_t fractionHashSigns = 0; + int32_t fractionTotal = 0; // for convenience + bool hasDecimal = false; + int32_t widthExceptAffixes = 0; + NullableValue paddingLocation; + DecimalQuantity rounding; + bool exponentHasPlusSign = false; + int32_t exponentZeros = 0; + bool hasPercentSign = false; + bool hasPerMilleSign = false; + bool hasCurrencySign = false; + bool hasMinusSign = false; + bool hasPlusSign = false; + + Endpoints prefixEndpoints; + Endpoints suffixEndpoints; + Endpoints paddingEndpoints; +}; + +// Exported as U_I18N_API because it is needed for the unit test PatternStringTest +struct U_I18N_API ParsedPatternInfo : public AffixPatternProvider, public UMemory { + UnicodeString pattern; + ParsedSubpatternInfo positive; + ParsedSubpatternInfo negative; + + ParsedPatternInfo() : state(this->pattern), currentSubpattern(nullptr) {} + + ~ParsedPatternInfo() U_OVERRIDE = default; + + static int32_t getLengthFromEndpoints(const Endpoints &endpoints); + + char16_t charAt(int32_t flags, int32_t index) const U_OVERRIDE; + + int32_t length(int32_t flags) const U_OVERRIDE; + + UnicodeString getString(int32_t flags) const; + + bool positiveHasPlusSign() const U_OVERRIDE; + + bool hasNegativeSubpattern() const U_OVERRIDE; + + bool negativeHasMinusSign() const U_OVERRIDE; + + bool hasCurrencySign() const U_OVERRIDE; + + bool containsSymbolType(AffixPatternType type, UErrorCode &status) const U_OVERRIDE; + + private: + struct U_I18N_API ParserState { + const UnicodeString &pattern; // reference to the parent + int32_t offset = 0; + + explicit ParserState(const UnicodeString &_pattern) : pattern(_pattern) {}; + + UChar32 peek(); + + UChar32 next(); + + // TODO: We don't currently do anything with the message string. + // This method is here as a shell for Java compatibility. + inline void toParseException(const char16_t *message) { (void)message; } + } + state; + + // NOTE: In Java, these are written as pure functions. + // In C++, they're written as methods. + // The behavior is the same. + + // Mutable transient pointer: + ParsedSubpatternInfo *currentSubpattern; + + // In Java, "negative == null" tells us whether or not we had a negative subpattern. + // In C++, we need to remember in another boolean. + bool fHasNegativeSubpattern = false; + + const Endpoints &getEndpoints(int32_t flags) const; + + /** Run the recursive descent parser. */ + void consumePattern(const UnicodeString &patternString, UErrorCode &status); + + void consumeSubpattern(UErrorCode &status); + + void consumePadding(PadPosition paddingLocation, UErrorCode &status); + + void consumeAffix(Endpoints &endpoints, UErrorCode &status); + + void consumeLiteral(UErrorCode &status); + + void consumeFormat(UErrorCode &status); + + void consumeIntegerFormat(UErrorCode &status); + + void consumeFractionFormat(UErrorCode &status); + + void consumeExponent(UErrorCode &status); + + friend class PatternParser; +}; + +class U_I18N_API PatternParser { + public: + /** + * Runs the recursive descent parser on the given pattern string, returning a data structure with raw information + * about the pattern string. + * + *

+ * To obtain a more useful form of the data, consider using {@link #parseToProperties} instead. + * + * TODO: Change argument type to const char16_t* instead of UnicodeString? + * + * @param patternString + * The LDML decimal format pattern (Excel-style pattern) to parse. + * @return The results of the parse. + */ + static void + parseToPatternInfo(const UnicodeString& patternString, ParsedPatternInfo &patternInfo, UErrorCode &status); + + enum IgnoreRounding { + IGNORE_ROUNDING_NEVER = 0, IGNORE_ROUNDING_IF_CURRENCY = 1, IGNORE_ROUNDING_ALWAYS = 2 + }; + + /** + * Parses a pattern string into a new property bag. + * + * @param pattern + * The pattern string, like "#,##0.00" + * @param ignoreRounding + * Whether to leave out rounding information (minFrac, maxFrac, and rounding increment) when parsing the + * pattern. This may be desirable if a custom rounding mode, such as CurrencyUsage, is to be used + * instead. + * @return A property bag object. + * @throws IllegalArgumentException + * If there is a syntax error in the pattern string. + */ + static DecimalFormatProperties + parseToProperties(const UnicodeString& pattern, IgnoreRounding ignoreRounding, UErrorCode &status); + + /** + * Parses a pattern string into an existing property bag. All properties that can be encoded into a pattern string + * will be overwritten with either their default value or with the value coming from the pattern string. Properties + * that cannot be encoded into a pattern string, such as rounding mode, are not modified. + * + * @param pattern + * The pattern string, like "#,##0.00" + * @param properties + * The property bag object to overwrite. + * @param ignoreRounding + * See {@link #parseToProperties(String pattern, int ignoreRounding)}. + * @throws IllegalArgumentException + * If there was a syntax error in the pattern string. + */ + static void parseToExistingProperties(const UnicodeString& pattern, DecimalFormatProperties& properties, + IgnoreRounding ignoreRounding, UErrorCode &status); + + private: + static void + parseToExistingPropertiesImpl(const UnicodeString& pattern, DecimalFormatProperties &properties, + IgnoreRounding ignoreRounding, UErrorCode &status); + + /** Finalizes the temporary data stored in the ParsedPatternInfo to the Properties. */ + static void + patternInfoToProperties(DecimalFormatProperties &properties, ParsedPatternInfo& patternInfo, + IgnoreRounding _ignoreRounding, UErrorCode &status); +}; + +class U_I18N_API PatternStringUtils { + public: + /** + * Creates a pattern string from a property bag. + * + *

+ * Since pattern strings support only a subset of the functionality available in a property bag, a new property bag + * created from the string returned by this function may not be the same as the original property bag. + * + * @param properties + * The property bag to serialize. + * @return A pattern string approximately serializing the property bag. + */ + static UnicodeString + propertiesToPatternString(const DecimalFormatProperties &properties, UErrorCode &status); + + + /** + * Converts a pattern between standard notation and localized notation. Localized notation means that instead of + * using generic placeholders in the pattern, you use the corresponding locale-specific characters instead. For + * example, in locale fr-FR, the period in the pattern "0.000" means "decimal" in standard notation (as it + * does in every other locale), but it means "grouping" in localized notation. + * + *

+ * A greedy string-substitution strategy is used to substitute locale symbols. If two symbols are ambiguous or have + * the same prefix, the result is not well-defined. + * + *

+ * Locale symbols are not allowed to contain the ASCII quote character. + * + *

+ * This method is provided for backwards compatibility and should not be used in any new code. + * + * TODO(C++): This method is not yet implemented. + * + * @param input + * The pattern to convert. + * @param symbols + * The symbols corresponding to the localized pattern. + * @param toLocalized + * true to convert from standard to localized notation; false to convert from localized to standard + * notation. + * @return The pattern expressed in the other notation. + */ + static UnicodeString + convertLocalized(UnicodeString input, DecimalFormatSymbols symbols, bool toLocalized, + UErrorCode &status); + + private: + /** @return The number of chars inserted. */ + static int + escapePaddingString(UnicodeString input, UnicodeString &output, int startIndex, UErrorCode &status); +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_PATTERNSTRING_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_rounding.cpp b/deps/icu-small/source/i18n/number_rounding.cpp new file mode 100644 index 00000000000000..5c494f09544425 --- /dev/null +++ b/deps/icu-small/source/i18n/number_rounding.cpp @@ -0,0 +1,347 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "uassert.h" +#include "unicode/numberformatter.h" +#include "number_types.h" +#include "number_decimalquantity.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + +int32_t getRoundingMagnitudeFraction(int maxFrac) { + if (maxFrac == -1) { + return INT32_MIN; + } + return -maxFrac; +} + +int32_t getRoundingMagnitudeSignificant(const DecimalQuantity &value, int maxSig) { + if (maxSig == -1) { + return INT32_MIN; + } + int magnitude = value.isZero() ? 0 : value.getMagnitude(); + return magnitude - maxSig + 1; +} + +int32_t getDisplayMagnitudeFraction(int minFrac) { + if (minFrac == 0) { + return INT32_MAX; + } + return -minFrac; +} + +int32_t getDisplayMagnitudeSignificant(const DecimalQuantity &value, int minSig) { + int magnitude = value.isZero() ? 0 : value.getMagnitude(); + return magnitude - minSig + 1; +} + +} + + +Rounder Rounder::unlimited() { + return Rounder(RND_NONE, {}, kDefaultMode); +} + +FractionRounder Rounder::integer() { + return constructFraction(0, 0); +} + +FractionRounder Rounder::fixedFraction(int32_t minMaxFractionPlaces) { + if (minMaxFractionPlaces >= 0 && minMaxFractionPlaces <= kMaxIntFracSig) { + return constructFraction(minMaxFractionPlaces, minMaxFractionPlaces); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +FractionRounder Rounder::minFraction(int32_t minFractionPlaces) { + if (minFractionPlaces >= 0 && minFractionPlaces <= kMaxIntFracSig) { + return constructFraction(minFractionPlaces, -1); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +FractionRounder Rounder::maxFraction(int32_t maxFractionPlaces) { + if (maxFractionPlaces >= 0 && maxFractionPlaces <= kMaxIntFracSig) { + return constructFraction(0, maxFractionPlaces); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +FractionRounder Rounder::minMaxFraction(int32_t minFractionPlaces, int32_t maxFractionPlaces) { + if (minFractionPlaces >= 0 && maxFractionPlaces <= kMaxIntFracSig && + minFractionPlaces <= maxFractionPlaces) { + return constructFraction(minFractionPlaces, maxFractionPlaces); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +Rounder Rounder::fixedDigits(int32_t minMaxSignificantDigits) { + if (minMaxSignificantDigits >= 0 && minMaxSignificantDigits <= kMaxIntFracSig) { + return constructSignificant(minMaxSignificantDigits, minMaxSignificantDigits); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +Rounder Rounder::minDigits(int32_t minSignificantDigits) { + if (minSignificantDigits >= 0 && minSignificantDigits <= kMaxIntFracSig) { + return constructSignificant(minSignificantDigits, -1); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +Rounder Rounder::maxDigits(int32_t maxSignificantDigits) { + if (maxSignificantDigits >= 0 && maxSignificantDigits <= kMaxIntFracSig) { + return constructSignificant(0, maxSignificantDigits); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +Rounder Rounder::minMaxDigits(int32_t minSignificantDigits, int32_t maxSignificantDigits) { + if (minSignificantDigits >= 0 && maxSignificantDigits <= kMaxIntFracSig && + minSignificantDigits <= maxSignificantDigits) { + return constructSignificant(minSignificantDigits, maxSignificantDigits); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +IncrementRounder Rounder::increment(double roundingIncrement) { + if (roundingIncrement > 0.0) { + return constructIncrement(roundingIncrement, 0); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +CurrencyRounder Rounder::currency(UCurrencyUsage currencyUsage) { + return constructCurrency(currencyUsage); +} + +Rounder Rounder::withMode(RoundingMode roundingMode) const { + if (fType == RND_ERROR) { return *this; } // no-op in error state + return {fType, fUnion, roundingMode}; +} + +Rounder FractionRounder::withMinDigits(int32_t minSignificantDigits) const { + if (fType == RND_ERROR) { return *this; } // no-op in error state + if (minSignificantDigits >= 0 && minSignificantDigits <= kMaxIntFracSig) { + return constructFractionSignificant(*this, minSignificantDigits, -1); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +Rounder FractionRounder::withMaxDigits(int32_t maxSignificantDigits) const { + if (fType == RND_ERROR) { return *this; } // no-op in error state + if (maxSignificantDigits >= 0 && maxSignificantDigits <= kMaxIntFracSig) { + return constructFractionSignificant(*this, -1, maxSignificantDigits); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +// Private method on base class +Rounder Rounder::withCurrency(const CurrencyUnit ¤cy, UErrorCode &status) const { + if (fType == RND_ERROR) { return *this; } // no-op in error state + U_ASSERT(fType == RND_CURRENCY); + const char16_t *isoCode = currency.getISOCurrency(); + double increment = ucurr_getRoundingIncrementForUsage(isoCode, fUnion.currencyUsage, &status); + int32_t minMaxFrac = ucurr_getDefaultFractionDigitsForUsage( + isoCode, fUnion.currencyUsage, &status); + if (increment != 0.0) { + return constructIncrement(increment, minMaxFrac); + } else { + return constructFraction(minMaxFrac, minMaxFrac); + } +} + +// Public method on CurrencyRounder subclass +Rounder CurrencyRounder::withCurrency(const CurrencyUnit ¤cy) const { + UErrorCode localStatus = U_ZERO_ERROR; + Rounder result = Rounder::withCurrency(currency, localStatus); + if (U_FAILURE(localStatus)) { + return {localStatus}; + } + return result; +} + +Rounder IncrementRounder::withMinFraction(int32_t minFrac) const { + if (fType == RND_ERROR) { return *this; } // no-op in error state + if (minFrac >= 0 && minFrac <= kMaxIntFracSig) { + return constructIncrement(fUnion.increment.fIncrement, minFrac); + } else { + return {U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR}; + } +} + +FractionRounder Rounder::constructFraction(int32_t minFrac, int32_t maxFrac) { + FractionSignificantSettings settings; + settings.fMinFrac = static_cast (minFrac); + settings.fMaxFrac = static_cast (maxFrac); + settings.fMinSig = -1; + settings.fMaxSig = -1; + RounderUnion union_; + union_.fracSig = settings; + return {RND_FRACTION, union_, kDefaultMode}; +} + +Rounder Rounder::constructSignificant(int32_t minSig, int32_t maxSig) { + FractionSignificantSettings settings; + settings.fMinFrac = -1; + settings.fMaxFrac = -1; + settings.fMinSig = static_cast(minSig); + settings.fMaxSig = static_cast(maxSig); + RounderUnion union_; + union_.fracSig = settings; + return {RND_SIGNIFICANT, union_, kDefaultMode}; +} + +Rounder +Rounder::constructFractionSignificant(const FractionRounder &base, int32_t minSig, int32_t maxSig) { + FractionSignificantSettings settings = base.fUnion.fracSig; + settings.fMinSig = static_cast(minSig); + settings.fMaxSig = static_cast(maxSig); + RounderUnion union_; + union_.fracSig = settings; + return {RND_FRACTION_SIGNIFICANT, union_, kDefaultMode}; +} + +IncrementRounder Rounder::constructIncrement(double increment, int32_t minFrac) { + IncrementSettings settings; + settings.fIncrement = increment; + settings.fMinFrac = minFrac; + RounderUnion union_; + union_.increment = settings; + return {RND_INCREMENT, union_, kDefaultMode}; +} + +CurrencyRounder Rounder::constructCurrency(UCurrencyUsage usage) { + RounderUnion union_; + union_.currencyUsage = usage; + return {RND_CURRENCY, union_, kDefaultMode}; +} + +Rounder Rounder::constructPassThrough() { + RounderUnion union_; + union_.errorCode = U_ZERO_ERROR; // initialize the variable + return {RND_PASS_THROUGH, union_, kDefaultMode}; +} + +void Rounder::setLocaleData(const CurrencyUnit ¤cy, UErrorCode &status) { + if (fType == RND_CURRENCY) { + *this = withCurrency(currency, status); + } +} + +int32_t +Rounder::chooseMultiplierAndApply(impl::DecimalQuantity &input, const impl::MultiplierProducer &producer, + UErrorCode &status) { + // TODO: Make a better and more efficient implementation. + // TODO: Avoid the object creation here. + DecimalQuantity copy(input); + + U_ASSERT(!input.isZero()); + int32_t magnitude = input.getMagnitude(); + int32_t multiplier = producer.getMultiplier(magnitude); + input.adjustMagnitude(multiplier); + apply(input, status); + + // If the number turned to zero when rounding, do not re-attempt the rounding. + if (!input.isZero() && input.getMagnitude() == magnitude + multiplier + 1) { + magnitude += 1; + input = copy; + multiplier = producer.getMultiplier(magnitude); + input.adjustMagnitude(multiplier); + U_ASSERT(input.getMagnitude() == magnitude + multiplier - 1); + apply(input, status); + U_ASSERT(input.getMagnitude() == magnitude + multiplier); + } + + return multiplier; +} + +/** This is the method that contains the actual rounding logic. */ +void Rounder::apply(impl::DecimalQuantity &value, UErrorCode& status) const { + switch (fType) { + case RND_BOGUS: + case RND_ERROR: + // Errors should be caught before the apply() method is called + status = U_INTERNAL_PROGRAM_ERROR; + break; + + case RND_NONE: + value.roundToInfinity(); + break; + + case RND_FRACTION: + value.roundToMagnitude( + getRoundingMagnitudeFraction(fUnion.fracSig.fMaxFrac), fRoundingMode, status); + value.setFractionLength( + uprv_max(0, -getDisplayMagnitudeFraction(fUnion.fracSig.fMinFrac)), INT32_MAX); + break; + + case RND_SIGNIFICANT: + value.roundToMagnitude( + getRoundingMagnitudeSignificant(value, fUnion.fracSig.fMaxSig), + fRoundingMode, + status); + value.setFractionLength( + uprv_max(0, -getDisplayMagnitudeSignificant(value, fUnion.fracSig.fMinSig)), + INT32_MAX); + break; + + case RND_FRACTION_SIGNIFICANT: { + int32_t displayMag = getDisplayMagnitudeFraction(fUnion.fracSig.fMinFrac); + int32_t roundingMag = getRoundingMagnitudeFraction(fUnion.fracSig.fMaxFrac); + if (fUnion.fracSig.fMinSig == -1) { + // Max Sig override + int32_t candidate = getRoundingMagnitudeSignificant(value, fUnion.fracSig.fMaxSig); + roundingMag = uprv_max(roundingMag, candidate); + } else { + // Min Sig override + int32_t candidate = getDisplayMagnitudeSignificant(value, fUnion.fracSig.fMinSig); + roundingMag = uprv_min(roundingMag, candidate); + } + value.roundToMagnitude(roundingMag, fRoundingMode, status); + value.setFractionLength(uprv_max(0, -displayMag), INT32_MAX); + break; + } + + case RND_INCREMENT: + value.roundToIncrement( + fUnion.increment.fIncrement, fRoundingMode, fUnion.increment.fMinFrac, status); + value.setFractionLength(fUnion.increment.fMinFrac, fUnion.increment.fMinFrac); + break; + + case RND_CURRENCY: + // Call .withCurrency() before .apply()! + U_ASSERT(false); + + case RND_PASS_THROUGH: + break; + } +} + +void Rounder::apply(impl::DecimalQuantity &value, int32_t minInt, UErrorCode /*status*/) { + // This method is intended for the one specific purpose of helping print "00.000E0". + U_ASSERT(fType == RND_SIGNIFICANT); + U_ASSERT(value.isZero()); + value.setFractionLength(fUnion.fracSig.fMinSig - minInt, INT32_MAX); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_roundingutils.h b/deps/icu-small/source/i18n/number_roundingutils.h new file mode 100644 index 00000000000000..6868ee0b86817e --- /dev/null +++ b/deps/icu-small/source/i18n/number_roundingutils.h @@ -0,0 +1,141 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_ROUNDINGUTILS_H__ +#define __NUMBER_ROUNDINGUTILS_H__ + +#include "number_types.h" + +U_NAMESPACE_BEGIN +namespace number { +namespace impl { +namespace roundingutils { + +enum Section { + SECTION_LOWER_EDGE = -1, + SECTION_UPPER_EDGE = -2, + SECTION_LOWER = 1, + SECTION_MIDPOINT = 2, + SECTION_UPPER = 3 +}; + +/** + * Converts a rounding mode and metadata about the quantity being rounded to a boolean determining + * whether the value should be rounded toward infinity or toward zero. + * + *

The parameters are of type int because benchmarks on an x86-64 processor against OpenJDK + * showed that ints were demonstrably faster than enums in switch statements. + * + * @param isEven Whether the digit immediately before the rounding magnitude is even. + * @param isNegative Whether the quantity is negative. + * @param section Whether the part of the quantity to the right of the rounding magnitude is + * exactly halfway between two digits, whether it is in the lower part (closer to zero), or + * whether it is in the upper part (closer to infinity). See {@link #SECTION_LOWER}, {@link + * #SECTION_MIDPOINT}, and {@link #SECTION_UPPER}. + * @param roundingMode The integer version of the {@link RoundingMode}, which you can get via + * {@link RoundingMode#ordinal}. + * @param status Error code, set to U_FORMAT_INEXACT_ERROR if the rounding mode is kRoundUnnecessary. + * @return true if the number should be rounded toward zero; false if it should be rounded toward + * infinity. + */ +inline bool +getRoundingDirection(bool isEven, bool isNegative, Section section, RoundingMode roundingMode, + UErrorCode &status) { + switch (roundingMode) { + case RoundingMode::UNUM_ROUND_UP: + // round away from zero + return false; + + case RoundingMode::UNUM_ROUND_DOWN: + // round toward zero + return true; + + case RoundingMode::UNUM_ROUND_CEILING: + // round toward positive infinity + return isNegative; + + case RoundingMode::UNUM_ROUND_FLOOR: + // round toward negative infinity + return !isNegative; + + case RoundingMode::UNUM_ROUND_HALFUP: + switch (section) { + case SECTION_MIDPOINT: + return false; + case SECTION_LOWER: + return true; + case SECTION_UPPER: + return false; + default: + break; + } + break; + + case RoundingMode::UNUM_ROUND_HALFDOWN: + switch (section) { + case SECTION_MIDPOINT: + return true; + case SECTION_LOWER: + return true; + case SECTION_UPPER: + return false; + default: + break; + } + break; + + case RoundingMode::UNUM_ROUND_HALFEVEN: + switch (section) { + case SECTION_MIDPOINT: + return isEven; + case SECTION_LOWER: + return true; + case SECTION_UPPER: + return false; + default: + break; + } + break; + + default: + break; + } + + status = U_FORMAT_INEXACT_ERROR; + return false; +} + +/** + * Gets whether the given rounding mode's rounding boundary is at the midpoint. The rounding + * boundary is the point at which a number switches from being rounded down to being rounded up. + * For example, with rounding mode HALF_EVEN, HALF_UP, or HALF_DOWN, the rounding boundary is at + * the midpoint, and this function would return true. However, for UP, DOWN, CEILING, and FLOOR, + * the rounding boundary is at the "edge", and this function would return false. + * + * @param roundingMode The integer version of the {@link RoundingMode}. + * @return true if rounding mode is HALF_EVEN, HALF_UP, or HALF_DOWN; false otherwise. + */ +inline bool roundsAtMidpoint(int roundingMode) { + switch (roundingMode) { + case RoundingMode::UNUM_ROUND_UP: + case RoundingMode::UNUM_ROUND_DOWN: + case RoundingMode::UNUM_ROUND_CEILING: + case RoundingMode::UNUM_ROUND_FLOOR: + return false; + + default: + return true; + } +} + +} // namespace roundingutils +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_ROUNDINGUTILS_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_scientific.cpp b/deps/icu-small/source/i18n/number_scientific.cpp new file mode 100644 index 00000000000000..a2f2bf85a1fc9d --- /dev/null +++ b/deps/icu-small/source/i18n/number_scientific.cpp @@ -0,0 +1,138 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include +#include "number_scientific.h" +#include "number_utils.h" +#include "number_stringbuilder.h" +#include "unicode/unum.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +// NOTE: The object lifecycle of ScientificModifier and ScientificHandler differ greatly in Java and C++. +// +// During formatting, we need to provide an object with state (the exponent) as the inner modifier. +// +// In Java, where the priority is put on reducing object creations, the unsafe code path re-uses the +// ScientificHandler as a ScientificModifier, and the safe code path pre-computes 25 ScientificModifier +// instances. This scheme reduces the number of object creations by 1 in both safe and unsafe. +// +// In C++, MicroProps provides a pre-allocated ScientificModifier, and ScientificHandler simply populates +// the state (the exponent) into that ScientificModifier. There is no difference between safe and unsafe. + +ScientificModifier::ScientificModifier() : fExponent(0), fHandler(nullptr) {} + +void ScientificModifier::set(int32_t exponent, const ScientificHandler *handler) { + // ScientificModifier should be set only once. + U_ASSERT(fHandler == nullptr); + fExponent = exponent; + fHandler = handler; +} + +int32_t ScientificModifier::apply(NumberStringBuilder &output, int32_t /*leftIndex*/, int32_t rightIndex, + UErrorCode &status) const { + // FIXME: Localized exponent separator location. + int i = rightIndex; + // Append the exponent separator and sign + i += output.insert( + i, + fHandler->fSymbols->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kExponentialSymbol), + UNUM_EXPONENT_SYMBOL_FIELD, + status); + if (fExponent < 0 && fHandler->fSettings.fExponentSignDisplay != UNUM_SIGN_NEVER) { + i += output.insert( + i, + fHandler->fSymbols + ->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kMinusSignSymbol), + UNUM_EXPONENT_SIGN_FIELD, + status); + } else if (fExponent >= 0 && fHandler->fSettings.fExponentSignDisplay == UNUM_SIGN_ALWAYS) { + i += output.insert( + i, + fHandler->fSymbols + ->getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kPlusSignSymbol), + UNUM_EXPONENT_SIGN_FIELD, + status); + } + // Append the exponent digits (using a simple inline algorithm) + int32_t disp = std::abs(fExponent); + for (int j = 0; j < fHandler->fSettings.fMinExponentDigits || disp > 0; j++, disp /= 10) { + auto d = static_cast(disp % 10); + const UnicodeString &digitString = getDigitFromSymbols(d, *fHandler->fSymbols); + i += output.insert(i - j, digitString, UNUM_EXPONENT_FIELD, status); + } + return i - rightIndex; +} + +int32_t ScientificModifier::getPrefixLength(UErrorCode &status) const { + (void)status; + // TODO: Localized exponent separator location. + return 0; +} + +int32_t ScientificModifier::getCodePointCount(UErrorCode &status) const { + (void)status; + // This method is not used for strong modifiers. + U_ASSERT(false); + return 0; +} + +bool ScientificModifier::isStrong() const { + // Scientific is always strong + return true; +} + +// Note: Visual Studio does not compile this function without full name space. Why? +icu::number::impl::ScientificHandler::ScientificHandler(const Notation *notation, const DecimalFormatSymbols *symbols, + const MicroPropsGenerator *parent) : + fSettings(notation->fUnion.scientific), fSymbols(symbols), fParent(parent) {} + +void ScientificHandler::processQuantity(DecimalQuantity &quantity, MicroProps µs, + UErrorCode &status) const { + fParent->processQuantity(quantity, micros, status); + if (U_FAILURE(status)) { return; } + + // Treat zero as if it had magnitude 0 + int32_t exponent; + if (quantity.isZero()) { + if (fSettings.fRequireMinInt && micros.rounding.fType == Rounder::RND_SIGNIFICANT) { + // Show "00.000E0" on pattern "00.000E0" + micros.rounding.apply(quantity, fSettings.fEngineeringInterval, status); + exponent = 0; + } else { + micros.rounding.apply(quantity, status); + exponent = 0; + } + } else { + exponent = -micros.rounding.chooseMultiplierAndApply(quantity, *this, status); + } + + // Use MicroProps's helper ScientificModifier and save it as the modInner. + ScientificModifier &mod = micros.helpers.scientificModifier; + mod.set(exponent, this); + micros.modInner = &mod; +} + +int32_t ScientificHandler::getMultiplier(int32_t magnitude) const { + int32_t interval = fSettings.fEngineeringInterval; + int32_t digitsShown; + if (fSettings.fRequireMinInt) { + // For patterns like "000.00E0" and ".00E0" + digitsShown = interval; + } else if (interval <= 1) { + // For patterns like "0.00E0" and "@@@E0" + digitsShown = 1; + } else { + // For patterns like "##0.00" + digitsShown = ((magnitude % interval + interval) % interval) + 1; + } + return digitsShown - magnitude - 1; +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_scientific.h b/deps/icu-small/source/i18n/number_scientific.h new file mode 100644 index 00000000000000..f5e4d30e6a9737 --- /dev/null +++ b/deps/icu-small/source/i18n/number_scientific.h @@ -0,0 +1,62 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_SCIENTIFIC_H__ +#define __NUMBER_SCIENTIFIC_H__ + +#include "number_types.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +// Forward-declare +class ScientificHandler; + +class U_I18N_API ScientificModifier : public UMemory, public Modifier { + public: + ScientificModifier(); + + void set(int32_t exponent, const ScientificHandler *handler); + + int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const U_OVERRIDE; + + int32_t getPrefixLength(UErrorCode &status) const U_OVERRIDE; + + int32_t getCodePointCount(UErrorCode &status) const U_OVERRIDE; + + bool isStrong() const U_OVERRIDE; + + private: + int32_t fExponent; + const ScientificHandler *fHandler; +}; + +class ScientificHandler : public UMemory, public MicroPropsGenerator, public MultiplierProducer { + public: + ScientificHandler(const Notation *notation, const DecimalFormatSymbols *symbols, + const MicroPropsGenerator *parent); + + void + processQuantity(DecimalQuantity &quantity, MicroProps µs, UErrorCode &status) const U_OVERRIDE; + + int32_t getMultiplier(int32_t magnitude) const U_OVERRIDE; + + private: + const Notation::ScientificSettings& fSettings; + const DecimalFormatSymbols *fSymbols; + const MicroPropsGenerator *fParent; + + friend class ScientificModifier; +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_SCIENTIFIC_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_stringbuilder.cpp b/deps/icu-small/source/i18n/number_stringbuilder.cpp new file mode 100644 index 00000000000000..e6e86bd4291d6e --- /dev/null +++ b/deps/icu-small/source/i18n/number_stringbuilder.cpp @@ -0,0 +1,460 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT + +#include "number_stringbuilder.h" +#include "unicode/utf16.h" +#include "uvectr32.h" + +using namespace icu; +using namespace icu::number; +using namespace icu::number::impl; + +namespace { + +// A version of uprv_memcpy that checks for length 0. +// By default, uprv_memcpy requires a length of at least 1. +inline void uprv_memcpy2(void* dest, const void* src, size_t len) { + if (len > 0) { + uprv_memcpy(dest, src, len); + } +} + +// A version of uprv_memmove that checks for length 0. +// By default, uprv_memmove requires a length of at least 1. +inline void uprv_memmove2(void* dest, const void* src, size_t len) { + if (len > 0) { + uprv_memmove(dest, src, len); + } +} + +} // namespace + +NumberStringBuilder::NumberStringBuilder() = default; + +NumberStringBuilder::~NumberStringBuilder() { + if (fUsingHeap) { + uprv_free(fChars.heap.ptr); + uprv_free(fFields.heap.ptr); + } +} + +NumberStringBuilder::NumberStringBuilder(const NumberStringBuilder &other) { + *this = other; +} + +NumberStringBuilder &NumberStringBuilder::operator=(const NumberStringBuilder &other) { + // Check for self-assignment + if (this == &other) { + return *this; + } + + // Continue with deallocation and copying + if (fUsingHeap) { + uprv_free(fChars.heap.ptr); + uprv_free(fFields.heap.ptr); + fUsingHeap = false; + } + + int32_t capacity = other.getCapacity(); + if (capacity > DEFAULT_CAPACITY) { + // FIXME: uprv_malloc + // C++ note: malloc appears in two places: here and in prepareForInsertHelper. + auto newChars = static_cast (uprv_malloc(sizeof(char16_t) * capacity)); + auto newFields = static_cast(uprv_malloc(sizeof(Field) * capacity)); + if (newChars == nullptr || newFields == nullptr) { + // UErrorCode is not available; fail silently. + uprv_free(newChars); + uprv_free(newFields); + *this = NumberStringBuilder(); // can't fail + return *this; + } + + fUsingHeap = true; + fChars.heap.capacity = capacity; + fChars.heap.ptr = newChars; + fFields.heap.capacity = capacity; + fFields.heap.ptr = newFields; + } + + uprv_memcpy2(getCharPtr(), other.getCharPtr(), sizeof(char16_t) * capacity); + uprv_memcpy2(getFieldPtr(), other.getFieldPtr(), sizeof(Field) * capacity); + + fZero = other.fZero; + fLength = other.fLength; + return *this; +} + +int32_t NumberStringBuilder::length() const { + return fLength; +} + +int32_t NumberStringBuilder::codePointCount() const { + return u_countChar32(getCharPtr() + fZero, fLength); +} + +UChar32 NumberStringBuilder::getFirstCodePoint() const { + if (fLength == 0) { + return -1; + } + UChar32 cp; + U16_GET(getCharPtr() + fZero, 0, 0, fLength, cp); + return cp; +} + +UChar32 NumberStringBuilder::getLastCodePoint() const { + if (fLength == 0) { + return -1; + } + int32_t offset = fLength; + U16_BACK_1(getCharPtr() + fZero, 0, offset); + UChar32 cp; + U16_GET(getCharPtr() + fZero, 0, offset, fLength, cp); + return cp; +} + +UChar32 NumberStringBuilder::codePointAt(int32_t index) const { + UChar32 cp; + U16_GET(getCharPtr() + fZero, 0, index, fLength, cp); + return cp; +} + +UChar32 NumberStringBuilder::codePointBefore(int32_t index) const { + int32_t offset = index; + U16_BACK_1(getCharPtr() + fZero, 0, offset); + UChar32 cp; + U16_GET(getCharPtr() + fZero, 0, offset, fLength, cp); + return cp; +} + +NumberStringBuilder &NumberStringBuilder::clear() { + // TODO: Reset the heap here? + fZero = getCapacity() / 2; + fLength = 0; + return *this; +} + +int32_t NumberStringBuilder::appendCodePoint(UChar32 codePoint, Field field, UErrorCode &status) { + return insertCodePoint(fLength, codePoint, field, status); +} + +int32_t +NumberStringBuilder::insertCodePoint(int32_t index, UChar32 codePoint, Field field, UErrorCode &status) { + int32_t count = U16_LENGTH(codePoint); + int32_t position = prepareForInsert(index, count, status); + if (U_FAILURE(status)) { + return count; + } + if (count == 1) { + getCharPtr()[position] = (char16_t) codePoint; + getFieldPtr()[position] = field; + } else { + getCharPtr()[position] = U16_LEAD(codePoint); + getCharPtr()[position + 1] = U16_TRAIL(codePoint); + getFieldPtr()[position] = getFieldPtr()[position + 1] = field; + } + return count; +} + +int32_t NumberStringBuilder::append(const UnicodeString &unistr, Field field, UErrorCode &status) { + return insert(fLength, unistr, field, status); +} + +int32_t NumberStringBuilder::insert(int32_t index, const UnicodeString &unistr, Field field, + UErrorCode &status) { + if (unistr.length() == 0) { + // Nothing to insert. + return 0; + } else if (unistr.length() == 1) { + // Fast path: insert using insertCodePoint. + return insertCodePoint(index, unistr.charAt(0), field, status); + } else { + return insert(index, unistr, 0, unistr.length(), field, status); + } +} + +int32_t +NumberStringBuilder::insert(int32_t index, const UnicodeString &unistr, int32_t start, int32_t end, + Field field, UErrorCode &status) { + int32_t count = end - start; + int32_t position = prepareForInsert(index, count, status); + if (U_FAILURE(status)) { + return count; + } + for (int32_t i = 0; i < count; i++) { + getCharPtr()[position + i] = unistr.charAt(start + i); + getFieldPtr()[position + i] = field; + } + return count; +} + +int32_t NumberStringBuilder::append(const NumberStringBuilder &other, UErrorCode &status) { + return insert(fLength, other, status); +} + +int32_t +NumberStringBuilder::insert(int32_t index, const NumberStringBuilder &other, UErrorCode &status) { + if (this == &other) { + status = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + int32_t count = other.fLength; + if (count == 0) { + // Nothing to insert. + return 0; + } + int32_t position = prepareForInsert(index, count, status); + if (U_FAILURE(status)) { + return count; + } + for (int32_t i = 0; i < count; i++) { + getCharPtr()[position + i] = other.charAt(i); + getFieldPtr()[position + i] = other.fieldAt(i); + } + return count; +} + +int32_t NumberStringBuilder::prepareForInsert(int32_t index, int32_t count, UErrorCode &status) { + if (index == 0 && fZero - count >= 0) { + // Append to start + fZero -= count; + fLength += count; + return fZero; + } else if (index == fLength && fZero + fLength + count < getCapacity()) { + // Append to end + fLength += count; + return fZero + fLength - count; + } else { + // Move chars around and/or allocate more space + return prepareForInsertHelper(index, count, status); + } +} + +int32_t NumberStringBuilder::prepareForInsertHelper(int32_t index, int32_t count, UErrorCode &status) { + int32_t oldCapacity = getCapacity(); + int32_t oldZero = fZero; + char16_t *oldChars = getCharPtr(); + Field *oldFields = getFieldPtr(); + if (fLength + count > oldCapacity) { + int32_t newCapacity = (fLength + count) * 2; + int32_t newZero = newCapacity / 2 - (fLength + count) / 2; + + // C++ note: malloc appears in two places: here and in the assignment operator. + auto newChars = static_cast (uprv_malloc(sizeof(char16_t) * newCapacity)); + auto newFields = static_cast(uprv_malloc(sizeof(Field) * newCapacity)); + if (newChars == nullptr || newFields == nullptr) { + uprv_free(newChars); + uprv_free(newFields); + status = U_MEMORY_ALLOCATION_ERROR; + return -1; + } + + // First copy the prefix and then the suffix, leaving room for the new chars that the + // caller wants to insert. + // C++ note: memcpy is OK because the src and dest do not overlap. + uprv_memcpy2(newChars + newZero, oldChars + oldZero, sizeof(char16_t) * index); + uprv_memcpy2(newChars + newZero + index + count, + oldChars + oldZero + index, + sizeof(char16_t) * (fLength - index)); + uprv_memcpy2(newFields + newZero, oldFields + oldZero, sizeof(Field) * index); + uprv_memcpy2(newFields + newZero + index + count, + oldFields + oldZero + index, + sizeof(Field) * (fLength - index)); + + if (fUsingHeap) { + uprv_free(oldChars); + uprv_free(oldFields); + } + fUsingHeap = true; + fChars.heap.ptr = newChars; + fChars.heap.capacity = newCapacity; + fFields.heap.ptr = newFields; + fFields.heap.capacity = newCapacity; + fZero = newZero; + fLength += count; + } else { + int32_t newZero = oldCapacity / 2 - (fLength + count) / 2; + + // C++ note: memmove is required because src and dest may overlap. + // First copy the entire string to the location of the prefix, and then move the suffix + // to make room for the new chars that the caller wants to insert. + uprv_memmove2(oldChars + newZero, oldChars + oldZero, sizeof(char16_t) * fLength); + uprv_memmove2(oldChars + newZero + index + count, + oldChars + newZero + index, + sizeof(char16_t) * (fLength - index)); + uprv_memmove2(oldFields + newZero, oldFields + oldZero, sizeof(Field) * fLength); + uprv_memmove2(oldFields + newZero + index + count, + oldFields + newZero + index, + sizeof(Field) * (fLength - index)); + + fZero = newZero; + fLength += count; + } + return fZero + index; +} + +UnicodeString NumberStringBuilder::toUnicodeString() const { + return UnicodeString(getCharPtr() + fZero, fLength); +} + +UnicodeString NumberStringBuilder::toDebugString() const { + UnicodeString sb; + sb.append(u"", -1); + return sb; +} + +const char16_t *NumberStringBuilder::chars() const { + return getCharPtr() + fZero; +} + +bool NumberStringBuilder::contentEquals(const NumberStringBuilder &other) const { + if (fLength != other.fLength) { + return false; + } + for (int32_t i = 0; i < fLength; i++) { + if (charAt(i) != other.charAt(i) || fieldAt(i) != other.fieldAt(i)) { + return false; + } + } + return true; +} + +void NumberStringBuilder::populateFieldPosition(FieldPosition &fp, int32_t offset, UErrorCode &status) const { + int32_t rawField = fp.getField(); + + if (rawField == FieldPosition::DONT_CARE) { + return; + } + + if (rawField < 0 || rawField >= UNUM_FIELD_COUNT) { + status = U_ILLEGAL_ARGUMENT_ERROR; + return; + } + + auto field = static_cast(rawField); + + bool seenStart = false; + int32_t fractionStart = -1; + for (int i = fZero; i <= fZero + fLength; i++) { + Field _field = UNUM_FIELD_COUNT; + if (i < fZero + fLength) { + _field = getFieldPtr()[i]; + } + if (seenStart && field != _field) { + // Special case: GROUPING_SEPARATOR counts as an INTEGER. + if (field == UNUM_INTEGER_FIELD && _field == UNUM_GROUPING_SEPARATOR_FIELD) { + continue; + } + fp.setEndIndex(i - fZero + offset); + break; + } else if (!seenStart && field == _field) { + fp.setBeginIndex(i - fZero + offset); + seenStart = true; + } + if (_field == UNUM_INTEGER_FIELD || _field == UNUM_DECIMAL_SEPARATOR_FIELD) { + fractionStart = i - fZero + 1; + } + } + + // Backwards compatibility: FRACTION needs to start after INTEGER if empty + if (field == UNUM_FRACTION_FIELD && !seenStart) { + fp.setBeginIndex(fractionStart + offset); + fp.setEndIndex(fractionStart + offset); + } +} + +void NumberStringBuilder::populateFieldPositionIterator(FieldPositionIterator &fpi, UErrorCode &status) const { + // TODO: Set an initial capacity on uvec? + LocalPointer uvec(new UVector32(status)); + if (U_FAILURE(status)) { + return; + } + + Field current = UNUM_FIELD_COUNT; + int32_t currentStart = -1; + for (int32_t i = 0; i < fLength; i++) { + Field field = fieldAt(i); + if (current == UNUM_INTEGER_FIELD && field == UNUM_GROUPING_SEPARATOR_FIELD) { + // Special case: GROUPING_SEPARATOR counts as an INTEGER. + // Add the field, followed by the start index, followed by the end index to uvec. + uvec->addElement(UNUM_GROUPING_SEPARATOR_FIELD, status); + uvec->addElement(i, status); + uvec->addElement(i + 1, status); + } else if (current != field) { + if (current != UNUM_FIELD_COUNT) { + // Add the field, followed by the start index, followed by the end index to uvec. + uvec->addElement(current, status); + uvec->addElement(currentStart, status); + uvec->addElement(i, status); + } + current = field; + currentStart = i; + } + if (U_FAILURE(status)) { + return; + } + } + if (current != UNUM_FIELD_COUNT) { + // Add the field, followed by the start index, followed by the end index to uvec. + uvec->addElement(current, status); + uvec->addElement(currentStart, status); + uvec->addElement(fLength, status); + } + + // Give uvec to the FieldPositionIterator, which adopts it. + fpi.setData(uvec.orphan(), status); +} + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_stringbuilder.h b/deps/icu-small/source/i18n/number_stringbuilder.h new file mode 100644 index 00000000000000..c94c6288e9bd2e --- /dev/null +++ b/deps/icu-small/source/i18n/number_stringbuilder.h @@ -0,0 +1,139 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_STRINGBUILDER_H__ +#define __NUMBER_STRINGBUILDER_H__ + + +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "unicode/numfmt.h" +#include "unicode/ustring.h" +#include "cstring.h" +#include "uassert.h" +#include "number_types.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +class U_I18N_API NumberStringBuilder : public UMemory { + private: + static const int32_t DEFAULT_CAPACITY = 40; + + template + union ValueOrHeapArray { + T value[DEFAULT_CAPACITY]; + struct { + T *ptr; + int32_t capacity; + } heap; + }; + + public: + NumberStringBuilder(); + + ~NumberStringBuilder(); + + NumberStringBuilder(const NumberStringBuilder &other); + + NumberStringBuilder &operator=(const NumberStringBuilder &other); + + int32_t length() const; + + int32_t codePointCount() const; + + inline char16_t charAt(int32_t index) const { + U_ASSERT(index >= 0); + U_ASSERT(index < fLength); + return getCharPtr()[fZero + index]; + } + + inline Field fieldAt(int32_t index) const { + U_ASSERT(index >= 0); + U_ASSERT(index < fLength); + return getFieldPtr()[fZero + index]; + } + + UChar32 getFirstCodePoint() const; + + UChar32 getLastCodePoint() const; + + UChar32 codePointAt(int32_t index) const; + + UChar32 codePointBefore(int32_t index) const; + + NumberStringBuilder &clear(); + + int32_t appendCodePoint(UChar32 codePoint, Field field, UErrorCode &status); + + int32_t insertCodePoint(int32_t index, UChar32 codePoint, Field field, UErrorCode &status); + + int32_t append(const UnicodeString &unistr, Field field, UErrorCode &status); + + int32_t insert(int32_t index, const UnicodeString &unistr, Field field, UErrorCode &status); + + int32_t insert(int32_t index, const UnicodeString &unistr, int32_t start, int32_t end, Field field, + UErrorCode &status); + + int32_t append(const NumberStringBuilder &other, UErrorCode &status); + + int32_t insert(int32_t index, const NumberStringBuilder &other, UErrorCode &status); + + UnicodeString toUnicodeString() const; + + UnicodeString toDebugString() const; + + const char16_t *chars() const; + + bool contentEquals(const NumberStringBuilder &other) const; + + void populateFieldPosition(FieldPosition &fp, int32_t offset, UErrorCode &status) const; + + void populateFieldPositionIterator(FieldPositionIterator &fpi, UErrorCode &status) const; + + private: + bool fUsingHeap = false; + ValueOrHeapArray fChars; + ValueOrHeapArray fFields; + int32_t fZero = DEFAULT_CAPACITY / 2; + int32_t fLength = 0; + + inline char16_t *getCharPtr() { + return fUsingHeap ? fChars.heap.ptr : fChars.value; + } + + inline const char16_t *getCharPtr() const { + return fUsingHeap ? fChars.heap.ptr : fChars.value; + } + + inline Field *getFieldPtr() { + return fUsingHeap ? fFields.heap.ptr : fFields.value; + } + + inline const Field *getFieldPtr() const { + return fUsingHeap ? fFields.heap.ptr : fFields.value; + } + + inline int32_t getCapacity() const { + return fUsingHeap ? fChars.heap.capacity : DEFAULT_CAPACITY; + } + + int32_t prepareForInsert(int32_t index, int32_t count, UErrorCode &status); + + int32_t prepareForInsertHelper(int32_t index, int32_t count, UErrorCode &status); +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + + +#endif //__NUMBER_STRINGBUILDER_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_types.h b/deps/icu-small/source/i18n/number_types.h new file mode 100644 index 00000000000000..f1c7ba37c4ee0d --- /dev/null +++ b/deps/icu-small/source/i18n/number_types.h @@ -0,0 +1,297 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_TYPES_H__ +#define __NUMBER_TYPES_H__ + +#if __cplusplus < 201000 +#include +#else +#include +#endif +#include "unicode/decimfmt.h" +#include "unicode/unum.h" +#include "unicode/numsys.h" +#include "unicode/numberformatter.h" +#include "unicode/utf16.h" +#include "uassert.h" +#include "unicode/platform.h" + +U_NAMESPACE_BEGIN +namespace number { +namespace impl { + +// Typedef several enums for brevity and for easier comparison to Java. + +typedef UNumberFormatFields Field; + +typedef UNumberFormatRoundingMode RoundingMode; + +typedef UNumberFormatPadPosition PadPosition; + +typedef UNumberCompactStyle CompactStyle; + +// ICU4J Equivalent: RoundingUtils.MAX_INT_FRAC_SIG +static constexpr int32_t kMaxIntFracSig = 100; + +// ICU4J Equivalent: RoundingUtils.DEFAULT_ROUNDING_MODE +static constexpr RoundingMode kDefaultMode = RoundingMode::UNUM_FOUND_HALFEVEN; + +// ICU4J Equivalent: Padder.FALLBACK_PADDING_STRING +static constexpr char16_t kFallbackPaddingString[] = u" "; + +// ICU4J Equivalent: NumberFormatterImpl.DEFAULT_CURRENCY +static constexpr char16_t kDefaultCurrency[] = u"XXX"; + +// FIXME: New error codes: +static constexpr UErrorCode U_NUMBER_DIGIT_WIDTH_OUTOFBOUNDS_ERROR = U_ILLEGAL_ARGUMENT_ERROR; +static constexpr UErrorCode U_NUMBER_PADDING_WIDTH_OUTOFBOUNDS_ERROR = U_ILLEGAL_ARGUMENT_ERROR; + +// Forward declarations: + +class Modifier; +class MutablePatternModifier; +class DecimalQuantity; +class NumberStringBuilder; +struct MicroProps; + + +enum AffixPatternType { + // Represents a literal character; the value is stored in the code point field. + TYPE_CODEPOINT = 0, + + // Represents a minus sign symbol '-'. + TYPE_MINUS_SIGN = -1, + + // Represents a plus sign symbol '+'. + TYPE_PLUS_SIGN = -2, + + // Represents a percent sign symbol '%'. + TYPE_PERCENT = -3, + + // Represents a permille sign symbol '‰'. + TYPE_PERMILLE = -4, + + // Represents a single currency symbol '¤'. + TYPE_CURRENCY_SINGLE = -5, + + // Represents a double currency symbol '¤¤'. + TYPE_CURRENCY_DOUBLE = -6, + + // Represents a triple currency symbol '¤¤¤'. + TYPE_CURRENCY_TRIPLE = -7, + + // Represents a quadruple currency symbol '¤¤¤¤'. + TYPE_CURRENCY_QUAD = -8, + + // Represents a quintuple currency symbol '¤¤¤¤¤'. + TYPE_CURRENCY_QUINT = -9, + + // Represents a sequence of six or more currency symbols. + TYPE_CURRENCY_OVERFLOW = -15 +}; + +enum CompactType { + TYPE_DECIMAL, + TYPE_CURRENCY +}; + + +// TODO: Should this be moved somewhere else, maybe where other ICU classes can use it? +// Exported as U_I18N_API because it is a base class for other exported types +class U_I18N_API CharSequence { +public: + virtual ~CharSequence() = default; + + virtual int32_t length() const = 0; + + virtual char16_t charAt(int32_t index) const = 0; + + virtual UChar32 codePointAt(int32_t index) const { + // Default implementation; can be overridden with a more efficient version + char16_t leading = charAt(index); + if (U16_IS_LEAD(leading) && length() > index + 1) { + char16_t trailing = charAt(index + 1); + return U16_GET_SUPPLEMENTARY(leading, trailing); + } else { + return leading; + } + } + + virtual UnicodeString toUnicodeString() const = 0; +}; + +class U_I18N_API AffixPatternProvider { + public: + static const int32_t AFFIX_PLURAL_MASK = 0xff; + static const int32_t AFFIX_PREFIX = 0x100; + static const int32_t AFFIX_NEGATIVE_SUBPATTERN = 0x200; + static const int32_t AFFIX_PADDING = 0x400; + + virtual ~AffixPatternProvider() = default; + + virtual char16_t charAt(int flags, int i) const = 0; + + virtual int length(int flags) const = 0; + + virtual bool hasCurrencySign() const = 0; + + virtual bool positiveHasPlusSign() const = 0; + + virtual bool hasNegativeSubpattern() const = 0; + + virtual bool negativeHasMinusSign() const = 0; + + virtual bool containsSymbolType(AffixPatternType, UErrorCode &) const = 0; +}; + +/** + * A Modifier is an object that can be passed through the formatting pipeline until it is finally applied to the string + * builder. A Modifier usually contains a prefix and a suffix that are applied, but it could contain something else, + * like a {@link com.ibm.icu.text.SimpleFormatter} pattern. + * + * A Modifier is usually immutable, except in cases such as {@link MurkyModifier}, which are mutable for performance + * reasons. + * + * Exported as U_I18N_API because it is a base class for other exported types + */ +class U_I18N_API Modifier { + public: + virtual ~Modifier() = default; + + /** + * Apply this Modifier to the string builder. + * + * @param output + * The string builder to which to apply this modifier. + * @param leftIndex + * The left index of the string within the builder. Equal to 0 when only one number is being formatted. + * @param rightIndex + * The right index of the string within the string builder. Equal to length when only one number is being + * formatted. + * @return The number of characters (UTF-16 code units) that were added to the string builder. + */ + virtual int32_t + apply(NumberStringBuilder &output, int leftIndex, int rightIndex, UErrorCode &status) const = 0; + + /** + * Gets the length of the prefix. This information can be used in combination with {@link #apply} to extract the + * prefix and suffix strings. + * + * @return The number of characters (UTF-16 code units) in the prefix. + */ + virtual int32_t getPrefixLength(UErrorCode& status) const = 0; + + /** + * Returns the number of code points in the modifier, prefix plus suffix. + */ + virtual int32_t getCodePointCount(UErrorCode &status) const = 0; + + /** + * Whether this modifier is strong. If a modifier is strong, it should always be applied immediately and not allowed + * to bubble up. With regard to padding, strong modifiers are considered to be on the inside of the prefix and + * suffix. + * + * @return Whether the modifier is strong. + */ + virtual bool isStrong() const = 0; +}; + +/** + * This interface is used when all number formatting settings, including the locale, are known, except for the quantity + * itself. The {@link #processQuantity} method performs the final step in the number processing pipeline: it uses the + * quantity to generate a finalized {@link MicroProps}, which can be used to render the number to output. + * + *

+ * In other words, this interface is used for the parts of number processing that are quantity-dependent. + * + *

+ * In order to allow for multiple different objects to all mutate the same MicroProps, a "chain" of MicroPropsGenerators + * are linked together, and each one is responsible for manipulating a certain quantity-dependent part of the + * MicroProps. At the tail of the linked list is a base instance of {@link MicroProps} with properties that are not + * quantity-dependent. Each element in the linked list calls {@link #processQuantity} on its "parent", then does its + * work, and then returns the result. + * + * Exported as U_I18N_API because it is a base class for other exported types + * + */ +class U_I18N_API MicroPropsGenerator { + public: + virtual ~MicroPropsGenerator() = default; + + /** + * Considers the given {@link DecimalQuantity}, optionally mutates it, and returns a {@link MicroProps}. + * + * @param quantity + * The quantity for consideration and optional mutation. + * @param micros + * The MicroProps instance to populate. + * @return A MicroProps instance resolved for the quantity. + */ + virtual void processQuantity(DecimalQuantity& quantity, MicroProps& micros, UErrorCode& status) const = 0; +}; + +class MultiplierProducer { + public: + virtual ~MultiplierProducer() = default; + + virtual int32_t getMultiplier(int32_t magnitude) const = 0; +}; + +// Exported as U_I18N_API because it is a public member field of exported DecimalFormatProperties +template +class U_I18N_API NullableValue { + public: + NullableValue() : fNull(true) {} + + NullableValue(const NullableValue &other) = default; + + explicit NullableValue(const T &other) { + fValue = other; + fNull = false; + } + + NullableValue &operator=(const NullableValue &other) = default; + + NullableValue &operator=(const T &other) { + fValue = other; + fNull = false; + return *this; + } + + bool operator==(const NullableValue &other) const { + // "fValue == other.fValue" returns UBool, not bool (causes compiler warnings) + return fNull ? other.fNull : (other.fNull ? false : static_cast(fValue == other.fValue)); + } + + void nullify() { + // TODO: It might be nice to call the destructor here. + fNull = true; + } + + bool isNull() const { + return fNull; + } + + T get(UErrorCode &status) const { + if (fNull) { + status = U_UNDEFINED_VARIABLE; + } + return fValue; + } + + private: + bool fNull; + T fValue; +}; + +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_TYPES_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/number_utils.h b/deps/icu-small/source/i18n/number_utils.h new file mode 100644 index 00000000000000..3a408d6007a2cd --- /dev/null +++ b/deps/icu-small/source/i18n/number_utils.h @@ -0,0 +1,130 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT +#ifndef __NUMBER_UTILS_H__ +#define __NUMBER_UTILS_H__ + +#include "unicode/numberformatter.h" +#include "number_types.h" +#include "number_decimalquantity.h" +#include "number_scientific.h" +#include "number_patternstring.h" +#include "number_modifiers.h" + +U_NAMESPACE_BEGIN namespace number { +namespace impl { + +class UnicodeStringCharSequence : public CharSequence { + public: + explicit UnicodeStringCharSequence(const UnicodeString &other) { + fStr = other; + } + + ~UnicodeStringCharSequence() U_OVERRIDE = default; + + int32_t length() const U_OVERRIDE { + return fStr.length(); + } + + char16_t charAt(int32_t index) const U_OVERRIDE { + return fStr.charAt(index); + } + + UChar32 codePointAt(int32_t index) const U_OVERRIDE { + return fStr.char32At(index); + } + + UnicodeString toUnicodeString() const U_OVERRIDE { + // Allocate a UnicodeString of the correct length + UnicodeString output(length(), 0, -1); + for (int32_t i = 0; i < length(); i++) { + output.append(charAt(i)); + } + return output; + } + + private: + UnicodeString fStr; +}; + +struct MicroProps : public MicroPropsGenerator { + + // NOTE: All of these fields are properly initialized in NumberFormatterImpl. + Rounder rounding; + Grouper grouping; + Padder padding; + IntegerWidth integerWidth; + UNumberSignDisplay sign; + UNumberDecimalSeparatorDisplay decimal; + bool useCurrency; + + // Note: This struct has no direct ownership of the following pointers. + const DecimalFormatSymbols *symbols; + const Modifier *modOuter; + const Modifier *modMiddle; + const Modifier *modInner; + + // The following "helper" fields may optionally be used during the MicroPropsGenerator. + // They live here to retain memory. + struct { + ScientificModifier scientificModifier; + EmptyModifier emptyWeakModifier{false}; + EmptyModifier emptyStrongModifier{true}; + } helpers; + + + MicroProps() = default; + + MicroProps(const MicroProps &other) = default; + + MicroProps &operator=(const MicroProps &other) = default; + + void processQuantity(DecimalQuantity &, MicroProps µs, UErrorCode &status) const U_OVERRIDE { + (void)status; + if (this == µs) { + // Unsafe path: no need to perform a copy. + U_ASSERT(!exhausted); + micros.exhausted = true; + U_ASSERT(exhausted); + } else { + // Safe path: copy self into the output micros. + micros = *this; + } + } + + private: + // Internal fields: + bool exhausted = false; +}; + +/** + * This struct provides the result of the number formatting pipeline to FormattedNumber. + * + * The DecimalQuantity is not currently being used by FormattedNumber, but at some point it could be used + * to add a toDecNumber() or similar method. + */ +struct NumberFormatterResults : public UMemory { + DecimalQuantity quantity; + NumberStringBuilder string; +}; + +inline const UnicodeString getDigitFromSymbols(int8_t digit, const DecimalFormatSymbols &symbols) { + // TODO: Implement DecimalFormatSymbols.getCodePointZero()? + if (digit == 0) { + return symbols.getSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kZeroDigitSymbol); + } else { + return symbols.getSymbol(static_cast( + DecimalFormatSymbols::ENumberFormatSymbol::kOneDigitSymbol + digit - 1)); + } +} + +} // namespace impl +} // namespace number +U_NAMESPACE_END + +#endif //__NUMBER_UTILS_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/numfmt.cpp b/deps/icu-small/source/i18n/numfmt.cpp index c00955a781a22e..fee3bed8bfb352 100644 --- a/deps/icu-small/source/i18n/numfmt.cpp +++ b/deps/icu-small/source/i18n/numfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -529,7 +529,7 @@ UnicodeString& NumberFormat::format(const DigitList &number, FieldPositionIterator* posIter, UErrorCode& status) const { // DecimalFormat overrides this function, and handles DigitList based big decimals. - // Other subclasses (ChoiceFormat, RuleBasedNumberFormat) do not (yet) handle DigitLists, + // Other subclasses (ChoiceFormat) do not (yet) handle DigitLists, // so this default implementation falls back to formatting decimal numbers as doubles. if (U_FAILURE(status)) { return appendTo; @@ -547,7 +547,7 @@ NumberFormat::format(const DigitList &number, FieldPosition& pos, UErrorCode &status) const { // DecimalFormat overrides this function, and handles DigitList based big decimals. - // Other subclasses (ChoiceFormat, RuleBasedNumberFormat) do not (yet) handle DigitLists, + // Other subclasses (ChoiceFormat) do not (yet) handle DigitLists, // so this default implementation falls back to formatting decimal numbers as doubles. if (U_FAILURE(status)) { return appendTo; @@ -1188,7 +1188,7 @@ void NumberFormat::setCurrency(const UChar* theCurrency, UErrorCode& ec) { } } -const UChar* NumberFormat::getCurrency() const { +const char16_t* NumberFormat::getCurrency() const { return fCurrency; } @@ -1509,6 +1509,24 @@ NumberFormat::makeInstance(const Locale& desiredLocale, return f; } +/** + * Get the rounding mode. + * @return A rounding mode + */ +NumberFormat::ERoundingMode NumberFormat::getRoundingMode() const { + // Default value. ICU4J throws an exception and we can't change this API. + return NumberFormat::ERoundingMode::kRoundUnnecessary; +} + +/** + * Set the rounding mode. This has no effect unless the rounding + * increment is greater than zero. + * @param roundingMode A rounding mode + */ +void NumberFormat::setRoundingMode(NumberFormat::ERoundingMode /*roundingMode*/) { + // No-op ICU4J throws an exception, and we can't change this API. +} + U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/numsys.cpp b/deps/icu-small/source/i18n/numsys.cpp index 442ad7f255abe3..087dd277eb4dd8 100644 --- a/deps/icu-small/source/i18n/numsys.cpp +++ b/deps/icu-small/source/i18n/numsys.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -25,6 +25,7 @@ #include "unicode/schriter.h" #include "unicode/numsys.h" #include "cstring.h" +#include "uassert.h" #include "uresimp.h" #include "numsys_impl.h" @@ -115,7 +116,13 @@ NumberingSystem::createInstance(const Locale & inLocale, UErrorCode& status) { UBool usingFallback = FALSE; char buffer[ULOC_KEYWORDS_CAPACITY]; int32_t count = inLocale.getKeywordValue("numbers",buffer, sizeof(buffer),status); + if (U_FAILURE(status) || status == U_STRING_NOT_TERMINATED_WARNING) { + // the "numbers" keyword exceeds ULOC_KEYWORDS_CAPACITY; ignore and use default. + count = 0; + status = U_ZERO_ERROR; + } if ( count > 0 ) { // @numbers keyword was specified in the locale + U_ASSERT(count < ULOC_KEYWORDS_CAPACITY); buffer[count] = '\0'; // Make sure it is null terminated. if ( !uprv_strcmp(buffer,gDefault) || !uprv_strcmp(buffer,gNative) || !uprv_strcmp(buffer,gTraditional) || !uprv_strcmp(buffer,gFinance)) { @@ -230,7 +237,7 @@ void NumberingSystem::setAlgorithmic(UBool c) { algorithmic = c; } -void NumberingSystem::setDesc(UnicodeString d) { +void NumberingSystem::setDesc(const UnicodeString &d) { desc.setTo(d); } void NumberingSystem::setName(const char *n) { diff --git a/deps/icu-small/source/i18n/numsys_impl.h b/deps/icu-small/source/i18n/numsys_impl.h index d39faba5afa3a9..6385fa5408a152 100644 --- a/deps/icu-small/source/i18n/numsys_impl.h +++ b/deps/icu-small/source/i18n/numsys_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/olsontz.cpp b/deps/icu-small/source/i18n/olsontz.cpp index f4c3dd24c9273f..df025c0808388e 100644 --- a/deps/icu-small/source/i18n/olsontz.cpp +++ b/deps/icu-small/source/i18n/olsontz.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/olsontz.h b/deps/icu-small/source/i18n/olsontz.h index 7dbc303a05fa68..6f0d36e5de5db0 100644 --- a/deps/icu-small/source/i18n/olsontz.h +++ b/deps/icu-small/source/i18n/olsontz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/persncal.cpp b/deps/icu-small/source/i18n/persncal.cpp index 210646ca8c22ca..3d391f4e3fbe8e 100644 --- a/deps/icu-small/source/i18n/persncal.cpp +++ b/deps/icu-small/source/i18n/persncal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -213,7 +213,7 @@ void PersianCalendar::handleComputeFields(int32_t julianDay, UErrorCode &/*statu int32_t year, month, dayOfMonth, dayOfYear; int32_t daysSinceEpoch = julianDay - PERSIAN_EPOCH; - year = 1 + ClockMath::floorDivide(33 * daysSinceEpoch + 3, 12053); + year = 1 + (int32_t)ClockMath::floorDivide(33 * (int64_t)daysSinceEpoch + 3, (int64_t)12053); int32_t farvardin1 = 365 * (year - 1) + ClockMath::floorDivide(8 * year + 21, 33); dayOfYear = (daysSinceEpoch - farvardin1); // 0-based diff --git a/deps/icu-small/source/i18n/persncal.h b/deps/icu-small/source/i18n/persncal.h index 3fe5a614643416..ec818822b33a41 100644 --- a/deps/icu-small/source/i18n/persncal.h +++ b/deps/icu-small/source/i18n/persncal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/pluralaffix.cpp b/deps/icu-small/source/i18n/pluralaffix.cpp index f6a51a79ef9ab7..ea400206b38b81 100644 --- a/deps/icu-small/source/i18n/pluralaffix.cpp +++ b/deps/icu-small/source/i18n/pluralaffix.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/pluralaffix.h b/deps/icu-small/source/i18n/pluralaffix.h index a08f2131d96ee6..94366ce4cf81ec 100644 --- a/deps/icu-small/source/i18n/pluralaffix.h +++ b/deps/icu-small/source/i18n/pluralaffix.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/plurfmt.cpp b/deps/icu-small/source/i18n/plurfmt.cpp index 8a000ce6e97bd9..e14ef6d831ecce 100644 --- a/deps/icu-small/source/i18n/plurfmt.cpp +++ b/deps/icu-small/source/i18n/plurfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/plurrule.cpp b/deps/icu-small/source/i18n/plurrule.cpp index 7b5063455169ce..6733a23e00362f 100644 --- a/deps/icu-small/source/i18n/plurrule.cpp +++ b/deps/icu-small/source/i18n/plurrule.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -17,6 +17,8 @@ #include "unicode/plurrule.h" #include "unicode/upluralrules.h" #include "unicode/ures.h" +#include "unicode/numfmt.h" +#include "unicode/decimfmt.h" #include "charstr.h" #include "cmemory.h" #include "cstring.h" @@ -36,7 +38,6 @@ #include "digitinterval.h" #include "visibledigits.h" - #if !UCONFIG_NO_FORMATTING U_NAMESPACE_BEGIN @@ -247,7 +248,27 @@ PluralRules::select(double number) const { } UnicodeString -PluralRules::select(const FixedDecimal &number) const { +PluralRules::select(const Formattable& obj, const NumberFormat& fmt, UErrorCode& status) const { + if (U_SUCCESS(status)) { + const DecimalFormat *decFmt = dynamic_cast(&fmt); + if (decFmt != NULL) { + VisibleDigitsWithExponent digits; + decFmt->initVisibleDigitsWithExponent(obj, digits, status); + if (U_SUCCESS(status)) { + return select(digits); + } + } else { + double number = obj.getDouble(status); + if (U_SUCCESS(status)) { + return select(number); + } + } + } + return UnicodeString(); +} + +UnicodeString +PluralRules::select(const IFixedDecimal &number) const { if (mRules == NULL) { return UnicodeString(TRUE, PLURAL_DEFAULT_RULE, -1); } @@ -762,15 +783,17 @@ AndConstraint::~AndConstraint() { UBool -AndConstraint::isFulfilled(const FixedDecimal &number) { +AndConstraint::isFulfilled(const IFixedDecimal &number) { UBool result = TRUE; if (digitsType == none) { // An empty AndConstraint, created by a rule with a keyword but no following expression. return TRUE; } - double n = number.get(digitsType); // pulls n | i | v | f value for the number. - // Will always be positive. - // May be non-integer (n option only) + + PluralOperand operand = tokenTypeToPluralOperand(digitsType); + double n = number.getPluralOperand(operand); // pulls n | i | v | f value for the number. + // Will always be positive. + // May be non-integer (n option only) do { if (integerOnly && n != uprv_floor(n)) { result = FALSE; @@ -852,7 +875,7 @@ OrConstraint::add() } UBool -OrConstraint::isFulfilled(const FixedDecimal &number) { +OrConstraint::isFulfilled(const IFixedDecimal &number) { OrConstraint* orRule=this; UBool result=FALSE; @@ -893,8 +916,8 @@ RuleChain::~RuleChain() { UnicodeString -RuleChain::select(const FixedDecimal &number) const { - if (!number.isNanOrInfinity) { +RuleChain::select(const IFixedDecimal &number) const { + if (!number.isNaN() && !number.isInfinite()) { for (const RuleChain *rules = this; rules != NULL; rules = rules->fNext) { if (rules->ruleHeader->isFulfilled(number)) { return rules->fKeyword; @@ -1384,13 +1407,34 @@ PluralKeywordEnumeration::count(UErrorCode& /*status*/) const { PluralKeywordEnumeration::~PluralKeywordEnumeration() { } +PluralOperand tokenTypeToPluralOperand(tokenType tt) { + switch(tt) { + case tVariableN: + return PLURAL_OPERAND_N; + case tVariableI: + return PLURAL_OPERAND_I; + case tVariableF: + return PLURAL_OPERAND_F; + case tVariableV: + return PLURAL_OPERAND_V; + case tVariableT: + return PLURAL_OPERAND_T; + default: + U_ASSERT(FALSE); // unexpected. + return PLURAL_OPERAND_N; + } +} + +IFixedDecimal::~IFixedDecimal() = default; + FixedDecimal::FixedDecimal(const VisibleDigits &digits) { digits.getFixedDecimal( source, intValue, decimalDigits, decimalDigitsWithoutTrailingZeros, visibleDecimalDigitCount, hasIntegerValue); isNegative = digits.isNegative(); - isNanOrInfinity = digits.isNaNOrInfinity(); + _isNaN = digits.isNaN(); + _isInfinite = digits.isInfinite(); } FixedDecimal::FixedDecimal(double n, int32_t v, int64_t f) { @@ -1455,9 +1499,12 @@ FixedDecimal::FixedDecimal(const FixedDecimal &other) { intValue = other.intValue; hasIntegerValue = other.hasIntegerValue; isNegative = other.isNegative; - isNanOrInfinity = other.isNanOrInfinity; + _isNaN = other._isNaN; + _isInfinite = other._isInfinite; } +FixedDecimal::~FixedDecimal() = default; + void FixedDecimal::init(double n) { int32_t numFractionDigits = decimals(n); @@ -1468,8 +1515,9 @@ void FixedDecimal::init(double n) { void FixedDecimal::init(double n, int32_t v, int64_t f) { isNegative = n < 0.0; source = fabs(n); - isNanOrInfinity = uprv_isNaN(source) || uprv_isPositiveInfinity(source); - if (isNanOrInfinity) { + _isNaN = uprv_isNaN(source); + _isInfinite = uprv_isInfinite(source); + if (_isNaN || _isInfinite) { v = 0; f = 0; intValue = 0; @@ -1589,19 +1637,31 @@ void FixedDecimal::adjustForMinFractionDigits(int32_t minFractionDigits) { } -double FixedDecimal::get(tokenType operand) const { +double FixedDecimal::getPluralOperand(PluralOperand operand) const { switch(operand) { - case tVariableN: return source; - case tVariableI: return (double)intValue; - case tVariableF: return (double)decimalDigits; - case tVariableT: return (double)decimalDigitsWithoutTrailingZeros; - case tVariableV: return visibleDecimalDigitCount; + case PLURAL_OPERAND_N: return source; + case PLURAL_OPERAND_I: return static_cast(intValue); + case PLURAL_OPERAND_F: return static_cast(decimalDigits); + case PLURAL_OPERAND_T: return static_cast(decimalDigitsWithoutTrailingZeros); + case PLURAL_OPERAND_V: return visibleDecimalDigitCount; default: U_ASSERT(FALSE); // unexpected. return source; } } +bool FixedDecimal::isNaN() const { + return _isNaN; +} + +bool FixedDecimal::isInfinite() const { + return _isInfinite; +} + +bool FixedDecimal::isNanOrInfinity() const { + return _isNaN || _isInfinite; +} + int32_t FixedDecimal::getVisibleFractionDigitCount() const { return visibleDecimalDigitCount; } @@ -1644,7 +1704,7 @@ const char *PluralAvailableLocalesEnumeration::next(int32_t *resultLength, UErro } const char *result = ures_getKey(fRes); if (resultLength != NULL) { - *resultLength = uprv_strlen(result); + *resultLength = static_cast(uprv_strlen(result)); } return result; } diff --git a/deps/icu-small/source/i18n/plurrule_impl.h b/deps/icu-small/source/i18n/plurrule_impl.h index c6e4767a096a72..b93fc501baced2 100644 --- a/deps/icu-small/source/i18n/plurrule_impl.h +++ b/deps/icu-small/source/i18n/plurrule_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -24,9 +24,11 @@ #include "unicode/format.h" #include "unicode/locid.h" #include "unicode/parseerr.h" +#include "unicode/strenum.h" #include "unicode/ures.h" #include "uvector.h" #include "hash.h" +#include "uassert.h" class PluralRulesTest; @@ -176,6 +178,74 @@ class PluralRuleParser: public UMemory { }; +enum PluralOperand { + /** + * The double value of the entire number. + */ + PLURAL_OPERAND_N, + + /** + * The integer value, with the fraction digits truncated off. + */ + PLURAL_OPERAND_I, + + /** + * All visible fraction digits as an integer, including trailing zeros. + */ + PLURAL_OPERAND_F, + + /** + * Visible fraction digits as an integer, not including trailing zeros. + */ + PLURAL_OPERAND_T, + + /** + * Number of visible fraction digits. + */ + PLURAL_OPERAND_V, + + /** + * Number of visible fraction digits, not including trailing zeros. + */ + PLURAL_OPERAND_W, + + /** + * THIS OPERAND IS DEPRECATED AND HAS BEEN REMOVED FROM THE SPEC. + * + *

Returns the integer value, but will fail if the number has fraction digits. + * That is, using "j" instead of "i" is like implicitly adding "v is 0". + * + *

For example, "j is 3" is equivalent to "i is 3 and v is 0": it matches + * "3" but not "3.1" or "3.0". + */ + PLURAL_OPERAND_J +}; + +/** + * Converts from the tokenType enum to PluralOperand. Asserts that the given + * tokenType can be mapped to a PluralOperand. + */ +PluralOperand tokenTypeToPluralOperand(tokenType tt); + +/** + * An interface to FixedDecimal, allowing for other implementations. + * @internal + */ +class U_I18N_API IFixedDecimal { + public: + virtual ~IFixedDecimal(); + + /** + * Returns the value corresponding to the specified operand (n, i, f, t, v, or w). + * If the operand is 'n', returns a double; otherwise, returns an integer. + */ + virtual double getPluralOperand(PluralOperand operand) const = 0; + + virtual bool isNaN() const = 0; + + virtual bool isInfinite() const = 0; +}; + /** * class FixedDecimal serves to communicate the properties * of a formatted number from a decimal formatter to PluralRules::select() @@ -183,7 +253,7 @@ class PluralRuleParser: public UMemory { * see DecimalFormat::getFixedDecimal() * @internal */ -class U_I18N_API FixedDecimal: public UMemory { +class U_I18N_API FixedDecimal: public IFixedDecimal, public UObject { public: /** * @param n the number, e.g. 12.345 @@ -195,10 +265,16 @@ class U_I18N_API FixedDecimal: public UMemory { explicit FixedDecimal(double n); explicit FixedDecimal(const VisibleDigits &n); FixedDecimal(); + ~FixedDecimal() U_OVERRIDE; FixedDecimal(const UnicodeString &s, UErrorCode &ec); FixedDecimal(const FixedDecimal &other); - double get(tokenType operand) const; + double getPluralOperand(PluralOperand operand) const U_OVERRIDE; + bool isNaN() const U_OVERRIDE; + bool isInfinite() const U_OVERRIDE; + + bool isNanOrInfinity() const; // used in decimfmtimpl.cpp + int32_t getVisibleFractionDigitCount() const; void init(double n, int32_t v, int64_t f); @@ -216,7 +292,8 @@ class U_I18N_API FixedDecimal: public UMemory { int64_t intValue; UBool hasIntegerValue; UBool isNegative; - UBool isNanOrInfinity; + UBool _isNaN; + UBool _isInfinite; }; class AndConstraint : public UMemory { @@ -239,7 +316,7 @@ class AndConstraint : public UMemory { virtual ~AndConstraint(); AndConstraint* add(); // UBool isFulfilled(double number); - UBool isFulfilled(const FixedDecimal &number); + UBool isFulfilled(const IFixedDecimal &number); }; class OrConstraint : public UMemory { @@ -252,7 +329,7 @@ class OrConstraint : public UMemory { virtual ~OrConstraint(); AndConstraint* add(); // UBool isFulfilled(double number); - UBool isFulfilled(const FixedDecimal &number); + UBool isFulfilled(const IFixedDecimal &number); }; class RuleChain : public UMemory { @@ -270,7 +347,7 @@ class RuleChain : public UMemory { RuleChain(const RuleChain& other); virtual ~RuleChain(); - UnicodeString select(const FixedDecimal &number) const; + UnicodeString select(const IFixedDecimal &number) const; void dumpRules(UnicodeString& result); UErrorCode getKeywords(int32_t maxArraySize, UnicodeString *keywords, int32_t& arraySize) const; UBool isKeyword(const UnicodeString& keyword) const; diff --git a/deps/icu-small/source/i18n/precision.cpp b/deps/icu-small/source/i18n/precision.cpp index 5d07e0f9ee3d78..97dc13dc385651 100644 --- a/deps/icu-small/source/i18n/precision.cpp +++ b/deps/icu-small/source/i18n/precision.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines @@ -239,10 +239,10 @@ FixedPrecision::initVisibleDigits( } } // Try fast path - if (n >= 0 && initVisibleDigits(scaled, -n, digits, status)) { + if (n >= 0 && initVisibleDigits(static_cast(scaled), -n, digits, status)) { digits.fAbsDoubleValue = fabs(value); digits.fAbsDoubleValueSet = U_SUCCESS(status) && !digits.isOverMaxDigits(); - // Adjust for negative 0 becuase when we cast to an int64, + // Adjust for negative 0 because when we cast to an int64, // negative 0 becomes positive 0. if (scaled == 0.0 && uprv_isNegative(scaled)) { digits.setNegative(); diff --git a/deps/icu-small/source/i18n/precision.h b/deps/icu-small/source/i18n/precision.h index f002fd228bf77d..0598fa17d62771 100644 --- a/deps/icu-small/source/i18n/precision.h +++ b/deps/icu-small/source/i18n/precision.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/quant.cpp b/deps/icu-small/source/i18n/quant.cpp index 6e08e628fc2e10..1908a504846b07 100644 --- a/deps/icu-small/source/i18n/quant.cpp +++ b/deps/icu-small/source/i18n/quant.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/quant.h b/deps/icu-small/source/i18n/quant.h index 21adf19e70d87a..1abb0db61aa386 100644 --- a/deps/icu-small/source/i18n/quant.h +++ b/deps/icu-small/source/i18n/quant.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/quantityformatter.cpp b/deps/icu-small/source/i18n/quantityformatter.cpp index c44357a53b6908..208e064700ab2b 100644 --- a/deps/icu-small/source/i18n/quantityformatter.cpp +++ b/deps/icu-small/source/i18n/quantityformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/quantityformatter.h b/deps/icu-small/source/i18n/quantityformatter.h index 0f61022666531b..6698b7a8a028fd 100644 --- a/deps/icu-small/source/i18n/quantityformatter.h +++ b/deps/icu-small/source/i18n/quantityformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/rbnf.cpp b/deps/icu-small/source/i18n/rbnf.cpp index 5e32d804441dbf..5b54e303f3ab20 100644 --- a/deps/icu-small/source/i18n/rbnf.cpp +++ b/deps/icu-small/source/i18n/rbnf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -27,12 +27,14 @@ #include "unicode/udata.h" #include "unicode/udisplaycontext.h" #include "unicode/brkiter.h" -#include "nfrs.h" +#include "unicode/ucasemap.h" #include "cmemory.h" #include "cstring.h" #include "patternprops.h" #include "uresimp.h" +#include "nfrs.h" +#include "digitlst.h" // debugging // #define RBNF_DEBUG @@ -314,13 +316,33 @@ class LocDataParser { private: - void inc(void) { ++p; ch = 0xffff; } - UBool checkInc(UChar c) { if (p < e && (ch == c || *p == c)) { inc(); return TRUE; } return FALSE; } - UBool check(UChar c) { return p < e && (ch == c || *p == c); } - void skipWhitespace(void) { while (p < e && PatternProps::isWhiteSpace(ch != 0xffff ? ch : *p)) inc();} - UBool inList(UChar c, const UChar* list) const { - if (*list == SPACE && PatternProps::isWhiteSpace(c)) return TRUE; - while (*list && *list != c) ++list; return *list == c; + inline void inc(void) { + ++p; + ch = 0xffff; + } + inline UBool checkInc(UChar c) { + if (p < e && (ch == c || *p == c)) { + inc(); + return TRUE; + } + return FALSE; + } + inline UBool check(UChar c) { + return p < e && (ch == c || *p == c); + } + inline void skipWhitespace(void) { + while (p < e && PatternProps::isWhiteSpace(ch != 0xffff ? ch : *p)) { + inc(); + } + } + inline UBool inList(UChar c, const UChar* list) const { + if (*list == SPACE && PatternProps::isWhiteSpace(c)) { + return TRUE; + } + while (*list && *list != c) { + ++list; + } + return *list == c; } void parseError(const char* msg); @@ -665,6 +687,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(const UnicodeString& description, , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -689,6 +712,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(const UnicodeString& description, , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -713,6 +737,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(const UnicodeString& description, , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -736,6 +761,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(const UnicodeString& description, , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -760,6 +786,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(const UnicodeString& description, , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -781,6 +808,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(URBNFRuleSetTag tag, const Locale& , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -847,6 +875,7 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(const RuleBasedNumberFormat& rhs) , decimalFormatSymbols(NULL) , defaultInfinityRule(NULL) , defaultNaNRule(NULL) + , roundingMode(DecimalFormat::ERoundingMode::kRoundUnnecessary) , lenient(FALSE) , lenientParseRules(NULL) , localizations(NULL) @@ -876,6 +905,7 @@ RuleBasedNumberFormat::operator=(const RuleBasedNumberFormat& rhs) setDecimalFormatSymbols(*rhs.getDecimalFormatSymbols()); init(rhs.originalDescription, rhs.localizations ? rhs.localizations->ref() : NULL, perror, status); setDefaultRuleSet(rhs.getDefaultRuleSetName(), status); + setRoundingMode(rhs.getRoundingMode()); capitalizationInfoSet = rhs.capitalizationInfoSet; capitalizationForUIListMenu = rhs.capitalizationForUIListMenu; @@ -1078,18 +1108,77 @@ RuleBasedNumberFormat::findRuleSet(const UnicodeString& name, UErrorCode& status return NULL; } +UnicodeString& +RuleBasedNumberFormat::format(const DigitList &number, + UnicodeString &appendTo, + FieldPositionIterator *posIter, + UErrorCode &status) const { + if (U_FAILURE(status)) { + return appendTo; + } + DigitList copy(number); + if (copy.fitsIntoInt64(false)) { + format(((DigitList &)number).getInt64(), appendTo, posIter, status); + } + else { + copy.roundAtExponent(0); + if (copy.fitsIntoInt64(false)) { + format(number.getDouble(), appendTo, posIter, status); + } + else { + // We're outside of our normal range that this framework can handle. + // The DecimalFormat will provide more accurate results. + + // TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J. + NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status); + Formattable f; + f.adoptDigitList(new DigitList(number)); + decimalFormat->format(f, appendTo, posIter, status); + delete decimalFormat; + } + } + return appendTo; +} + + +UnicodeString& +RuleBasedNumberFormat::format(const DigitList &number, + UnicodeString& appendTo, + FieldPosition& pos, + UErrorCode &status) const { + if (U_FAILURE(status)) { + return appendTo; + } + DigitList copy(number); + if (copy.fitsIntoInt64(false)) { + format(((DigitList &)number).getInt64(), appendTo, pos, status); + } + else { + copy.roundAtExponent(0); + if (copy.fitsIntoInt64(false)) { + format(number.getDouble(), appendTo, pos, status); + } + else { + // We're outside of our normal range that this framework can handle. + // The DecimalFormat will provide more accurate results. + + // TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J. + NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status); + Formattable f; + f.adoptDigitList(new DigitList(number)); + decimalFormat->format(f, appendTo, pos, status); + delete decimalFormat; + } + } + return appendTo; +} + UnicodeString& RuleBasedNumberFormat::format(int32_t number, UnicodeString& toAppendTo, - FieldPosition& /* pos */) const + FieldPosition& pos) const { - if (defaultRuleSet) { - UErrorCode status = U_ZERO_ERROR; - int32_t startPos = toAppendTo.length(); - defaultRuleSet->format((int64_t)number, toAppendTo, toAppendTo.length(), 0, status); - adjustForCapitalizationContext(startPos, toAppendTo); - } - return toAppendTo; + return format((int64_t)number, toAppendTo, pos); } @@ -1100,9 +1189,7 @@ RuleBasedNumberFormat::format(int64_t number, { if (defaultRuleSet) { UErrorCode status = U_ZERO_ERROR; - int32_t startPos = toAppendTo.length(); - defaultRuleSet->format(number, toAppendTo, toAppendTo.length(), 0, status); - adjustForCapitalizationContext(startPos, toAppendTo); + format(number, defaultRuleSet, toAppendTo, status); } return toAppendTo; } @@ -1113,12 +1200,11 @@ RuleBasedNumberFormat::format(double number, UnicodeString& toAppendTo, FieldPosition& /* pos */) const { - int32_t startPos = toAppendTo.length(); + UErrorCode status = U_ZERO_ERROR; if (defaultRuleSet) { - UErrorCode status = U_ZERO_ERROR; - defaultRuleSet->format(number, toAppendTo, toAppendTo.length(), 0, status); + format(number, *defaultRuleSet, toAppendTo, status); } - return adjustForCapitalizationContext(startPos, toAppendTo); + return toAppendTo; } @@ -1126,24 +1212,10 @@ UnicodeString& RuleBasedNumberFormat::format(int32_t number, const UnicodeString& ruleSetName, UnicodeString& toAppendTo, - FieldPosition& /* pos */, + FieldPosition& pos, UErrorCode& status) const { - // return format((int64_t)number, ruleSetName, toAppendTo, pos, status); - if (U_SUCCESS(status)) { - if (ruleSetName.indexOf(gPercentPercent, 2, 0) == 0) { - // throw new IllegalArgumentException("Can't use internal rule set"); - status = U_ILLEGAL_ARGUMENT_ERROR; - } else { - NFRuleSet *rs = findRuleSet(ruleSetName, status); - if (rs) { - int32_t startPos = toAppendTo.length(); - rs->format((int64_t)number, toAppendTo, toAppendTo.length(), 0, status); - adjustForCapitalizationContext(startPos, toAppendTo); - } - } - } - return toAppendTo; + return format((int64_t)number, ruleSetName, toAppendTo, pos, status); } @@ -1161,9 +1233,7 @@ RuleBasedNumberFormat::format(int64_t number, } else { NFRuleSet *rs = findRuleSet(ruleSetName, status); if (rs) { - int32_t startPos = toAppendTo.length(); - rs->format(number, toAppendTo, toAppendTo.length(), 0, status); - adjustForCapitalizationContext(startPos, toAppendTo); + format(number, rs, toAppendTo, status); } } } @@ -1185,29 +1255,90 @@ RuleBasedNumberFormat::format(double number, } else { NFRuleSet *rs = findRuleSet(ruleSetName, status); if (rs) { - int32_t startPos = toAppendTo.length(); - rs->format(number, toAppendTo, toAppendTo.length(), 0, status); - adjustForCapitalizationContext(startPos, toAppendTo); + format(number, *rs, toAppendTo, status); } } } return toAppendTo; } +void +RuleBasedNumberFormat::format(double number, + NFRuleSet& rs, + UnicodeString& toAppendTo, + UErrorCode& status) const +{ + int32_t startPos = toAppendTo.length(); + if (getRoundingMode() != DecimalFormat::ERoundingMode::kRoundUnnecessary && !uprv_isNaN(number) && !uprv_isInfinite(number)) { + DigitList digitList; + digitList.set(number); + digitList.setRoundingMode(getRoundingMode()); + digitList.roundFixedPoint(getMaximumFractionDigits()); + number = digitList.getDouble(); + } + rs.format(number, toAppendTo, toAppendTo.length(), 0, status); + adjustForCapitalizationContext(startPos, toAppendTo, status); +} + +/** + * Bottleneck through which all the public format() methods + * that take a long pass. By the time we get here, we know + * which rule set we're using to do the formatting. + * @param number The number to format + * @param ruleSet The rule set to use to format the number + * @return The text that resulted from formatting the number + */ +UnicodeString& +RuleBasedNumberFormat::format(int64_t number, NFRuleSet *ruleSet, UnicodeString& toAppendTo, UErrorCode& status) const +{ + // all API format() routines that take a double vector through + // here. We have these two identical functions-- one taking a + // double and one taking a long-- the couple digits of precision + // that long has but double doesn't (both types are 8 bytes long, + // but double has to borrow some of the mantissa bits to hold + // the exponent). + // Create an empty string buffer where the result will + // be built, and pass it to the rule set (along with an insertion + // position of 0 and the number being formatted) to the rule set + // for formatting + + if (U_SUCCESS(status)) { + if (number == U_INT64_MIN) { + // We can't handle this value right now. Provide an accurate default value. + + // TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J. + NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status); + Formattable f; + FieldPosition pos(FieldPosition::DONT_CARE); + DigitList *digitList = new DigitList(); + digitList->set(number); + f.adoptDigitList(digitList); + decimalFormat->format(f, toAppendTo, pos, status); + delete decimalFormat; + } + else { + int32_t startPos = toAppendTo.length(); + ruleSet->format(number, toAppendTo, toAppendTo.length(), 0, status); + adjustForCapitalizationContext(startPos, toAppendTo, status); + } + } + return toAppendTo; +} + UnicodeString& RuleBasedNumberFormat::adjustForCapitalizationContext(int32_t startPos, - UnicodeString& currentResult) const + UnicodeString& currentResult, + UErrorCode& status) const { #if !UCONFIG_NO_BREAK_ITERATION - if (startPos==0 && currentResult.length() > 0) { + UDisplayContext capitalizationContext = getContext(UDISPCTX_TYPE_CAPITALIZATION, status); + if (capitalizationContext != UDISPCTX_CAPITALIZATION_NONE && startPos == 0 && currentResult.length() > 0) { // capitalize currentResult according to context UChar32 ch = currentResult.char32At(0); - UErrorCode status = U_ZERO_ERROR; - UDisplayContext capitalizationContext = getContext(UDISPCTX_TYPE_CAPITALIZATION, status); - if ( u_islower(ch) && U_SUCCESS(status) && capitalizationBrkIter!= NULL && - ( capitalizationContext==UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE || - (capitalizationContext==UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU && capitalizationForUIListMenu) || - (capitalizationContext==UDISPCTX_CAPITALIZATION_FOR_STANDALONE && capitalizationForStandAlone)) ) { + if (u_islower(ch) && U_SUCCESS(status) && capitalizationBrkIter != NULL && + ( capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE || + (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU && capitalizationForUIListMenu) || + (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_STANDALONE && capitalizationForStandAlone)) ) { // titlecase first word of currentResult, here use sentence iterator unlike current implementations // in LocaleDisplayNamesImpl::adjustForUsageAndContext and RelativeDateFormat::format currentResult.toTitle(capitalizationBrkIter, locale, U_TITLECASE_NO_LOWERCASE | U_TITLECASE_NO_BREAK_ADJUSTMENT); @@ -1851,6 +1982,23 @@ RuleBasedNumberFormat::createPluralFormat(UPluralType pluralType, return new PluralFormat(locale, pluralType, pattern, status); } +/** + * Get the rounding mode. + * @return A rounding mode + */ +DecimalFormat::ERoundingMode RuleBasedNumberFormat::getRoundingMode() const { + return roundingMode; +} + +/** + * Set the rounding mode. This has no effect unless the rounding + * increment is greater than zero. + * @param roundingMode A rounding mode + */ +void RuleBasedNumberFormat::setRoundingMode(DecimalFormat::ERoundingMode roundingMode) { + this->roundingMode = roundingMode; +} + U_NAMESPACE_END /* U_HAVE_RBNF */ diff --git a/deps/icu-small/source/i18n/rbt.cpp b/deps/icu-small/source/i18n/rbt.cpp index 62aae52f18eb4d..0444729b252412 100644 --- a/deps/icu-small/source/i18n/rbt.cpp +++ b/deps/icu-small/source/i18n/rbt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt.h b/deps/icu-small/source/i18n/rbt.h index 9add715acabcb9..005fb853847b11 100644 --- a/deps/icu-small/source/i18n/rbt.h +++ b/deps/icu-small/source/i18n/rbt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_data.cpp b/deps/icu-small/source/i18n/rbt_data.cpp index 1b6163956c61fe..7a9707b988b42e 100644 --- a/deps/icu-small/source/i18n/rbt_data.cpp +++ b/deps/icu-small/source/i18n/rbt_data.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_data.h b/deps/icu-small/source/i18n/rbt_data.h index 29e39a59ef076c..52a961dde010d3 100644 --- a/deps/icu-small/source/i18n/rbt_data.h +++ b/deps/icu-small/source/i18n/rbt_data.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_pars.cpp b/deps/icu-small/source/i18n/rbt_pars.cpp index 5e7c0ff5f9c5dc..8e49a8473a5ab0 100644 --- a/deps/icu-small/source/i18n/rbt_pars.cpp +++ b/deps/icu-small/source/i18n/rbt_pars.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_pars.h b/deps/icu-small/source/i18n/rbt_pars.h index 48067905b9c819..d51f2e852bb5b4 100644 --- a/deps/icu-small/source/i18n/rbt_pars.h +++ b/deps/icu-small/source/i18n/rbt_pars.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_rule.cpp b/deps/icu-small/source/i18n/rbt_rule.cpp index a04a535f0e9508..db02f76035c9ea 100644 --- a/deps/icu-small/source/i18n/rbt_rule.cpp +++ b/deps/icu-small/source/i18n/rbt_rule.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_rule.h b/deps/icu-small/source/i18n/rbt_rule.h index b25afd6ef07651..eb8556df0cda5d 100644 --- a/deps/icu-small/source/i18n/rbt_rule.h +++ b/deps/icu-small/source/i18n/rbt_rule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) {1999-2001}, International Business Machines Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/i18n/rbt_set.cpp b/deps/icu-small/source/i18n/rbt_set.cpp index f2c78ca9c8d46b..939c0ea39ade63 100644 --- a/deps/icu-small/source/i18n/rbt_set.cpp +++ b/deps/icu-small/source/i18n/rbt_set.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbt_set.h b/deps/icu-small/source/i18n/rbt_set.h index ed76e6ddf7d71e..9b2b8b38dba5ca 100644 --- a/deps/icu-small/source/i18n/rbt_set.h +++ b/deps/icu-small/source/i18n/rbt_set.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/rbtz.cpp b/deps/icu-small/source/i18n/rbtz.cpp index fb458dd5020b73..951073abc51ddf 100644 --- a/deps/icu-small/source/i18n/rbtz.cpp +++ b/deps/icu-small/source/i18n/rbtz.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/regexcmp.cpp b/deps/icu-small/source/i18n/regexcmp.cpp index d0e166cfa446d9..6cfa61f187e01e 100644 --- a/deps/icu-small/source/i18n/regexcmp.cpp +++ b/deps/icu-small/source/i18n/regexcmp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // file: regexcmp.cpp @@ -2637,6 +2637,16 @@ void RegexCompile::findCaseInsensitiveStarters(UChar32 c, UnicodeSet *starterCh } +// Increment with overflow check. +// val and delta will both be positive. + +static int32_t safeIncrement(int32_t val, int32_t delta) { + if (INT32_MAX - val > delta) { + return val + delta; + } else { + return INT32_MAX; + } +} //------------------------------------------------------------------------------ @@ -2737,7 +2747,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->add(URX_VAL(op)); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2750,7 +2760,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(*s); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2787,7 +2797,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(*s); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2802,7 +2812,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(sc); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2819,7 +2829,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(s); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2836,7 +2846,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(s); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2855,7 +2865,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(s); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2879,7 +2889,7 @@ void RegexCompile::matchStartType() { } numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2895,7 +2905,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->complement(); numInitialStrings += 2; } - currentLen++; + currentLen = safeIncrement(currentLen, 1); atStart = FALSE; break; @@ -2975,7 +2985,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialStringLen = stringLen; } - currentLen += stringLen; + currentLen = safeIncrement(currentLen, stringLen); atStart = FALSE; } break; @@ -3000,7 +3010,7 @@ void RegexCompile::matchStartType() { fRXPat->fInitialChars->addAll(s); numInitialStrings += 2; // Matching on an initial string not possible. } - currentLen += stringLen; + currentLen = safeIncrement(currentLen, stringLen); atStart = FALSE; } break; @@ -3258,7 +3268,7 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) { case URX_DOTANY_ALL: // . matches one or two. case URX_DOTANY: case URX_DOTANY_UNIX: - currentLen++; + currentLen = safeIncrement(currentLen, 1); break; @@ -3310,7 +3320,7 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) { { loc++; int32_t stringLenOp = (int32_t)fRXPat->fCompiledPat->elementAti(loc); - currentLen += URX_VAL(stringLenOp); + currentLen = safeIncrement(currentLen, URX_VAL(stringLenOp)); } break; @@ -3323,7 +3333,7 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) { // Assume a min length of one for now. A min length of zero causes // optimization failures for a pattern like "string"+ // currentLen += URX_VAL(stringLenOp); - currentLen += 1; + currentLen = safeIncrement(currentLen, 1); } break; @@ -3433,18 +3443,6 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) { return currentLen; } -// Increment with overflow check. -// val and delta will both be positive. - -static int32_t safeIncrement(int32_t val, int32_t delta) { - if (INT32_MAX - val > delta) { - return val + delta; - } else { - return INT32_MAX; - } -} - - //------------------------------------------------------------------------------ // // maxMatchLength Calculate the length of the longest string that could diff --git a/deps/icu-small/source/i18n/regexcmp.h b/deps/icu-small/source/i18n/regexcmp.h index 931f2387b5169b..85b7586793b9ff 100644 --- a/deps/icu-small/source/i18n/regexcmp.h +++ b/deps/icu-small/source/i18n/regexcmp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // regexcmp.h diff --git a/deps/icu-small/source/i18n/regexcst.h b/deps/icu-small/source/i18n/regexcst.h index 259b44f5dd734e..a07d85a277c3dd 100644 --- a/deps/icu-small/source/i18n/regexcst.h +++ b/deps/icu-small/source/i18n/regexcst.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html //--------------------------------------------------------------------------------- // diff --git a/deps/icu-small/source/i18n/regeximp.cpp b/deps/icu-small/source/i18n/regeximp.cpp index c1360ebf6cd943..454e7f836b3111 100644 --- a/deps/icu-small/source/i18n/regeximp.cpp +++ b/deps/icu-small/source/i18n/regeximp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // Copyright (C) 2012 International Business Machines Corporation @@ -19,8 +19,7 @@ U_NAMESPACE_BEGIN CaseFoldingUTextIterator::CaseFoldingUTextIterator(UText &text) : - fUText(text), fcsp(NULL), fFoldChars(NULL), fFoldLength(0) { - fcsp = ucase_getSingleton(); + fUText(text), fFoldChars(NULL), fFoldLength(0) { } CaseFoldingUTextIterator::~CaseFoldingUTextIterator() {} @@ -35,7 +34,7 @@ UChar32 CaseFoldingUTextIterator::next() { if (originalC == U_SENTINEL) { return originalC; } - fFoldLength = ucase_toFullFolding(fcsp, originalC, &fFoldChars, U_FOLD_CASE_DEFAULT); + fFoldLength = ucase_toFullFolding(originalC, &fFoldChars, U_FOLD_CASE_DEFAULT); if (fFoldLength >= UCASE_MAX_STRING_LENGTH || fFoldLength < 0) { // input code point folds to a single code point, possibly itself. // See comment in ucase.h for explanation of return values from ucase_toFullFoldings. @@ -65,8 +64,7 @@ UBool CaseFoldingUTextIterator::inExpansion() { CaseFoldingUCharIterator::CaseFoldingUCharIterator(const UChar *chars, int64_t start, int64_t limit) : - fChars(chars), fIndex(start), fLimit(limit), fcsp(NULL), fFoldChars(NULL), fFoldLength(0) { - fcsp = ucase_getSingleton(); + fChars(chars), fIndex(start), fLimit(limit), fFoldChars(NULL), fFoldLength(0) { } @@ -84,7 +82,7 @@ UChar32 CaseFoldingUCharIterator::next() { } U16_NEXT(fChars, fIndex, fLimit, originalC); - fFoldLength = ucase_toFullFolding(fcsp, originalC, &fFoldChars, U_FOLD_CASE_DEFAULT); + fFoldLength = ucase_toFullFolding(originalC, &fFoldChars, U_FOLD_CASE_DEFAULT); if (fFoldLength >= UCASE_MAX_STRING_LENGTH || fFoldLength < 0) { // input code point folds to a single code point, possibly itself. // See comment in ucase.h for explanation of return values from ucase_toFullFoldings. diff --git a/deps/icu-small/source/i18n/regeximp.h b/deps/icu-small/source/i18n/regeximp.h index 0261c58c637a25..da4a861bde52dd 100644 --- a/deps/icu-small/source/i18n/regeximp.h +++ b/deps/icu-small/source/i18n/regeximp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // Copyright (C) 2002-2015 International Business Machines Corporation @@ -374,7 +374,6 @@ class CaseFoldingUTextIterator: public UMemory { // folding of the same code point from the orignal UText. private: UText &fUText; - const UCaseProps *fcsp; const UChar *fFoldChars; int32_t fFoldLength; int32_t fFoldIndex; @@ -404,7 +403,6 @@ class CaseFoldingUCharIterator: public UMemory { const UChar *fChars; int64_t fIndex; int64_t fLimit; - const UCaseProps *fcsp; const UChar *fFoldChars; int32_t fFoldLength; int32_t fFoldIndex; diff --git a/deps/icu-small/source/i18n/regexst.cpp b/deps/icu-small/source/i18n/regexst.cpp index a8feffa1bd2009..ad74ee508e7133 100644 --- a/deps/icu-small/source/i18n/regexst.cpp +++ b/deps/icu-small/source/i18n/regexst.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // regexst.h diff --git a/deps/icu-small/source/i18n/regexst.h b/deps/icu-small/source/i18n/regexst.h index 21f7ec945c748a..f0696c25a32df9 100644 --- a/deps/icu-small/source/i18n/regexst.h +++ b/deps/icu-small/source/i18n/regexst.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // regexst.h diff --git a/deps/icu-small/source/i18n/regextxt.cpp b/deps/icu-small/source/i18n/regextxt.cpp index d6157f5ed6d02e..41bb4a944b3530 100644 --- a/deps/icu-small/source/i18n/regextxt.cpp +++ b/deps/icu-small/source/i18n/regextxt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/i18n/regextxt.h b/deps/icu-small/source/i18n/regextxt.h index c5651aefd4f74c..9cfabbe4153416 100644 --- a/deps/icu-small/source/i18n/regextxt.h +++ b/deps/icu-small/source/i18n/regextxt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/i18n/region.cpp b/deps/icu-small/source/i18n/region.cpp index fdd467fc98a411..66f9ef35ded9ee 100644 --- a/deps/icu-small/source/i18n/region.cpp +++ b/deps/icu-small/source/i18n/region.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/region_impl.h b/deps/icu-small/source/i18n/region_impl.h index 852209603b116a..c0702af7dfb3d1 100644 --- a/deps/icu-small/source/i18n/region_impl.h +++ b/deps/icu-small/source/i18n/region_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/reldatefmt.cpp b/deps/icu-small/source/i18n/reldatefmt.cpp index 7009b190a25cb9..5cf053db9a98fb 100644 --- a/deps/icu-small/source/i18n/reldatefmt.cpp +++ b/deps/icu-small/source/i18n/reldatefmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -15,6 +15,7 @@ #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION #include "unicode/dtfmtsym.h" +#include "unicode/ucasemap.h" #include "unicode/ureldatefmt.h" #include "unicode/udisplaycontext.h" #include "unicode/unum.h" @@ -559,7 +560,7 @@ struct RelDateTimeFmtDataSink : public ResourceSink { RelDateTimeFmtDataSink::~RelDateTimeFmtDataSink() {} } // namespace -DateFormatSymbols::DtWidthType styleToDateFormatSymbolWidth[UDAT_STYLE_COUNT] = { +static const DateFormatSymbols::DtWidthType styleToDateFormatSymbolWidth[UDAT_STYLE_COUNT] = { DateFormatSymbols::WIDE, DateFormatSymbols::SHORT, DateFormatSymbols::NARROW }; diff --git a/deps/icu-small/source/i18n/reldtfmt.cpp b/deps/icu-small/source/i18n/reldtfmt.cpp index 4a928695356b0c..d3ab45dc631ba0 100644 --- a/deps/icu-small/source/i18n/reldtfmt.cpp +++ b/deps/icu-small/source/i18n/reldtfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -20,7 +20,7 @@ #include "unicode/udisplaycontext.h" #include "unicode/uchar.h" #include "unicode/brkiter.h" - +#include "unicode/ucasemap.h" #include "reldtfmt.h" #include "cmemory.h" #include "uresimp.h" diff --git a/deps/icu-small/source/i18n/reldtfmt.h b/deps/icu-small/source/i18n/reldtfmt.h index ea091a91c393d5..5063a6388f63b0 100644 --- a/deps/icu-small/source/i18n/reldtfmt.h +++ b/deps/icu-small/source/i18n/reldtfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/rematch.cpp b/deps/icu-small/source/i18n/rematch.cpp index 5a5bb80e05e642..1bdad187762a25 100644 --- a/deps/icu-small/source/i18n/rematch.cpp +++ b/deps/icu-small/source/i18n/rematch.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ************************************************************************** @@ -2200,7 +2200,7 @@ int32_t RegexMatcher::split(UText *input, if (dest[i] == NULL) { dest[i] = utext_openUChars(NULL, NULL, 0, &status); } else { - static UChar emptyString[] = {(UChar)0}; + static const UChar emptyString[] = {(UChar)0}; utext_replace(dest[i], 0, utext_nativeLength(dest[i]), emptyString, 0, &status); } } @@ -3566,7 +3566,14 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) { } } fp = StateSave(fp, fp->fPatIdx, status); + } else { + // Increment time-out counter. (StateSave() does it if count >= minCount) + fTickCounter--; + if (fTickCounter <= 0) { + IncrementTime(status); // Re-initializes fTickCounter + } } + fp->fPatIdx = opValue + 4; // Loop back. } break; @@ -3623,6 +3630,11 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) { // We haven't met the minimum number of matches yet. // Loop back for another one. fp->fPatIdx = opValue + 4; // Loop back. + // Increment time-out counter. (StateSave() does it if count >= minCount) + fTickCounter--; + if (fTickCounter <= 0) { + IncrementTime(status); // Re-initializes fTickCounter + } } else { // We do have the minimum number of matches. @@ -5099,6 +5111,12 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu } } fp = StateSave(fp, fp->fPatIdx, status); + } else { + // Increment time-out counter. (StateSave() does it if count >= minCount) + fTickCounter--; + if (fTickCounter <= 0) { + IncrementTime(status); // Re-initializes fTickCounter + } } fp->fPatIdx = opValue + 4; // Loop back. } @@ -5156,6 +5174,10 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu // We haven't met the minimum number of matches yet. // Loop back for another one. fp->fPatIdx = opValue + 4; // Loop back. + fTickCounter--; + if (fTickCounter <= 0) { + IncrementTime(status); // Re-initializes fTickCounter + } } else { // We do have the minimum number of matches. diff --git a/deps/icu-small/source/i18n/remtrans.cpp b/deps/icu-small/source/i18n/remtrans.cpp index 89837f991d6f30..70a6ed3935b579 100644 --- a/deps/icu-small/source/i18n/remtrans.cpp +++ b/deps/icu-small/source/i18n/remtrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/remtrans.h b/deps/icu-small/source/i18n/remtrans.h index a5635781f979c7..ed038d5f2fe0d5 100644 --- a/deps/icu-small/source/i18n/remtrans.h +++ b/deps/icu-small/source/i18n/remtrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/repattrn.cpp b/deps/icu-small/source/i18n/repattrn.cpp index b792ca048445b5..b03873066c9016 100644 --- a/deps/icu-small/source/i18n/repattrn.cpp +++ b/deps/icu-small/source/i18n/repattrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // file: repattrn.cpp diff --git a/deps/icu-small/source/i18n/rulebasedcollator.cpp b/deps/icu-small/source/i18n/rulebasedcollator.cpp index 4852667ada8079..ab65f10a3bdfa8 100644 --- a/deps/icu-small/source/i18n/rulebasedcollator.cpp +++ b/deps/icu-small/source/i18n/rulebasedcollator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/scientificnumberformatter.cpp b/deps/icu-small/source/i18n/scientificnumberformatter.cpp index 56a43f9b7fa45e..adf032d989dd90 100644 --- a/deps/icu-small/source/i18n/scientificnumberformatter.cpp +++ b/deps/icu-small/source/i18n/scientificnumberformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/scriptset.cpp b/deps/icu-small/source/i18n/scriptset.cpp index 951fe440803573..9358e63b9ee403 100644 --- a/deps/icu-small/source/i18n/scriptset.cpp +++ b/deps/icu-small/source/i18n/scriptset.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/scriptset.h b/deps/icu-small/source/i18n/scriptset.h index e8de3b9613f990..385c3e3e534086 100644 --- a/deps/icu-small/source/i18n/scriptset.h +++ b/deps/icu-small/source/i18n/scriptset.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/search.cpp b/deps/icu-small/source/i18n/search.cpp index 77323cc664fc19..baf879414b64f9 100644 --- a/deps/icu-small/source/i18n/search.cpp +++ b/deps/icu-small/source/i18n/search.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/selfmt.cpp b/deps/icu-small/source/i18n/selfmt.cpp index 041fea515c88ba..29aee3645751f2 100644 --- a/deps/icu-small/source/i18n/selfmt.cpp +++ b/deps/icu-small/source/i18n/selfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/i18n/selfmtimpl.h b/deps/icu-small/source/i18n/selfmtimpl.h index 75bc3e343a8f36..74d6dc218135e7 100644 --- a/deps/icu-small/source/i18n/selfmtimpl.h +++ b/deps/icu-small/source/i18n/selfmtimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/i18n/sharedbreakiterator.cpp b/deps/icu-small/source/i18n/sharedbreakiterator.cpp index ca962c6283374a..82f482bdd7f428 100644 --- a/deps/icu-small/source/i18n/sharedbreakiterator.cpp +++ b/deps/icu-small/source/i18n/sharedbreakiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/sharedbreakiterator.h b/deps/icu-small/source/i18n/sharedbreakiterator.h index 58be1f6a76e906..b6d67bc8e8ea5e 100644 --- a/deps/icu-small/source/i18n/sharedbreakiterator.h +++ b/deps/icu-small/source/i18n/sharedbreakiterator.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/sharedcalendar.h b/deps/icu-small/source/i18n/sharedcalendar.h index f6d97b55bc128f..1526f92e88fef3 100644 --- a/deps/icu-small/source/i18n/sharedcalendar.h +++ b/deps/icu-small/source/i18n/sharedcalendar.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/shareddateformatsymbols.h b/deps/icu-small/source/i18n/shareddateformatsymbols.h index a11a8a391b55ba..ca9a2108190c4d 100644 --- a/deps/icu-small/source/i18n/shareddateformatsymbols.h +++ b/deps/icu-small/source/i18n/shareddateformatsymbols.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/sharednumberformat.h b/deps/icu-small/source/i18n/sharednumberformat.h index fcb618a4d48d50..a7e105b5ac19cb 100644 --- a/deps/icu-small/source/i18n/sharednumberformat.h +++ b/deps/icu-small/source/i18n/sharednumberformat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/sharedpluralrules.h b/deps/icu-small/source/i18n/sharedpluralrules.h index faed6dea0e174d..28d8b25c14bc67 100644 --- a/deps/icu-small/source/i18n/sharedpluralrules.h +++ b/deps/icu-small/source/i18n/sharedpluralrules.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/significantdigitinterval.h b/deps/icu-small/source/i18n/significantdigitinterval.h index 336af784a50649..fc23370de5b6fd 100644 --- a/deps/icu-small/source/i18n/significantdigitinterval.h +++ b/deps/icu-small/source/i18n/significantdigitinterval.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/simpletz.cpp b/deps/icu-small/source/i18n/simpletz.cpp index 7dadef5ae60620..557b02620bec00 100644 --- a/deps/icu-small/source/i18n/simpletz.cpp +++ b/deps/icu-small/source/i18n/simpletz.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -1189,13 +1189,22 @@ SimpleTimeZone::initTransitionRules(UErrorCode& status) { // Create a TimeZoneRule for initial time if (firstStdStart < firstDstStart) { initialRule = new InitialTimeZoneRule(tzid+UnicodeString(DST_STR), getRawOffset(), dstRule->getDSTSavings()); + if (initialRule == NULL) { + status = U_MEMORY_ALLOCATION_ERROR; + deleteTransitionRules(); + return; + } firstTransition = new TimeZoneTransition(firstStdStart, *initialRule, *stdRule); } else { initialRule = new InitialTimeZoneRule(tzid+UnicodeString(STD_STR), getRawOffset(), 0); + if (initialRule == NULL) { + status = U_MEMORY_ALLOCATION_ERROR; + deleteTransitionRules(); + return; + } firstTransition = new TimeZoneTransition(firstDstStart, *initialRule, *dstRule); } - // Check for null pointers. - if (initialRule == NULL || firstTransition == NULL) { + if (firstTransition == NULL) { status = U_MEMORY_ALLOCATION_ERROR; deleteTransitionRules(); return; diff --git a/deps/icu-small/source/i18n/smallintformatter.cpp b/deps/icu-small/source/i18n/smallintformatter.cpp index b96f6dad3b5f5d..0c56e38bd69560 100644 --- a/deps/icu-small/source/i18n/smallintformatter.cpp +++ b/deps/icu-small/source/i18n/smallintformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/smallintformatter.h b/deps/icu-small/source/i18n/smallintformatter.h index 846d6b405472ae..3373a9c35ffcec 100644 --- a/deps/icu-small/source/i18n/smallintformatter.h +++ b/deps/icu-small/source/i18n/smallintformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/smpdtfmt.cpp b/deps/icu-small/source/i18n/smpdtfmt.cpp index 85cc162a11f39f..27fbbd8f7a9ef5 100644 --- a/deps/icu-small/source/i18n/smpdtfmt.cpp +++ b/deps/icu-small/source/i18n/smpdtfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -48,6 +48,7 @@ #include "unicode/simpletz.h" #include "unicode/rbtz.h" #include "unicode/tzfmt.h" +#include "unicode/ucasemap.h" #include "unicode/utf16.h" #include "unicode/vtzone.h" #include "unicode/udisplaycontext.h" @@ -64,11 +65,13 @@ #include #include "smpdtfst.h" #include "sharednumberformat.h" +#include "ucasemap_imp.h" #include "ustr_imp.h" #include "charstr.h" #include "uvector.h" #include "cstr.h" #include "dayperiodrules.h" +#include "tznames_impl.h" // ZONE_NAME_U16_MAX #if defined( U_DEBUG_CALSVC ) || defined (U_DEBUG_CAL) #include @@ -1688,7 +1691,7 @@ SimpleDateFormat::subFormat(UnicodeString &appendTo, case UDAT_TIMEZONE_ISO_FIELD: // 'X' case UDAT_TIMEZONE_ISO_LOCAL_FIELD: // 'x' { - UChar zsbuf[64]; + UChar zsbuf[ZONE_NAME_U16_MAX]; UnicodeString zoneString(zsbuf, 0, UPRV_LENGTHOF(zsbuf)); const TimeZone& tz = cal.getTimeZone(); UDate date = cal.getTime(status); @@ -3051,9 +3054,9 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC // is treated literally: "2250", "-1", "1", "002". if (fDateOverride.compare(hebr)==0 && value < 1000) { value += HEBREW_CAL_CUR_MILLENIUM_START_YEAR; - } else if ((pos.getIndex() - start) == 2 && !isChineseCalendar - && u_isdigit(text.charAt(start)) - && u_isdigit(text.charAt(start+1))) + } else if (text.moveIndex32(start, 2) == pos.getIndex() && !isChineseCalendar + && u_isdigit(text.char32At(start)) + && u_isdigit(text.char32At(text.moveIndex32(start, 1)))) { // only adjust year for patterns less than 3. if(count < 3) { @@ -3091,9 +3094,9 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC // Comment is the same as for UDAT_Year_FIELDs - look above if (fDateOverride.compare(hebr)==0 && value < 1000) { value += HEBREW_CAL_CUR_MILLENIUM_START_YEAR; - } else if ((pos.getIndex() - start) == 2 - && u_isdigit(text.charAt(start)) - && u_isdigit(text.charAt(start+1)) + } else if (text.moveIndex32(start, 2) == pos.getIndex() + && u_isdigit(text.char32At(start)) + && u_isdigit(text.char32At(text.moveIndex32(start, 1))) && fHaveDefaultCentury ) { int32_t ambiguousTwoDigitYear = fDefaultCenturyStartYear % 100; @@ -3199,7 +3202,7 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC case UDAT_FRACTIONAL_SECOND_FIELD: // Fractional seconds left-justify - i = pos.getIndex() - start; + i = countDigits(text, start, pos.getIndex()); if (i < 3) { while (i < 3) { value *= 10; @@ -3725,6 +3728,19 @@ void SimpleDateFormat::parseInt(const UnicodeString& text, } } +int32_t SimpleDateFormat::countDigits(const UnicodeString& text, int32_t start, int32_t end) const { + int32_t numDigits = 0; + int32_t idx = start; + while (idx < end) { + UChar32 cp = text.char32At(idx); + if (u_isdigit(cp)) { + numDigits++; + } + idx += U16_LENGTH(cp); + } + return numDigits; +} + //---------------------------------------------------------------------- void SimpleDateFormat::translatePattern(const UnicodeString& originalPattern, diff --git a/deps/icu-small/source/i18n/smpdtfst.cpp b/deps/icu-small/source/i18n/smpdtfst.cpp index 50980a99e4dfa5..ff0dec232d29f7 100644 --- a/deps/icu-small/source/i18n/smpdtfst.cpp +++ b/deps/icu-small/source/i18n/smpdtfst.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/smpdtfst.h b/deps/icu-small/source/i18n/smpdtfst.h index 38ad558de2dfc0..ed8ce4371f6d6d 100644 --- a/deps/icu-small/source/i18n/smpdtfst.h +++ b/deps/icu-small/source/i18n/smpdtfst.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -16,6 +16,7 @@ #ifndef SMPDTFST_H #define SMPDTFST_H +#include "unicode/uobject.h" #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING diff --git a/deps/icu-small/source/i18n/sortkey.cpp b/deps/icu-small/source/i18n/sortkey.cpp index 68b0f062b8daf4..fb030c499083e6 100644 --- a/deps/icu-small/source/i18n/sortkey.cpp +++ b/deps/icu-small/source/i18n/sortkey.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/standardplural.cpp b/deps/icu-small/source/i18n/standardplural.cpp index c39bae1ab18b9c..0391034b3e4a8d 100644 --- a/deps/icu-small/source/i18n/standardplural.cpp +++ b/deps/icu-small/source/i18n/standardplural.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/standardplural.h b/deps/icu-small/source/i18n/standardplural.h index 56c63c347cee1e..33e1d605f6856b 100644 --- a/deps/icu-small/source/i18n/standardplural.h +++ b/deps/icu-small/source/i18n/standardplural.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/strmatch.cpp b/deps/icu-small/source/i18n/strmatch.cpp index e72cfc9ab03d00..d5b018aa6b62b6 100644 --- a/deps/icu-small/source/i18n/strmatch.cpp +++ b/deps/icu-small/source/i18n/strmatch.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/strmatch.h b/deps/icu-small/source/i18n/strmatch.h index 0241adfd3f01f0..7152a24a0765e4 100644 --- a/deps/icu-small/source/i18n/strmatch.h +++ b/deps/icu-small/source/i18n/strmatch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2001-2011, International Business Machines Corporation diff --git a/deps/icu-small/source/i18n/strrepl.cpp b/deps/icu-small/source/i18n/strrepl.cpp index d061eff579e58a..132c844c2dff27 100644 --- a/deps/icu-small/source/i18n/strrepl.cpp +++ b/deps/icu-small/source/i18n/strrepl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/strrepl.h b/deps/icu-small/source/i18n/strrepl.h index a452db993fb45d..feec058152a8a3 100644 --- a/deps/icu-small/source/i18n/strrepl.h +++ b/deps/icu-small/source/i18n/strrepl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/stsearch.cpp b/deps/icu-small/source/i18n/stsearch.cpp index 643ec21b277395..bf4d80b6db8ed0 100644 --- a/deps/icu-small/source/i18n/stsearch.cpp +++ b/deps/icu-small/source/i18n/stsearch.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/taiwncal.cpp b/deps/icu-small/source/i18n/taiwncal.cpp index f1ca6fa135bd34..e2757dbd550dd9 100644 --- a/deps/icu-small/source/i18n/taiwncal.cpp +++ b/deps/icu-small/source/i18n/taiwncal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/taiwncal.h b/deps/icu-small/source/i18n/taiwncal.h index b15cff5beb75b8..99bbfb53f2b1ab 100644 --- a/deps/icu-small/source/i18n/taiwncal.h +++ b/deps/icu-small/source/i18n/taiwncal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/timezone.cpp b/deps/icu-small/source/i18n/timezone.cpp index 427674aac4ff3d..e662bf7674b9f4 100644 --- a/deps/icu-small/source/i18n/timezone.cpp +++ b/deps/icu-small/source/i18n/timezone.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/titletrn.cpp b/deps/icu-small/source/i18n/titletrn.cpp index a1de8be6669567..4e75c824a0f7f1 100644 --- a/deps/icu-small/source/i18n/titletrn.cpp +++ b/deps/icu-small/source/i18n/titletrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -97,7 +97,7 @@ void TitlecaseTransliterator::handleTransliterate( int32_t start; for (start = offsets.start - 1; start >= offsets.contextStart; start -= U16_LENGTH(c)) { c = text.char32At(start); - type=ucase_getTypeOrIgnorable(fCsp, c); + type=ucase_getTypeOrIgnorable(c); if(type>0) { // cased doTitle=FALSE; break; @@ -118,19 +118,19 @@ void TitlecaseTransliterator::handleTransliterate( UnicodeString tmp; const UChar *s; - int32_t textPos, delta, result, locCache=0; + int32_t textPos, delta, result; for(textPos=offsets.start; textPos=0) { // not case-ignorable if(doTitle) { - result=ucase_toFullTitle(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache); + result=ucase_toFullTitle(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT); } else { - result=ucase_toFullLower(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache); + result=ucase_toFullLower(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT); } doTitle = (UBool)(type==0); // doTitle=isUncased diff --git a/deps/icu-small/source/i18n/titletrn.h b/deps/icu-small/source/i18n/titletrn.h index a6380e3bd142c6..166378fe9da5c2 100644 --- a/deps/icu-small/source/i18n/titletrn.h +++ b/deps/icu-small/source/i18n/titletrn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/tmunit.cpp b/deps/icu-small/source/i18n/tmunit.cpp index d9da2681251c2f..ca308cca225972 100644 --- a/deps/icu-small/source/i18n/tmunit.cpp +++ b/deps/icu-small/source/i18n/tmunit.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/tmutamt.cpp b/deps/icu-small/source/i18n/tmutamt.cpp index 7be730765bfff4..0e2b91fbb2bb6f 100644 --- a/deps/icu-small/source/i18n/tmutamt.cpp +++ b/deps/icu-small/source/i18n/tmutamt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/tmutfmt.cpp b/deps/icu-small/source/i18n/tmutfmt.cpp index 1669546f767535..50dac8b7cef8c0 100644 --- a/deps/icu-small/source/i18n/tmutfmt.cpp +++ b/deps/icu-small/source/i18n/tmutfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/tolowtrn.cpp b/deps/icu-small/source/i18n/tolowtrn.cpp index f0a59bbd0b4716..063cc88d1c40ce 100644 --- a/deps/icu-small/source/i18n/tolowtrn.cpp +++ b/deps/icu-small/source/i18n/tolowtrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/tolowtrn.h b/deps/icu-small/source/i18n/tolowtrn.h index 616e59899f974d..e311431224e5c2 100644 --- a/deps/icu-small/source/i18n/tolowtrn.h +++ b/deps/icu-small/source/i18n/tolowtrn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/toupptrn.cpp b/deps/icu-small/source/i18n/toupptrn.cpp index a34792e07cfb82..098dba9a3ce4f9 100644 --- a/deps/icu-small/source/i18n/toupptrn.cpp +++ b/deps/icu-small/source/i18n/toupptrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/toupptrn.h b/deps/icu-small/source/i18n/toupptrn.h index eae44e7d187dfa..677a04e5c771a9 100644 --- a/deps/icu-small/source/i18n/toupptrn.h +++ b/deps/icu-small/source/i18n/toupptrn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/translit.cpp b/deps/icu-small/source/i18n/translit.cpp index 79328baa2bb157..de54e952dcb570 100644 --- a/deps/icu-small/source/i18n/translit.cpp +++ b/deps/icu-small/source/i18n/translit.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/transreg.cpp b/deps/icu-small/source/i18n/transreg.cpp index cc1d51dea84749..331f4efdeb339a 100644 --- a/deps/icu-small/source/i18n/transreg.cpp +++ b/deps/icu-small/source/i18n/transreg.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -46,11 +46,29 @@ static const UChar LOCALE_SEP = 95; // '_' //static const UChar VARIANT_SEP = 0x002F; // '/' // String constants -static const UChar ANY[] = { 65, 110, 121, 0 }; // Any +static const UChar ANY[] = { 0x41, 0x6E, 0x79, 0 }; // Any +static const UChar LAT[] = { 0x4C, 0x61, 0x74, 0 }; // Lat // empty string #define NO_VARIANT UnicodeString() +// initial estimate for specDAG size +// ICU 60 Transliterator::countAvailableSources() +#define SPECDAG_INIT_SIZE 149 + +// initial estimate for number of variant names +#define VARIANT_LIST_INIT_SIZE 11 +#define VARIANT_LIST_MAX_SIZE 31 + +// initial estimate for availableIDs count (default estimate is 8 => multiple reallocs) +// ICU 60 Transliterator::countAvailableIDs() +#define AVAILABLE_IDS_INIT_SIZE 641 + +// initial estimate for number of targets for source "Any", "Lat" +// ICU 60 Transliterator::countAvailableTargets("Any")/("Latn") +#define ANY_TARGETS_INIT_SIZE 125 +#define LAT_TARGETS_INIT_SIZE 23 + /** * Resource bundle key for the RuleBasedTransliterator rule. */ @@ -517,10 +535,17 @@ U_CDECL_END TransliteratorRegistry::TransliteratorRegistry(UErrorCode& status) : registry(TRUE, status), - specDAG(TRUE, status), - availableIDs(status) + specDAG(TRUE, SPECDAG_INIT_SIZE, status), + variantList(VARIANT_LIST_INIT_SIZE, status), + availableIDs(AVAILABLE_IDS_INIT_SIZE, status) { registry.setValueDeleter(deleteEntry); + variantList.setDeleter(uprv_deleteUObject); + variantList.setComparer(uhash_compareCaselessUnicodeString); + UnicodeString *emptyString = new UnicodeString(); + if (emptyString != NULL) { + variantList.addElement(emptyString, status); + } availableIDs.setDeleter(uprv_deleteUObject); availableIDs.setComparer(uhash_compareCaselessUnicodeString); specDAG.setValueDeleter(uhash_deleteHashtable); @@ -781,9 +806,15 @@ int32_t TransliteratorRegistry::countAvailableVariants(const UnicodeString& sour if (targets == 0) { return 0; } - UVector *variants = (UVector*) targets->get(target); - // variants may be 0 if the source/target are invalid - return (variants == 0) ? 0 : variants->size(); + uint32_t varMask = targets->geti(target); + int32_t varCount = 0; + while (varMask > 0) { + if (varMask & 1) { + varCount++; + } + varMask >>= 1; + } + return varCount; } UnicodeString& TransliteratorRegistry::getAvailableVariant(int32_t index, @@ -795,17 +826,25 @@ UnicodeString& TransliteratorRegistry::getAvailableVariant(int32_t index, result.truncate(0); // invalid source return result; } - UVector *variants = (UVector*) targets->get(target); - if (variants == 0) { - result.truncate(0); // invalid target - return result; - } - UnicodeString *v = (UnicodeString*) variants->elementAt(index); - if (v == 0) { - result.truncate(0); // invalid index - } else { - result = *v; + uint32_t varMask = targets->geti(target); + int32_t varCount = 0; + int32_t varListIndex = 0; + while (varMask > 0) { + if (varMask & 1) { + if (varCount == index) { + UnicodeString *v = (UnicodeString*) variantList.elementAt(varListIndex); + if (v != NULL) { + result = *v; + return result; + } + break; + } + varCount++; + } + varMask >>= 1; + varListIndex++; } + result.truncate(0); // invalid target or index return result; } @@ -911,9 +950,9 @@ void TransliteratorRegistry::registerEntry(const UnicodeString& ID, UnicodeString *newID = (UnicodeString *)ID.clone(); // Check to make sure newID was created. if (newID != NULL) { - // NUL-terminate the ID string - newID->getTerminatedBuffer(); - availableIDs.addElement(newID, status); + // NUL-terminate the ID string + newID->getTerminatedBuffer(); + availableIDs.addElement(newID, status); } } } else { @@ -924,9 +963,7 @@ void TransliteratorRegistry::registerEntry(const UnicodeString& ID, /** * Register a source-target/variant in the specDAG. Variant may be - * empty, but source and target must not be. If variant is empty then - * the special variant NO_VARIANT is stored in slot zero of the - * UVector of variants. + * empty, but source and target must not be. */ void TransliteratorRegistry::registerSTV(const UnicodeString& source, const UnicodeString& target, @@ -936,39 +973,38 @@ void TransliteratorRegistry::registerSTV(const UnicodeString& source, UErrorCode status = U_ZERO_ERROR; Hashtable *targets = (Hashtable*) specDAG.get(source); if (targets == 0) { - targets = new Hashtable(TRUE, status); - if (U_FAILURE(status) || targets == 0) { + int32_t size = 3; + if (source.compare(ANY,3) == 0) { + size = ANY_TARGETS_INIT_SIZE; + } else if (source.compare(LAT,3) == 0) { + size = LAT_TARGETS_INIT_SIZE; + } + targets = new Hashtable(TRUE, size, status); + if (U_FAILURE(status) || targets == NULL) { return; } - targets->setValueDeleter(uprv_deleteUObject); specDAG.put(source, targets, status); } - UVector *variants = (UVector*) targets->get(target); - if (variants == 0) { - variants = new UVector(uprv_deleteUObject, - uhash_compareCaselessUnicodeString, status); - if (variants == 0) { + int32_t variantListIndex = variantList.indexOf((void*) &variant, 0); + if (variantListIndex < 0) { + if (variantList.size() >= VARIANT_LIST_MAX_SIZE) { + // can't handle any more variants return; } - targets->put(target, variants, status); - } - // assert(NO_VARIANT == ""); - // We add the variant string. If it is the special "no variant" - // string, that is, the empty string, we add it at position zero. - if (!variants->contains((void*) &variant)) { - UnicodeString *tempus; // Used for null pointer check. - if (variant.length() > 0) { - tempus = new UnicodeString(variant); - if (tempus != NULL) { - variants->addElement(tempus, status); - } - } else { - tempus = new UnicodeString(); // = NO_VARIANT - if (tempus != NULL) { - variants->insertElementAt(tempus, 0, status); - } + UnicodeString *variantEntry = new UnicodeString(variant); + if (variantEntry != NULL) { + variantList.addElement(variantEntry, status); + if (U_SUCCESS(status)) { + variantListIndex = variantList.size() - 1; + } + } + if (variantListIndex < 0) { + return; } } + uint32_t addMask = 1 << variantListIndex; + uint32_t varMask = targets->geti(target); + targets->puti(target, varMask | addMask, status); } /** @@ -979,17 +1015,24 @@ void TransliteratorRegistry::removeSTV(const UnicodeString& source, const UnicodeString& variant) { // assert(source.length() > 0); // assert(target.length() > 0); -// UErrorCode status = U_ZERO_ERROR; + UErrorCode status = U_ZERO_ERROR; Hashtable *targets = (Hashtable*) specDAG.get(source); - if (targets == 0) { + if (targets == NULL) { return; // should never happen for valid s-t/v } - UVector *variants = (UVector*) targets->get(target); - if (variants == 0) { + uint32_t varMask = targets->geti(target); + if (varMask == 0) { return; // should never happen for valid s-t/v } - variants->removeElement((void*) &variant); - if (variants->size() == 0) { + int32_t variantListIndex = variantList.indexOf((void*) &variant, 0); + if (variantListIndex < 0) { + return; // should never happen for valid s-t/v + } + int32_t remMask = 1 << variantListIndex; + varMask &= (~remMask); + if (varMask != 0) { + targets->puti(target, varMask, status); + } else { targets->remove(target); // should delete variants if (targets->count() == 0) { specDAG.remove(source); // should delete targets @@ -1281,8 +1324,8 @@ Transliterator* TransliteratorRegistry::instantiateEntry(const UnicodeString& ID UVector* rbts = new UVector(entry->u.dataVector->size(), status); // Check for null pointer if (rbts == NULL) { - status = U_MEMORY_ALLOCATION_ERROR; - return NULL; + status = U_MEMORY_ALLOCATION_ERROR; + return NULL; } int32_t passNumber = 1; for (int32_t i = 0; U_SUCCESS(status) && i < entry->u.dataVector->size(); i++) { diff --git a/deps/icu-small/source/i18n/transreg.h b/deps/icu-small/source/i18n/transreg.h index 334963f8d1e9c2..041244e1b02d77 100644 --- a/deps/icu-small/source/i18n/transreg.h +++ b/deps/icu-small/source/i18n/transreg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -440,13 +440,15 @@ class TransliteratorRegistry : public UMemory { /** * DAG of visible IDs by spec. Hashtable: source => (Hashtable: - * target => (UVector: variant)) The UVector of variants is never - * empty. For a source-target with no variant, the special - * variant NO_VARIANT (the empty string) is stored in slot zero of - * the UVector. + * target => variant bitmask) */ Hashtable specDAG; + /** + * Vector of all variant names + */ + UVector variantList; + /** * Vector of public full IDs. */ diff --git a/deps/icu-small/source/i18n/tridpars.cpp b/deps/icu-small/source/i18n/tridpars.cpp index 140e3d7d1cf74d..68bbd2d0407a7c 100644 --- a/deps/icu-small/source/i18n/tridpars.cpp +++ b/deps/icu-small/source/i18n/tridpars.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/tridpars.h b/deps/icu-small/source/i18n/tridpars.h index 7c226023ef8011..3d657ed17c9784 100644 --- a/deps/icu-small/source/i18n/tridpars.h +++ b/deps/icu-small/source/i18n/tridpars.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ************************************************************************** diff --git a/deps/icu-small/source/i18n/tzfmt.cpp b/deps/icu-small/source/i18n/tzfmt.cpp index 783edac34fde70..69da4667bc89ac 100644 --- a/deps/icu-small/source/i18n/tzfmt.cpp +++ b/deps/icu-small/source/i18n/tzfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -14,8 +14,11 @@ #include "unicode/calendar.h" #include "unicode/tzfmt.h" #include "unicode/numsys.h" +#include "unicode/strenum.h" #include "unicode/uchar.h" #include "unicode/udat.h" +#include "unicode/ustring.h" +#include "unicode/utf16.h" #include "tzgnames.h" #include "cmemory.h" #include "cstring.h" @@ -28,6 +31,7 @@ #include "uvector.h" #include "zonemeta.h" #include "tznames_impl.h" // TextTrieMap +#include "patternprops.h" U_NAMESPACE_BEGIN @@ -318,7 +322,7 @@ TimeZoneFormat::TimeZoneFormat(const Locale& locale, UErrorCode& status) } const char* region = fLocale.getCountry(); - int32_t regionLen = uprv_strlen(region); + int32_t regionLen = static_cast(uprv_strlen(region)); if (regionLen == 0) { char loc[ULOC_FULLNAME_CAPACITY]; uloc_addLikelySubtags(fLocale.getName(), loc, sizeof(loc), &status); @@ -786,7 +790,7 @@ TimeZoneFormat::format(const Formattable& obj, UnicodeString& appendTo, if (tz != NULL) { int32_t rawOffset, dstOffset; tz->getOffset(date, FALSE, rawOffset, dstOffset, status); - UChar buf[32]; + UChar buf[ZONE_NAME_U16_MAX]; UnicodeString result(buf, 0, UPRV_LENGTHOF(buf)); formatOffsetLocalizedGMT(rawOffset + dstOffset, result, status); if (U_SUCCESS(status)) { @@ -1412,7 +1416,7 @@ TimeZoneFormat::getTZDBTimeZoneNames(UErrorCode& status) const { UnicodeString& TimeZoneFormat::formatExemplarLocation(const TimeZone& tz, UnicodeString& name) const { - UChar locationBuf[64]; + UChar locationBuf[ZONE_NAME_U16_MAX]; UnicodeString location(locationBuf, 0, UPRV_LENGTHOF(locationBuf)); const UChar* canonicalID = ZoneMeta::getCanonicalCLDRID(tz); @@ -1810,7 +1814,9 @@ TimeZoneFormat::parseOffsetFields(const UnicodeString& text, int32_t start, UBoo // but it should be parsed as 00:10:20. int32_t tmpLen = 0; int32_t tmpSign = 1; - int32_t tmpH, tmpM, tmpS; + int32_t tmpH = 0; + int32_t tmpM = 0; + int32_t tmpS = 0; for (int32_t patidx = 0; PARSE_GMT_OFFSET_TYPES[patidx] >= 0; patidx++) { int32_t gmtPatType = PARSE_GMT_OFFSET_TYPES[patidx]; @@ -1858,6 +1864,27 @@ TimeZoneFormat::parseOffsetFieldsWithPattern(const UnicodeString& text, int32_t if (fieldType == GMTOffsetField::TEXT) { const UChar* patStr = field->getPatternText(); len = u_strlen(patStr); + if (i == 0) { + // When TimeZoneFormat parse() is called from SimpleDateFormat, + // leading space characters might be truncated. If the first pattern text + // starts with such character (e.g. Bidi control), then we need to + // skip the leading space charcters. + if (idx < text.length() && !PatternProps::isWhiteSpace(text.char32At(idx))) { + while (len > 0) { + UChar32 ch; + int32_t chLen; + U16_GET(patStr, 0, 0, len, ch) + if (PatternProps::isWhiteSpace(ch)) { + chLen = U16_LENGTH(ch); + len -= chLen; + patStr += chLen; + } + else { + break; + } + } + } + } if (text.caseCompare(idx, len, patStr, 0) != 0) { failed = TRUE; break; @@ -2426,7 +2453,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re isPrevQuote = TRUE; if (itemType != GMTOffsetField::TEXT) { if (GMTOffsetField::isValid(itemType, itemLength)) { - GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, (uint8_t)itemLength, status); + GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast(itemLength), status); result->addElement(fld, status); if (U_FAILURE(status)) { break; @@ -2461,7 +2488,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re } } else { if (GMTOffsetField::isValid(itemType, itemLength)) { - GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, itemLength, status); + GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast(itemLength), status); result->addElement(fld, status); if (U_FAILURE(status)) { break; @@ -2479,7 +2506,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re // a string literal if (itemType != GMTOffsetField::TEXT) { if (GMTOffsetField::isValid(itemType, itemLength)) { - GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, itemLength, status); + GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast(itemLength), status); result->addElement(fld, status); if (U_FAILURE(status)) { break; @@ -2504,7 +2531,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re } } else { if (GMTOffsetField::isValid(itemType, itemLength)) { - GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, itemLength, status); + GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast(itemLength), status); result->addElement(fld, status); } else { status = U_ILLEGAL_ARGUMENT_ERROR; @@ -2750,7 +2777,7 @@ static void U_CALLCONV initZoneIdTrie(UErrorCode &status) { } StringEnumeration *tzenum = TimeZone::createEnumeration(); const UnicodeString *id; - while ((id = tzenum->snext(status))) { + while ((id = tzenum->snext(status)) != NULL) { const UChar* uid = ZoneMeta::findTimeZoneID(*id); if (uid) { gZoneIdTrie->put(uid, const_cast(uid), status); @@ -2797,7 +2824,7 @@ static void U_CALLCONV initShortZoneIdTrie(UErrorCode &status) { status = U_MEMORY_ALLOCATION_ERROR; } else { const UnicodeString *id; - while ((id = tzenum->snext(status))) { + while ((id = tzenum->snext(status)) != NULL) { const UChar* uID = ZoneMeta::findTimeZoneID(*id); const UChar* shortID = ZoneMeta::getShortID(*id); if (shortID && uID) { diff --git a/deps/icu-small/source/i18n/tzgnames.cpp b/deps/icu-small/source/i18n/tzgnames.cpp index 4fc726ea54de9b..c2e685272e9b36 100644 --- a/deps/icu-small/source/i18n/tzgnames.cpp +++ b/deps/icu-small/source/i18n/tzgnames.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -18,6 +18,7 @@ #include "unicode/rbtz.h" #include "unicode/simpleformatter.h" #include "unicode/simpletz.h" +#include "unicode/strenum.h" #include "unicode/vtzone.h" #include "cmemory.h" @@ -614,7 +615,7 @@ TZGNCore::formatGenericNonLocationName(const TimeZone& tz, UTimeZoneGenericNameT UErrorCode status = U_ZERO_ERROR; UBool useStandard = FALSE; int32_t raw, sav; - UChar tmpNameBuf[64]; + UChar tmpNameBuf[ZONE_NAME_U16_MAX]; tz.getOffset(date, FALSE, raw, sav, status); if (U_FAILURE(status)) { @@ -682,7 +683,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[64]; + UChar genNameBuf[ZONE_NAME_U16_MAX]; UnicodeString mzGenericName(genNameBuf, 0, UPRV_LENGTHOF(genNameBuf)); fTimeZoneNames->getMetaZoneDisplayName(mzID, nameType, mzGenericName); if (stdName.caseCompare(mzGenericName, 0) == 0) { @@ -855,7 +856,7 @@ TZGNCore::loadStrings(const UnicodeString& tzCanonicalID) { }; StringEnumeration *mzIDs = fTimeZoneNames->getAvailableMetaZoneIDs(tzCanonicalID, status); - while ((mzID = mzIDs->snext(status))) { + while ((mzID = mzIDs->snext(status)) != NULL) { if (U_FAILURE(status)) { break; } @@ -1043,7 +1044,7 @@ TZGNCore::findLocal(const UnicodeString& text, int32_t start, uint32_t types, UE StringEnumeration *tzIDs = TimeZone::createTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL, NULL, NULL, status); if (U_SUCCESS(status)) { const UnicodeString *tzID; - while ((tzID = tzIDs->snext(status))) { + while ((tzID = tzIDs->snext(status)) != NULL) { if (U_FAILURE(status)) { break; } @@ -1163,7 +1164,7 @@ static void sweepCache() { const UHashElement* elem; double now = (double)uprv_getUTCtime(); - while ((elem = uhash_nextElement(gTZGNCoreCache, &pos))) { + while ((elem = uhash_nextElement(gTZGNCoreCache, &pos)) != NULL) { TZGNCoreRef *entry = (TZGNCoreRef *)elem->value.pointer; if (entry->refCount <= 0 && (now - entry->lastAccess) > CACHE_EXPIRATION) { // delete this entry diff --git a/deps/icu-small/source/i18n/tzgnames.h b/deps/icu-small/source/i18n/tzgnames.h index e78e8ee991734e..d896af8ba82f1b 100644 --- a/deps/icu-small/source/i18n/tzgnames.h +++ b/deps/icu-small/source/i18n/tzgnames.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/tznames.cpp b/deps/icu-small/source/i18n/tznames.cpp index 6aefd13b536fc0..689fdeb0915300 100644 --- a/deps/icu-small/source/i18n/tznames.cpp +++ b/deps/icu-small/source/i18n/tznames.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/tznames_impl.cpp b/deps/icu-small/source/i18n/tznames_impl.cpp index 3e92acb6f9606e..ef04b31c1357f4 100644 --- a/deps/icu-small/source/i18n/tznames_impl.cpp +++ b/deps/icu-small/source/i18n/tznames_impl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -15,8 +15,10 @@ #if !UCONFIG_NO_FORMATTING +#include "unicode/strenum.h" #include "unicode/ustring.h" #include "unicode/timezone.h" +#include "unicode/utf16.h" #include "tznames_impl.h" #include "cmemory.h" @@ -68,7 +70,7 @@ enum UTimeZoneNameTypeIndex { UTZNM_INDEX_SHORT_DAYLIGHT, UTZNM_INDEX_COUNT }; -static const UChar* EMPTY_NAMES[UTZNM_INDEX_COUNT] = {0,0,0,0,0,0,0}; +static const UChar* const EMPTY_NAMES[UTZNM_INDEX_COUNT] = {0,0,0,0,0,0,0}; U_CDECL_BEGIN static UBool U_CALLCONV tzdbTimeZoneNames_cleanup(void) { @@ -410,25 +412,29 @@ TextTrieMap::search(CharacterNode *node, const UnicodeString &text, int32_t star return; } } - UChar32 c = text.char32At(index); if (fIgnoreCase) { - // size of character may grow after fold operation - UnicodeString tmp(c); + // for folding we need to get a complete code point. + // size of character may grow after fold operation; + // then we need to get result as UTF16 code units. + UChar32 c32 = text.char32At(index); + index += U16_LENGTH(c32); + UnicodeString tmp(c32); tmp.foldCase(); int32_t tmpidx = 0; while (tmpidx < tmp.length()) { - c = tmp.char32At(tmpidx); + UChar c = tmp.charAt(tmpidx++); node = getChildNode(node, c); if (node == NULL) { break; } - tmpidx = tmp.moveIndex32(tmpidx, 1); } } else { + // here we just get the next UTF16 code unit + UChar c = text.charAt(index++); node = getChildNode(node, c); } if (node != NULL) { - search(node, text, start, index+1, handler, status); + search(node, text, start, index, handler, status); } } @@ -1069,7 +1075,7 @@ TimeZoneNamesImpl::loadStrings(const UnicodeString& tzCanonicalID, UErrorCode& s U_ASSERT(!mzIDs.isNull()); const UnicodeString *mzID; - while ((mzID = mzIDs->snext(status)) && U_SUCCESS(status)) { + while (((mzID = mzIDs->snext(status)) != NULL) && U_SUCCESS(status)) { loadMetaZoneNames(*mzID, status); } } @@ -1650,7 +1656,7 @@ void TimeZoneNamesImpl::internalLoadAllDisplayNames(UErrorCode& status) { StringEnumeration *tzIDs = TimeZone::createTimeZoneIDEnumeration( UCAL_ZONE_TYPE_CANONICAL, NULL, NULL, status); if (U_SUCCESS(status)) { - while ((id = tzIDs->snext(status))) { + while ((id = tzIDs->snext(status)) != NULL) { if (U_FAILURE(status)) { break; } @@ -2055,6 +2061,9 @@ static void U_CALLCONV prepareFind(UErrorCode &status) { if (U_SUCCESS(status)) { while ((mzID = mzIDs->snext(status)) && U_SUCCESS(status)) { const TZDBNames *names = TZDBTimeZoneNames::getMetaZoneNames(*mzID, status); + if (U_FAILURE(status)) { + break; + } if (names == NULL) { continue; } @@ -2186,9 +2195,11 @@ TZDBTimeZoneNames::getMetaZoneDisplayName(const UnicodeString& mzID, UErrorCode status = U_ZERO_ERROR; const TZDBNames *tzdbNames = TZDBTimeZoneNames::getMetaZoneNames(mzID, status); if (U_SUCCESS(status)) { - const UChar *s = tzdbNames->getName(type); - if (s != NULL) { - name.setTo(TRUE, s, -1); + if (tzdbNames != NULL) { + const UChar *s = tzdbNames->getName(type); + if (s != NULL) { + name.setTo(TRUE, s, -1); + } } } diff --git a/deps/icu-small/source/i18n/tznames_impl.h b/deps/icu-small/source/i18n/tznames_impl.h index 6b913bb6bf8c1b..4db036e7475e35 100644 --- a/deps/icu-small/source/i18n/tznames_impl.h +++ b/deps/icu-small/source/i18n/tznames_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -27,6 +27,9 @@ #include "uvector.h" #include "umutex.h" +// Some zone display names involving supplementary characters can be over 50 chars, 100 UTF-16 code units, 200 UTF-8 bytes +#define ZONE_NAME_U16_MAX 128 + U_NAMESPACE_BEGIN /* @@ -246,6 +249,8 @@ class TZDBTimeZoneNames : public TimeZoneNames { TimeZoneNames::MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const; + // When TZDBNames for the metazone is not available, this method returns NULL, + // but does NOT set U_MISSING_RESOURCE_ERROR to status. static const TZDBNames* getMetaZoneNames(const UnicodeString& mzId, UErrorCode& status); private: diff --git a/deps/icu-small/source/i18n/tzrule.cpp b/deps/icu-small/source/i18n/tzrule.cpp index 2ff61302b8180e..f60a5e0dd59a6a 100644 --- a/deps/icu-small/source/i18n/tzrule.cpp +++ b/deps/icu-small/source/i18n/tzrule.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/tztrans.cpp b/deps/icu-small/source/i18n/tztrans.cpp index 76e259c5aef672..3199b78ea833e9 100644 --- a/deps/icu-small/source/i18n/tztrans.cpp +++ b/deps/icu-small/source/i18n/tztrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/ucal.cpp b/deps/icu-small/source/i18n/ucal.cpp index a9377b1e511f9e..4154eea83f2fa9 100644 --- a/deps/icu-small/source/i18n/ucal.cpp +++ b/deps/icu-small/source/i18n/ucal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/ucln_in.cpp b/deps/icu-small/source/i18n/ucln_in.cpp index b33a68923767ca..74c8acfab13ea4 100644 --- a/deps/icu-small/source/i18n/ucln_in.cpp +++ b/deps/icu-small/source/i18n/ucln_in.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * * ****************************************************************************** * file name: ucln_in.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/ucln_in.h b/deps/icu-small/source/i18n/ucln_in.h index b609fce0c2da5a..40a5c36d87a9f7 100644 --- a/deps/icu-small/source/i18n/ucln_in.h +++ b/deps/icu-small/source/i18n/ucln_in.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: ucln_in.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -26,6 +26,7 @@ as the functions are suppose to be called. It's usually best to have child dependencies called first. */ typedef enum ECleanupI18NType { UCLN_I18N_START = -1, + UCLN_I18N_CURRENCY_SPACING, UCLN_I18N_SPOOF, UCLN_I18N_SPOOFDATA, UCLN_I18N_TRANSLITERATOR, diff --git a/deps/icu-small/source/i18n/ucol.cpp b/deps/icu-small/source/i18n/ucol.cpp index c622aef7c245b7..34a394682f1c16 100644 --- a/deps/icu-small/source/i18n/ucol.cpp +++ b/deps/icu-small/source/i18n/ucol.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucol.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/ucol_imp.h b/deps/icu-small/source/i18n/ucol_imp.h index 7c9e8f68911209..a251fc461d3ac2 100644 --- a/deps/icu-small/source/i18n/ucol_imp.h +++ b/deps/icu-small/source/i18n/ucol_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -10,7 +10,7 @@ * * Private implementation header for C collation * file name: ucol_imp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/ucol_res.cpp b/deps/icu-small/source/i18n/ucol_res.cpp index 314b766ee6db02..0f1d6d23b132ae 100644 --- a/deps/icu-small/source/i18n/ucol_res.cpp +++ b/deps/icu-small/source/i18n/ucol_res.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucol_res.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -62,7 +62,7 @@ namespace { static const UChar *rootRules = NULL; static int32_t rootRulesLength = 0; static UResourceBundle *rootBundle = NULL; -static UInitOnce gInitOnce = U_INITONCE_INITIALIZER; +static UInitOnce gInitOnceUcolRes = U_INITONCE_INITIALIZER; } // namespace @@ -74,7 +74,7 @@ ucol_res_cleanup() { rootRulesLength = 0; ures_close(rootBundle); rootBundle = NULL; - gInitOnce.reset(); + gInitOnceUcolRes.reset(); return TRUE; } @@ -97,7 +97,7 @@ U_CDECL_END void CollationLoader::appendRootRules(UnicodeString &s) { UErrorCode errorCode = U_ZERO_ERROR; - umtx_initOnce(gInitOnce, CollationLoader::loadRootRules, errorCode); + umtx_initOnce(gInitOnceUcolRes, CollationLoader::loadRootRules, errorCode); if(U_SUCCESS(errorCode)) { s.append(rootRules, rootRulesLength); } @@ -110,7 +110,7 @@ CollationLoader::loadRules(const char *localeID, const char *collationType, U_ASSERT(collationType != NULL && *collationType != 0); // Copy the type for lowercasing. char type[16]; - int32_t typeLength = uprv_strlen(collationType); + int32_t typeLength = static_cast(uprv_strlen(collationType)); if(typeLength >= UPRV_LENGTHOF(type)) { errorCode = U_ILLEGAL_ARGUMENT_ERROR; return; @@ -318,7 +318,7 @@ CollationLoader::loadFromCollations(UErrorCode &errorCode) { // Load the collations/type tailoring, with type fallback. LocalUResourceBundlePointer localData( ures_getByKeyWithFallback(collations, type, NULL, &errorCode)); - int32_t typeLength = uprv_strlen(type); + int32_t typeLength = static_cast(uprv_strlen(type)); if(errorCode == U_MISSING_RESOURCE_ERROR) { errorCode = U_USING_DEFAULT_WARNING; typeFallback = TRUE; @@ -680,6 +680,7 @@ ucol_getKeywordValuesForLocale(const char* /*key*/, const char* locale, return NULL; } memcpy(en, &defaultKeywordValues, sizeof(UEnumeration)); + ulist_resetList(sink.values); // Initialize the iterator. en->context = sink.values; sink.values = NULL; // Avoid deletion in the sink destructor. return en; diff --git a/deps/icu-small/source/i18n/ucol_sit.cpp b/deps/icu-small/source/i18n/ucol_sit.cpp index c81977b8a34cc0..765613084f84e1 100644 --- a/deps/icu-small/source/i18n/ucol_sit.cpp +++ b/deps/icu-small/source/i18n/ucol_sit.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucol_sit.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -465,8 +465,15 @@ ucol_prepareShortStringOpen( const char *definition, UResourceBundle *collElem = NULL; char keyBuffer[256]; // if there is a keyword, we pick it up and try to get elements - if(!uloc_getKeywordValue(buffer, "collation", keyBuffer, 256, status)) { - // no keyword. we try to find the default setting, which will give us the keyword value + int32_t keyLen = uloc_getKeywordValue(buffer, "collation", keyBuffer, sizeof(keyBuffer), status); + // Treat too long a value as no keyword. + if(keyLen >= (int32_t)sizeof(keyBuffer)) { + keyLen = 0; + *status = U_ZERO_ERROR; + } + if(keyLen == 0) { + // no keyword + // we try to find the default setting, which will give us the keyword value UResourceBundle *defaultColl = ures_getByKeyWithFallback(collations, "default", NULL, status); if(U_SUCCESS(*status)) { int32_t defaultKeyLen = 0; diff --git a/deps/icu-small/source/i18n/ucoleitr.cpp b/deps/icu-small/source/i18n/ucoleitr.cpp index 4b46b205aa07db..6842061bab0912 100644 --- a/deps/icu-small/source/i18n/ucoleitr.cpp +++ b/deps/icu-small/source/i18n/ucoleitr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/i18n/ucsdet.cpp b/deps/icu-small/source/i18n/ucsdet.cpp index dd69d9f548b78a..46f69cf90cba6b 100644 --- a/deps/icu-small/source/i18n/ucsdet.cpp +++ b/deps/icu-small/source/i18n/ucsdet.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/udat.cpp b/deps/icu-small/source/i18n/udat.cpp index b07e1ceab7436d..d086067c034da6 100644 --- a/deps/icu-small/source/i18n/udat.cpp +++ b/deps/icu-small/source/i18n/udat.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/udateintervalformat.cpp b/deps/icu-small/source/i18n/udateintervalformat.cpp index e6eec44847453c..44ba6b9fb1df38 100644 --- a/deps/icu-small/source/i18n/udateintervalformat.cpp +++ b/deps/icu-small/source/i18n/udateintervalformat.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/udatpg.cpp b/deps/icu-small/source/i18n/udatpg.cpp index d8824afdfc4adf..9ba82b529c507b 100644 --- a/deps/icu-small/source/i18n/udatpg.cpp +++ b/deps/icu-small/source/i18n/udatpg.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: udatpg.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/ufieldpositer.cpp b/deps/icu-small/source/i18n/ufieldpositer.cpp index b1c9c64805889c..64de856c30867e 100644 --- a/deps/icu-small/source/i18n/ufieldpositer.cpp +++ b/deps/icu-small/source/i18n/ufieldpositer.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/uitercollationiterator.cpp b/deps/icu-small/source/i18n/uitercollationiterator.cpp index eb71725380a635..103c91cac8b132 100644 --- a/deps/icu-small/source/i18n/uitercollationiterator.cpp +++ b/deps/icu-small/source/i18n/uitercollationiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/uitercollationiterator.h b/deps/icu-small/source/i18n/uitercollationiterator.h index da9f8d34687d0b..62b6f8341933bb 100644 --- a/deps/icu-small/source/i18n/uitercollationiterator.h +++ b/deps/icu-small/source/i18n/uitercollationiterator.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/ulocdata.c b/deps/icu-small/source/i18n/ulocdata.cpp similarity index 99% rename from deps/icu-small/source/i18n/ulocdata.c rename to deps/icu-small/source/i18n/ulocdata.cpp index e1e61ce8706abc..551f6c64ed5668 100644 --- a/deps/icu-small/source/i18n/ulocdata.c +++ b/deps/icu-small/source/i18n/ulocdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * * ****************************************************************************** * file name: ulocdata.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/umsg.cpp b/deps/icu-small/source/i18n/umsg.cpp index 75647e37d6bbdf..7f6ba9532feebe 100644 --- a/deps/icu-small/source/i18n/umsg.cpp +++ b/deps/icu-small/source/i18n/umsg.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: umsg.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -321,7 +321,7 @@ umsg_applyPattern(UMessageFormat *fmt, if(status ==NULL||U_FAILURE(*status)){ return ; } - if(fmt==NULL||pattern==NULL||patternLength<-1){ + if(fmt==NULL || (pattern==NULL && patternLength!=0) || patternLength<-1) { *status=U_ILLEGAL_ARGUMENT_ERROR; return ; } @@ -329,10 +329,8 @@ umsg_applyPattern(UMessageFormat *fmt, if(parseError==NULL){ parseError = &tErr; } - if(patternLength<-1){ - patternLength=u_strlen(pattern); - } + // UnicodeString(pattern, -1) calls u_strlen(). ((MessageFormat*)fmt)->applyPattern(UnicodeString(pattern,patternLength),*parseError,*status); } diff --git a/deps/icu-small/source/i18n/umsg_imp.h b/deps/icu-small/source/i18n/umsg_imp.h index e3538d39710f31..43ef1c78f0d17d 100644 --- a/deps/icu-small/source/i18n/umsg_imp.h +++ b/deps/icu-small/source/i18n/umsg_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: umsg_imp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/unesctrn.cpp b/deps/icu-small/source/i18n/unesctrn.cpp index 2e79067dee6aa9..fcce9528e2f3dc 100644 --- a/deps/icu-small/source/i18n/unesctrn.cpp +++ b/deps/icu-small/source/i18n/unesctrn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unesctrn.h b/deps/icu-small/source/i18n/unesctrn.h index 7ae8302b0fcb33..e8e171f2bc4a69 100644 --- a/deps/icu-small/source/i18n/unesctrn.h +++ b/deps/icu-small/source/i18n/unesctrn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/uni2name.cpp b/deps/icu-small/source/i18n/uni2name.cpp index 24323b3f60642f..86d7a4904a815e 100644 --- a/deps/icu-small/source/i18n/uni2name.cpp +++ b/deps/icu-small/source/i18n/uni2name.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/uni2name.h b/deps/icu-small/source/i18n/uni2name.h index 7d85113f665b1d..4d6eaa0a9a6b65 100644 --- a/deps/icu-small/source/i18n/uni2name.h +++ b/deps/icu-small/source/i18n/uni2name.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/alphaindex.h b/deps/icu-small/source/i18n/unicode/alphaindex.h index e9e8739ed28a00..54bd29ff88668a 100644 --- a/deps/icu-small/source/i18n/unicode/alphaindex.h +++ b/deps/icu-small/source/i18n/unicode/alphaindex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -15,6 +15,7 @@ #include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/locid.h" +#include "unicode/unistr.h" #if !UCONFIG_NO_COLLATION diff --git a/deps/icu-small/source/i18n/unicode/basictz.h b/deps/icu-small/source/i18n/unicode/basictz.h index 8da4a00bf877be..eb62abaf0a679c 100644 --- a/deps/icu-small/source/i18n/unicode/basictz.h +++ b/deps/icu-small/source/i18n/unicode/basictz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/calendar.h b/deps/icu-small/source/i18n/unicode/calendar.h index b7da5f3c5b8b94..48021534b422f6 100644 --- a/deps/icu-small/source/i18n/unicode/calendar.h +++ b/deps/icu-small/source/i18n/unicode/calendar.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -1741,7 +1741,7 @@ class U_I18N_API Calendar : public UObject { * reflects local zone wall time. * @internal */ - int32_t computeMillisInDay(); + double computeMillisInDay(); /** * This method can assume EXTENDED_YEAR has been set. @@ -1752,7 +1752,7 @@ class U_I18N_API Calendar : public UObject { * when this function fails. * @internal */ - int32_t computeZoneOffset(double millis, int32_t millisInDay, UErrorCode &ec); + int32_t computeZoneOffset(double millis, double millisInDay, UErrorCode &ec); /** diff --git a/deps/icu-small/source/i18n/unicode/choicfmt.h b/deps/icu-small/source/i18n/unicode/choicfmt.h index ab3c28fe0740d7..c9f0f1114f89ed 100644 --- a/deps/icu-small/source/i18n/unicode/choicfmt.h +++ b/deps/icu-small/source/i18n/unicode/choicfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/coleitr.h b/deps/icu-small/source/i18n/unicode/coleitr.h index 628b461f9453d4..bf0e1d51a41833 100644 --- a/deps/icu-small/source/i18n/unicode/coleitr.h +++ b/deps/icu-small/source/i18n/unicode/coleitr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -47,6 +47,7 @@ U_NAMESPACE_BEGIN struct CollationData; +class CharacterIterator; class CollationIterator; class RuleBasedCollator; class UCollationPCE; diff --git a/deps/icu-small/source/i18n/unicode/coll.h b/deps/icu-small/source/i18n/unicode/coll.h index e41be2ee81a25c..d03570509ecebb 100644 --- a/deps/icu-small/source/i18n/unicode/coll.h +++ b/deps/icu-small/source/i18n/unicode/coll.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -58,7 +58,7 @@ #include "unicode/uobject.h" #include "unicode/ucol.h" -#include "unicode/normlzr.h" +#include "unicode/unorm.h" #include "unicode/locid.h" #include "unicode/uniset.h" #include "unicode/umisc.h" @@ -158,7 +158,7 @@ class CollationKey; * @see CollationKey * @see CollationElementIterator * @see Locale -* @see Normalizer +* @see Normalizer2 * @version 2.0 11/15/01 */ @@ -393,8 +393,8 @@ class U_I18N_API Collator : public UObject { * is less than, greater than or equal to another string array. *

Example of use: *

-     * .       UChar ABC[] = {0x41, 0x42, 0x43, 0};  // = "ABC"
-     * .       UChar abc[] = {0x61, 0x62, 0x63, 0};  // = "abc"
+     * .       char16_t ABC[] = {0x41, 0x42, 0x43, 0};  // = "ABC"
+     * .       char16_t abc[] = {0x61, 0x62, 0x63, 0};  // = "abc"
      * .       UErrorCode status = U_ZERO_ERROR;
      * .       Collator *myCollation =
      * .                         Collator::createInstance(Locale::getUS(), status);
@@ -420,8 +420,8 @@ class U_I18N_API Collator : public UObject {
      *         target
      * @deprecated ICU 2.6 use the overload with UErrorCode &
      */
-    virtual EComparisonResult compare(const UChar* source, int32_t sourceLength,
-                                      const UChar* target, int32_t targetLength)
+    virtual EComparisonResult compare(const char16_t* source, int32_t sourceLength,
+                                      const char16_t* target, int32_t targetLength)
                                       const;
 
     /**
@@ -440,8 +440,8 @@ class U_I18N_API Collator : public UObject {
      * than target
      * @stable ICU 2.6
      */
-    virtual UCollationResult compare(const UChar* source, int32_t sourceLength,
-                                      const UChar* target, int32_t targetLength,
+    virtual UCollationResult compare(const char16_t* source, int32_t sourceLength,
+                                      const char16_t* target, int32_t targetLength,
                                       UErrorCode &status) const = 0;
 
     /**
@@ -517,7 +517,7 @@ class U_I18N_API Collator : public UObject {
      * @see CollationKey#compare
      * @stable ICU 2.0
      */
-    virtual CollationKey& getCollationKey(const UChar*source,
+    virtual CollationKey& getCollationKey(const char16_t*source,
                                           int32_t sourceLength,
                                           CollationKey& key,
                                           UErrorCode& status) const = 0;
@@ -672,7 +672,7 @@ class U_I18N_API Collator : public UObject {
                                 UErrorCode& status);
 
     /**
-     * Get name of the object for the desired Locale, in the desired langauge
+     * Get name of the object for the desired Locale, in the desired language
      * @param objectLocale must be from getAvailableLocales
      * @param displayLocale specifies the desired locale for output
      * @param name the fill-in parameter of the return value
@@ -685,7 +685,7 @@ class U_I18N_API Collator : public UObject {
                                          UnicodeString& name);
 
     /**
-    * Get name of the object for the desired Locale, in the langauge of the
+    * Get name of the object for the desired Locale, in the language of the
     * default locale.
     * @param objectLocale must be from getAvailableLocales
     * @param name the fill-in parameter of the return value
@@ -911,7 +911,7 @@ class U_I18N_API Collator : public UObject {
      * the top of one of the supported reordering groups,
      * and it must not be beyond the last of those groups.
      * See setMaxVariable().
-     * @param varTop one or more (if contraction) UChars to which the variable top should be set
+     * @param varTop one or more (if contraction) char16_ts to which the variable top should be set
      * @param len length of variable top string. If -1 it is considered to be zero terminated.
      * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: 
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
@@ -920,7 +920,7 @@ class U_I18N_API Collator : public UObject { * @return variable top primary weight * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status) = 0; + virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status) = 0; /** * Sets the variable top to the primary weight of the specified string. @@ -929,7 +929,7 @@ class U_I18N_API Collator : public UObject { * the top of one of the supported reordering groups, * and it must not be beyond the last of those groups. * See setMaxVariable(). - * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set + * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set * @param status error code. If error code is set, the return value is undefined. Errors set by this function are:
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
* U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond @@ -1002,7 +1002,7 @@ class U_I18N_API Collator : public UObject { int32_t resultLength) const = 0; /** - * Get the sort key as an array of bytes from a UChar buffer. + * Get the sort key as an array of bytes from a char16_t buffer. * Sort key byte arrays are zero-terminated and can be compared using * strcmp(). * @@ -1020,7 +1020,7 @@ class U_I18N_API Collator : public UObject { * @return Number of bytes needed for storing the sort key * @stable ICU 2.2 */ - virtual int32_t getSortKey(const UChar*source, int32_t sourceLength, + virtual int32_t getSortKey(const char16_t*source, int32_t sourceLength, uint8_t*result, int32_t resultLength) const = 0; /** diff --git a/deps/icu-small/source/i18n/unicode/compactdecimalformat.h b/deps/icu-small/source/i18n/unicode/compactdecimalformat.h index 1fcc5c581e089d..3fbe5da9cee4b2 100644 --- a/deps/icu-small/source/i18n/unicode/compactdecimalformat.h +++ b/deps/icu-small/source/i18n/unicode/compactdecimalformat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/curramt.h b/deps/icu-small/source/i18n/unicode/curramt.h index 268d53c0b15f7e..03ec856e3bf585 100644 --- a/deps/icu-small/source/i18n/unicode/curramt.h +++ b/deps/icu-small/source/i18n/unicode/curramt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -46,7 +46,7 @@ class U_I18N_API CurrencyAmount: public Measure { * is invalid, then this will be set to a failing value. * @stable ICU 3.0 */ - CurrencyAmount(const Formattable& amount, const UChar* isoCode, + CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode, UErrorCode &ec); /** @@ -59,7 +59,7 @@ class U_I18N_API CurrencyAmount: public Measure { * then this will be set to a failing value. * @stable ICU 3.0 */ - CurrencyAmount(double amount, const UChar* isoCode, + CurrencyAmount(double amount, ConstChar16Ptr isoCode, UErrorCode &ec); /** @@ -115,14 +115,14 @@ class U_I18N_API CurrencyAmount: public Measure { * Return the ISO currency code of this object. * @stable ICU 3.0 */ - inline const UChar* getISOCurrency() const; + inline const char16_t* getISOCurrency() const; }; inline const CurrencyUnit& CurrencyAmount::getCurrency() const { return (const CurrencyUnit&) getUnit(); } -inline const UChar* CurrencyAmount::getISOCurrency() const { +inline const char16_t* CurrencyAmount::getISOCurrency() const { return getCurrency().getISOCurrency(); } diff --git a/deps/icu-small/source/i18n/unicode/currpinf.h b/deps/icu-small/source/i18n/unicode/currpinf.h index 133de38fc2fd99..1a327c5bae0033 100644 --- a/deps/icu-small/source/i18n/unicode/currpinf.h +++ b/deps/icu-small/source/i18n/unicode/currpinf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/currunit.h b/deps/icu-small/source/i18n/unicode/currunit.h index 313c92a6acacfc..e7e0dc72da8292 100644 --- a/deps/icu-small/source/i18n/unicode/currunit.h +++ b/deps/icu-small/source/i18n/unicode/currunit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -28,7 +28,7 @@ U_NAMESPACE_BEGIN /** * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese - * yen). This class is a thin wrapper over a UChar string that + * yen). This class is a thin wrapper over a char16_t string that * subclasses MeasureUnit, for use with Measure and MeasureFormat. * * @author Alan Liu @@ -36,6 +36,12 @@ U_NAMESPACE_BEGIN */ class U_I18N_API CurrencyUnit: public MeasureUnit { public: + /** + * Default constructor. Initializes currency code to "XXX" (no currency). + * @draft ICU 60 + */ + CurrencyUnit(); + /** * Construct an object with the given ISO currency code. * @param isoCode the 3-letter ISO 4217 currency code; must not be @@ -44,7 +50,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { * then this will be set to a failing value. * @stable ICU 3.0 */ - CurrencyUnit(const UChar* isoCode, UErrorCode &ec); + CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec); /** * Copy constructor @@ -52,6 +58,18 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { */ CurrencyUnit(const CurrencyUnit& other); +#ifndef U_HIDE_DRAFT_API + /** + * Copy constructor from MeasureUnit. This constructor allows you to + * restore a CurrencyUnit that was sliced to MeasureUnit. + * + * @param measureUnit The MeasureUnit to copy from. + * @param ec Set to a failing value if the MeasureUnit is not a currency. + * @draft ICU 60 + */ + CurrencyUnit(const MeasureUnit& measureUnit, UErrorCode &ec); +#endif /* U_HIDE_DRAFT_API */ + /** * Assignment operator * @stable ICU 3.0 @@ -93,16 +111,16 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { * Return the ISO currency code of this object. * @stable ICU 3.0 */ - inline const UChar* getISOCurrency() const; + inline const char16_t* getISOCurrency() const; private: /** * The ISO 4217 code of this object. */ - UChar isoCode[4]; + char16_t isoCode[4]; }; -inline const UChar* CurrencyUnit::getISOCurrency() const { +inline const char16_t* CurrencyUnit::getISOCurrency() const { return isoCode; } diff --git a/deps/icu-small/source/i18n/unicode/datefmt.h b/deps/icu-small/source/i18n/unicode/datefmt.h index 6e3a78f2913ce1..d70d8d1dd5cd99 100644 --- a/deps/icu-small/source/i18n/unicode/datefmt.h +++ b/deps/icu-small/source/i18n/unicode/datefmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/dcfmtsym.h b/deps/icu-small/source/i18n/unicode/dcfmtsym.h index 946227addb7557..4dc6f950f294ca 100644 --- a/deps/icu-small/source/i18n/unicode/dcfmtsym.h +++ b/deps/icu-small/source/i18n/unicode/dcfmtsym.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -34,7 +34,9 @@ #include "unicode/uobject.h" #include "unicode/locid.h" +#include "unicode/numsys.h" #include "unicode/unum.h" +#include "unicode/unistr.h" /** * \file @@ -183,6 +185,26 @@ class U_I18N_API DecimalFormatSymbols : public UObject { */ DecimalFormatSymbols(const Locale& locale, UErrorCode& status); +#ifndef U_HIDE_DRAFT_API + /** + * Creates a DecimalFormatSymbols instance for the given locale with digits and symbols + * corresponding to the given NumberingSystem. + * + * This constructor behaves equivalently to the normal constructor called with a locale having a + * "numbers=xxxx" keyword specifying the numbering system by name. + * + * In this constructor, the NumberingSystem argument will be used even if the locale has its own + * "numbers=xxxx" keyword. + * + * @param locale The locale to get symbols for. + * @param ns The numbering system. + * @param status Input/output parameter, set to success or + * failure code upon return. + * @draft ICU 60 + */ + DecimalFormatSymbols(const Locale& locale, const NumberingSystem& ns, UErrorCode& status); +#endif /* U_HIDE_DRAFT_API */ + /** * Create a DecimalFormatSymbols object for the default locale. * This constructor will not fail. If the resource file data is @@ -345,8 +367,11 @@ class U_I18N_API DecimalFormatSymbols : public UObject { * @param success Input/output parameter, set to success or * failure code upon return. * @param useLastResortData determine if use last resort data + * @param ns The NumberingSystem to use; otherwise, fall + * back to the locale. */ - void initialize(const Locale& locale, UErrorCode& success, UBool useLastResortData = FALSE); + void initialize(const Locale& locale, UErrorCode& success, + UBool useLastResortData = FALSE, const NumberingSystem* ns = nullptr); /** * Initialize the symbols with default values. @@ -392,7 +417,7 @@ class U_I18N_API DecimalFormatSymbols : public UObject { * Returns that pattern stored in currecy info. Internal API for use by NumberFormat API. * @internal */ - inline const UChar* getCurrencyPattern(void) const; + inline const char16_t* getCurrencyPattern(void) const; #endif /* U_HIDE_INTERNAL_API */ private: @@ -423,7 +448,7 @@ class U_I18N_API DecimalFormatSymbols : public UObject { char actualLocale[ULOC_FULLNAME_CAPACITY]; char validLocale[ULOC_FULLNAME_CAPACITY]; - const UChar* currPattern; + const char16_t* currPattern; UnicodeString currencySpcBeforeSym[UNUM_CURRENCY_SPACING_COUNT]; UnicodeString currencySpcAfterSym[UNUM_CURRENCY_SPACING_COUNT]; @@ -491,7 +516,7 @@ DecimalFormatSymbols::getLocale() const { } #ifndef U_HIDE_INTERNAL_API -inline const UChar* +inline const char16_t* DecimalFormatSymbols::getCurrencyPattern() const { return currPattern; } diff --git a/deps/icu-small/source/i18n/unicode/decimfmt.h b/deps/icu-small/source/i18n/unicode/decimfmt.h index 7339399f72e001..790053636d5957 100644 --- a/deps/icu-small/source/i18n/unicode/decimfmt.h +++ b/deps/icu-small/source/i18n/unicode/decimfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -604,7 +604,7 @@ template class U_I18N_API EnumSet"* #0 o''clock", the format width is 10. * - *
  • The width is counted in 16-bit code units (UChars). + *
  • The width is counted in 16-bit code units (char16_ts). * *
  • Some parameters which usually do not matter have meaning when padding is * used, because the pattern width is significant with padding. In the pattern @@ -668,28 +668,6 @@ template class U_I18N_API EnumSetCurrency Context object used to display currency. @@ -1986,14 +1964,12 @@ class U_I18N_API DecimalFormat: public NumberFormat { UCurrencyUsage getCurrencyUsage() const; -#ifndef U_HIDE_DEPRECATED_API /** * The resource tags we use to retrieve decimal format data from * locale resource bundles. * @deprecated ICU 3.4. This string has no public purpose. Please don't use it. */ static const char fgNumberPatterns[]; -#endif /* U_HIDE_DEPRECATED_API */ #ifndef U_HIDE_INTERNAL_API /** @@ -2108,7 +2084,7 @@ class U_I18N_API DecimalFormat: public NumberFormat { void parse(const UnicodeString& text, Formattable& result, ParsePosition& pos, - UChar* currency) const; + char16_t* currency) const; enum { fgStatusInfinite, @@ -2124,7 +2100,7 @@ class U_I18N_API DecimalFormat: public NumberFormat { int8_t type, ParsePosition& parsePosition, DigitList& digits, UBool* status, - UChar* currency) const; + char16_t* currency) const; // Mixed style parsing for currency. // It parses against the current currency pattern @@ -2135,7 +2111,7 @@ class U_I18N_API DecimalFormat: public NumberFormat { ParsePosition& parsePosition, DigitList& digits, UBool* status, - UChar* currency) const; + char16_t* currency) const; int32_t skipPadding(const UnicodeString& text, int32_t position) const; @@ -2146,7 +2122,7 @@ class U_I18N_API DecimalFormat: public NumberFormat { const UnicodeString* affixPat, UBool complexCurrencyParsing, int8_t type, - UChar* currency) const; + char16_t* currency) const; static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix); @@ -2169,7 +2145,7 @@ class U_I18N_API DecimalFormat: public NumberFormat { const UnicodeString& input, int32_t pos, int8_t type, - UChar* currency) const; + char16_t* currency) const; static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch); @@ -2195,11 +2171,11 @@ class U_I18N_API DecimalFormat: public NumberFormat { void setupCurrencyAffixPatterns(UErrorCode& status); // get the currency rounding with respect to currency usage - double getCurrencyRounding(const UChar* currency, + double getCurrencyRounding(const char16_t* currency, UErrorCode* ec) const; // get the currency fraction with respect to currency usage - int getCurrencyFractionDigits(const UChar* currency, + int getCurrencyFractionDigits(const char16_t* currency, UErrorCode* ec) const; // hashtable operations @@ -2271,7 +2247,7 @@ class U_I18N_API DecimalFormat: public NumberFormat { * have a capacity of at least 4 * @internal */ - virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const; + virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const; /** number of integer digits * @stable ICU 2.4 diff --git a/deps/icu-small/source/i18n/unicode/dtfmtsym.h b/deps/icu-small/source/i18n/unicode/dtfmtsym.h index 507868e2c328fb..ed7c1898465e5d 100644 --- a/deps/icu-small/source/i18n/unicode/dtfmtsym.h +++ b/deps/icu-small/source/i18n/unicode/dtfmtsym.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -25,6 +25,7 @@ #if !UCONFIG_NO_FORMATTING #include "unicode/calendar.h" +#include "unicode/strenum.h" #include "unicode/uobject.h" #include "unicode/locid.h" #include "unicode/udat.h" @@ -426,13 +427,13 @@ class U_I18N_API DateFormatSymbols U_FINAL : public UObject { * doesn't specify any time separator, and always recognized when parsing. * @internal */ - static const UChar DEFAULT_TIME_SEPARATOR = 0x003a; // ':' + static const char16_t DEFAULT_TIME_SEPARATOR = 0x003a; // ':' /** * This alternate time separator is always recognized when parsing. * @internal */ - static const UChar ALTERNATE_TIME_SEPARATOR = 0x002e; // '.' + static const char16_t ALTERNATE_TIME_SEPARATOR = 0x002e; // '.' /** * Gets the time separator string. For example: ":". @@ -566,7 +567,7 @@ class U_I18N_API DateFormatSymbols U_FINAL : public UObject { * @return the non-localized date-time pattern characters * @stable ICU 2.0 */ - static const UChar * U_EXPORT2 getPatternUChars(void); + static const char16_t * U_EXPORT2 getPatternUChars(void); /** * Gets localized date-time pattern characters. For example: 'u', 't', etc. @@ -977,7 +978,7 @@ class U_I18N_API DateFormatSymbols U_FINAL : public UObject { * Returns the date format field index of the pattern character c, * or UDAT_FIELD_COUNT if c is not a pattern character. */ - static UDateFormatField U_EXPORT2 getPatternCharIndex(UChar c); + static UDateFormatField U_EXPORT2 getPatternCharIndex(char16_t c); /** * Returns TRUE if f (with its pattern character repeated count times) is a numeric field. @@ -987,7 +988,7 @@ class U_I18N_API DateFormatSymbols U_FINAL : public UObject { /** * Returns TRUE if c (repeated count times) is the pattern character for a numeric field. */ - static UBool U_EXPORT2 isNumericPatternChar(UChar c, int32_t count); + static UBool U_EXPORT2 isNumericPatternChar(char16_t c, int32_t count); public: #ifndef U_HIDE_INTERNAL_API /** diff --git a/deps/icu-small/source/i18n/unicode/dtitvfmt.h b/deps/icu-small/source/i18n/unicode/dtitvfmt.h index 68360b87dffaf5..5eaa559d0eaf48 100644 --- a/deps/icu-small/source/i18n/unicode/dtitvfmt.h +++ b/deps/icu-small/source/i18n/unicode/dtitvfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************************** * Copyright (C) 2008-2016, International Business Machines Corporation and @@ -996,7 +996,7 @@ class U_I18N_API DateIntervalFormat : public Format { // from calendar field to pattern letter - static const UChar fgCalendarFieldToPatternLetter[]; + static const char16_t fgCalendarFieldToPatternLetter[]; /** diff --git a/deps/icu-small/source/i18n/unicode/dtitvinf.h b/deps/icu-small/source/i18n/unicode/dtitvinf.h index b31061e16aff10..fac88581a227d4 100644 --- a/deps/icu-small/source/i18n/unicode/dtitvinf.h +++ b/deps/icu-small/source/i18n/unicode/dtitvinf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -152,8 +152,6 @@ U_NAMESPACE_BEGIN class U_I18N_API DateIntervalInfo U_FINAL : public UObject { public: - // Do not enclose the protected default constructor with #ifndef U_HIDE_INTERNAL_API - // or else the compiler will create a public default constructor. /** * Default constructor. * It does not initialize any interval patterns except diff --git a/deps/icu-small/source/i18n/unicode/dtptngen.h b/deps/icu-small/source/i18n/unicode/dtptngen.h index fd617ce3cdcbfb..5712edbb9ff607 100644 --- a/deps/icu-small/source/i18n/unicode/dtptngen.h +++ b/deps/icu-small/source/i18n/unicode/dtptngen.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -18,6 +18,7 @@ #include "unicode/locid.h" #include "unicode/udat.h" #include "unicode/udatpg.h" +#include "unicode/unistr.h" U_NAMESPACE_BEGIN @@ -27,6 +28,7 @@ U_NAMESPACE_BEGIN */ +class CharString; class Hashtable; class FormatParser; class DateTimeMatcher; @@ -205,11 +207,11 @@ class U_I18N_API DateTimePatternGenerator : public UObject { * @return conflicting status. The value could be UDATPG_NO_CONFLICT, * UDATPG_BASE_CONFLICT or UDATPG_CONFLICT. * @stable ICU 3.8 - *

    - *

    Sample code

    - * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1 - * \snippet samples/dtptngsample/dtptngsample.cpp addPatternExample - *

    + *

    + *

    Sample code

    + * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1 + * \snippet samples/dtptngsample/dtptngsample.cpp addPatternExample + *

    */ UDateTimePatternConflict addPattern(const UnicodeString& pattern, UBool override, @@ -311,11 +313,11 @@ class U_I18N_API DateTimePatternGenerator : public UObject { * @return bestPattern * The best pattern found from the given skeleton. * @stable ICU 3.8 - *

    - *

    Sample code

    - * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1 - * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample - *

    + *

    + *

    Sample code

    + * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1 + * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample + *

    */ UnicodeString getBestPattern(const UnicodeString& skeleton, UErrorCode& status); @@ -359,11 +361,11 @@ class U_I18N_API DateTimePatternGenerator : public UObject { * which must not indicate a failure before the function call. * @return pattern adjusted to match the skeleton fields widths and subtypes. * @stable ICU 3.8 - *

    - *

    Sample code

    - * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1 - * \snippet samples/dtptngsample/dtptngsample.cpp replaceFieldTypesExample - *

    + *

    + *

    Sample code

    + * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1 + * \snippet samples/dtptngsample/dtptngsample.cpp replaceFieldTypesExample + *

    */ UnicodeString replaceFieldTypes(const UnicodeString& pattern, const UnicodeString& skeleton, @@ -517,7 +519,7 @@ class U_I18N_API DateTimePatternGenerator : public UObject { DateTimeMatcher *skipMatcher; Hashtable *fAvailableFormatKeyHash; UnicodeString emptyString; - UChar fDefaultHourFormatChar; + char16_t fDefaultHourFormatChar; int32_t fAllowedHourFormats[7]; // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN. @@ -525,9 +527,8 @@ class U_I18N_API DateTimePatternGenerator : public UObject { enum { kDTPGNoFlags = 0, kDTPGFixFractionalSeconds = 1, - kDTPGSkeletonUsesCapJ = 2, - kDTPGSkeletonUsesLowB = 3, - kDTPGSkeletonUsesCapB = 4 + kDTPGSkeletonUsesCapJ = 2 + // with #13183, no longer need flags for b, B }; void initData(const Locale &locale, UErrorCode &status); @@ -545,6 +546,7 @@ class U_I18N_API DateTimePatternGenerator : public UObject { UDateTimePatternField getAppendNameNumber(const char* field) const; UnicodeString& getMutableAppendItemName(UDateTimePatternField field); void getAppendName(UDateTimePatternField field, UnicodeString& value); + UnicodeString mapSkeletonMetacharacters(const UnicodeString& patternForm, int32_t* flags, UErrorCode& status); int32_t getCanonicalIndex(const UnicodeString& field); const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, const PtnSkeleton** specifiedSkeletonPtr = 0); UnicodeString adjustFieldTypes(const UnicodeString& pattern, const PtnSkeleton* specifiedSkeleton, int32_t flags, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS); diff --git a/deps/icu-small/source/i18n/unicode/dtrule.h b/deps/icu-small/source/i18n/unicode/dtrule.h index 32d230ea778244..24dfc69de1df22 100644 --- a/deps/icu-small/source/i18n/unicode/dtrule.h +++ b/deps/icu-small/source/i18n/unicode/dtrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/fieldpos.h b/deps/icu-small/source/i18n/unicode/fieldpos.h index 6091941106e87d..78561a4de7d8b1 100644 --- a/deps/icu-small/source/i18n/unicode/fieldpos.h +++ b/deps/icu-small/source/i18n/unicode/fieldpos.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/fmtable.h b/deps/icu-small/source/i18n/unicode/fmtable.h index ac5daba893646f..766a71969deadc 100644 --- a/deps/icu-small/source/i18n/unicode/fmtable.h +++ b/deps/icu-small/source/i18n/unicode/fmtable.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/format.h b/deps/icu-small/source/i18n/unicode/format.h index 1484e9f00edf6d..e64cc1c6eb39b4 100644 --- a/deps/icu-small/source/i18n/unicode/format.h +++ b/deps/icu-small/source/i18n/unicode/format.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/fpositer.h b/deps/icu-small/source/i18n/unicode/fpositer.h index 694a1d8770d019..8e9d69c547f849 100644 --- a/deps/icu-small/source/i18n/unicode/fpositer.h +++ b/deps/icu-small/source/i18n/unicode/fpositer.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -47,6 +47,13 @@ U_NAMESPACE_BEGIN class UVector32; +// Forward declaration for number formatting: +namespace number { +namespace impl { +class NumberStringBuilder; +} +} + /** * FieldPositionIterator returns the field ids and their start/limit positions generated * by a call to Format::format. See Format, NumberFormat, DecimalFormat. @@ -99,8 +106,6 @@ class U_I18N_API FieldPositionIterator : public UObject { UBool next(FieldPosition& fp); private: - friend class FieldPositionIteratorHandler; - /** * Sets the data used by the iterator, and resets the position. * Returns U_ILLEGAL_ARGUMENT_ERROR in status if the data is not valid @@ -108,6 +113,9 @@ class U_I18N_API FieldPositionIterator : public UObject { */ void setData(UVector32 *adopt, UErrorCode& status); + friend class FieldPositionIteratorHandler; + friend class number::impl::NumberStringBuilder; + UVector32 *data; int32_t pos; }; diff --git a/deps/icu-small/source/i18n/unicode/gender.h b/deps/icu-small/source/i18n/unicode/gender.h index 02948951843c10..467b64ec5ebad0 100644 --- a/deps/icu-small/source/i18n/unicode/gender.h +++ b/deps/icu-small/source/i18n/unicode/gender.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/gregocal.h b/deps/icu-small/source/i18n/unicode/gregocal.h index 60ba0cc6acf6f4..1d881e0be76067 100644 --- a/deps/icu-small/source/i18n/unicode/gregocal.h +++ b/deps/icu-small/source/i18n/unicode/gregocal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 1997-2013, International Business Machines Corporation and others. diff --git a/deps/icu-small/source/i18n/unicode/measfmt.h b/deps/icu-small/source/i18n/unicode/measfmt.h index 866d7d3227cae7..251fd213b50da7 100644 --- a/deps/icu-small/source/i18n/unicode/measfmt.h +++ b/deps/icu-small/source/i18n/unicode/measfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -210,7 +210,6 @@ class U_I18N_API MeasureFormat : public Format { FieldPosition &pos, UErrorCode &status) const; -#ifndef U_HIDE_DRAFT_API /** * Gets the display name of the specified {@link MeasureUnit} corresponding to the current * locale and format width. @@ -220,10 +219,9 @@ class U_I18N_API MeasureFormat : public Format { * {@link MeasureFormat#getInstance}, or null if there is no display name available * for the specified unit. * - * @draft ICU 58 + * @stable ICU 58 */ UnicodeString getUnitDisplayName(const MeasureUnit& unit, UErrorCode &status) const; -#endif /* U_HIDE_DRAFT_API */ /** diff --git a/deps/icu-small/source/i18n/unicode/measunit.h b/deps/icu-small/source/i18n/unicode/measunit.h index 9810b91194616b..08c8d6f588dac7 100644 --- a/deps/icu-small/source/i18n/unicode/measunit.h +++ b/deps/icu-small/source/i18n/unicode/measunit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -40,11 +40,10 @@ class U_I18N_API MeasureUnit: public UObject { /** * Default constructor. + * Populates the instance with the base dimensionless unit. * @stable ICU 3.0 */ - MeasureUnit() : fTypeId(0), fSubTypeId(0) { - fCurrency[0] = 0; - } + MeasureUnit(); /** * Copy constructor. @@ -149,7 +148,7 @@ class U_I18N_API MeasureUnit: public UObject { *

          * .   Base* polymorphic_pointer = createPolymorphicObject();
          * .   if (polymorphic_pointer->getDynamicClassID() ==
    -     * .       erived::getStaticClassID()) ...
    +     * .       Derived::getStaticClassID()) ...
          * 
    * @return The class ID for all objects of this class. * @stable ICU 53 @@ -345,35 +344,29 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createKarat(UErrorCode &status); -#ifndef U_HIDE_DRAFT_API /** * Returns unit of concentr: milligram-per-deciliter. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns unit of concentr: millimole-per-liter. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createMillimolePerLiter(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns unit of concentr: part-per-million. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createPartPerMillion(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ /** * Returns unit of consumption: liter-per-100kilometers. @@ -399,55 +392,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createMilePerGallon(UErrorCode &status); -#ifndef U_HIDE_DRAFT_API /** * Returns unit of consumption: mile-per-gallon-imperial. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createMilePerGallonImperial(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: east. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 - */ - static MeasureUnit *createEast(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: north. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 - */ - static MeasureUnit *createNorth(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: south. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 - */ - static MeasureUnit *createSouth(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: west. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 + /* + * The following were draft ICU 58, but have been withdrawn: + * static MeasureUnit *createEast(UErrorCode &status); + * static MeasureUnit *createNorth(UErrorCode &status); + * static MeasureUnit *createSouth(UErrorCode &status); + * static MeasureUnit *createWest(UErrorCode &status); */ - static MeasureUnit *createWest(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ /** * Returns unit of digital: bit. @@ -873,6 +832,16 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createPicometer(UErrorCode &status); +#ifndef U_HIDE_DRAFT_API + /** + * Returns unit of length: point. + * Caller owns returned value and must free it. + * @param status ICU error code. + * @draft ICU 59 + */ + static MeasureUnit *createPoint(UErrorCode &status); +#endif /* U_HIDE_DRAFT_API */ + /** * Returns unit of length: yard. * Caller owns returned value and must free it. @@ -1249,15 +1218,13 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createGallon(UErrorCode &status); -#ifndef U_HIDE_DRAFT_API /** * Returns unit of volume: gallon-imperial. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createGallonImperial(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ /** * Returns unit of volume: hectoliter. @@ -1349,6 +1316,12 @@ class U_I18N_API MeasureUnit: public UObject { */ void initCurrency(const char *isoCurrency); + /** + * For ICU use only. + * @internal + */ + void initNoUnit(const char *subtype); + #endif /* U_HIDE_INTERNAL_API */ private: diff --git a/deps/icu-small/source/i18n/unicode/measure.h b/deps/icu-small/source/i18n/unicode/measure.h index 719bc6bc8f6054..71438d5c856b78 100644 --- a/deps/icu-small/source/i18n/unicode/measure.h +++ b/deps/icu-small/source/i18n/unicode/measure.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/msgfmt.h b/deps/icu-small/source/i18n/unicode/msgfmt.h index 1a9973872d627d..fef80107747bf8 100644 --- a/deps/icu-small/source/i18n/unicode/msgfmt.h +++ b/deps/icu-small/source/i18n/unicode/msgfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2007-2013, International Business Machines Corporation and @@ -939,7 +939,7 @@ class U_I18N_API MessageFormat : public Format { * @return the index of the list which matches the keyword s. */ static int32_t findKeyword( const UnicodeString& s, - const UChar * const *list); + const char16_t * const *list); /** * Thin wrapper around the format(... AppendableWrapper ...) variant. diff --git a/deps/icu-small/source/i18n/unicode/nounit.h b/deps/icu-small/source/i18n/unicode/nounit.h new file mode 100644 index 00000000000000..04fc84b33aa338 --- /dev/null +++ b/deps/icu-small/source/i18n/unicode/nounit.h @@ -0,0 +1,111 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* + ******************************************************************************* + * Copyright (C) 2009-2017, International Business Machines Corporation, * + * Google, and others. All Rights Reserved. * + ******************************************************************************* + */ + +#ifndef __NOUNIT_H__ +#define __NOUNIT_H__ + + +/** + * \file + * \brief C++ API: units for percent and permille + */ + + +#include "unicode/measunit.h" + +#if !UCONFIG_NO_FORMATTING + +U_NAMESPACE_BEGIN + +#ifndef U_HIDE_DRAFT_API +/** + * Dimensionless unit for percent and permille. + * @see NumberFormatter + * @draft ICU 60 + */ +class U_I18N_API NoUnit: public MeasureUnit { +public: + /** + * Returns an instance for the base unit (dimensionless and no scaling). + * + * @return a NoUnit instance + * @draft ICU 60 + */ + static NoUnit U_EXPORT2 base(); + + /** + * Returns an instance for percent, or 1/100 of a base unit. + * + * @return a NoUnit instance + * @draft ICU 60 + */ + static NoUnit U_EXPORT2 percent(); + + /** + * Returns an instance for permille, or 1/1000 of a base unit. + * + * @return a NoUnit instance + * @draft ICU 60 + */ + static NoUnit U_EXPORT2 permille(); + + /** + * Copy operator. + * @draft ICU 60 + */ + NoUnit(const NoUnit& other); + + /** + * Return a polymorphic clone of this object. The result will + * have the same class as returned by getDynamicClassID(). + * @draft ICU 60 + */ + virtual UObject* clone() const; + + /** + * Returns a unique class ID for this object POLYMORPHICALLY. + * This method implements a simple form of RTTI used by ICU. + * @return The class ID for this object. All objects of a given + * class have the same class ID. Objects of other classes have + * different class IDs. + * @draft ICU 60 + */ + virtual UClassID getDynamicClassID() const; + + /** + * Returns the class ID for this class. This is used to compare to + * the return value of getDynamicClassID(). + * @return The class ID for all objects of this class. + * @draft ICU 60 + */ + static UClassID U_EXPORT2 getStaticClassID(); + + /** + * Destructor. + * @draft ICU 60 + */ + virtual ~NoUnit(); + +private: + /** + * Constructor + * @internal (private) + */ + NoUnit(const char* subtype); + +}; +#endif /* U_HIDE_DRAFT_API */ + +U_NAMESPACE_END + +#endif /* #if !UCONFIG_NO_FORMATTING */ + +#endif // __NOUNIT_H__ +//eof +// diff --git a/deps/icu-small/source/i18n/unicode/numberformatter.h b/deps/icu-small/source/i18n/unicode/numberformatter.h new file mode 100644 index 00000000000000..4a11c2f9157e61 --- /dev/null +++ b/deps/icu-small/source/i18n/unicode/numberformatter.h @@ -0,0 +1,1998 @@ +// © 2017 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" + +#if !UCONFIG_NO_FORMATTING +#ifndef __NUMBERFORMATTER_H__ +#define __NUMBERFORMATTER_H__ + +#include "unicode/appendable.h" +#include "unicode/dcfmtsym.h" +#include "unicode/currunit.h" +#include "unicode/fieldpos.h" +#include "unicode/fpositer.h" +#include "unicode/measunit.h" +#include "unicode/nounit.h" +#include "unicode/plurrule.h" +#include "unicode/ucurr.h" +#include "unicode/unum.h" + +#ifndef U_HIDE_DRAFT_API + +/** + * \file + * \brief C++ API: Library for localized number formatting introduced in ICU 60. + * + * This library was introduced in ICU 60 to simplify the process of formatting localized number strings. + * Basic usage examples: + * + *
    + * // Most basic usage:
    + * NumberFormatter::withLocale(...).format(123).toString();  // 1,234 in en-US
    + *
    + * // Custom notation, unit, and rounding strategy:
    + * NumberFormatter::with()
    + *     .notation(Notation::compactShort())
    + *     .unit(CurrencyUnit("EUR", status))
    + *     .rounding(Rounder::maxDigits(2))
    + *     .locale(...)
    + *     .format(1234)
    + *     .toString();  // €1.2K in en-US
    + *
    + * // Create a formatter in a singleton for use later:
    + * static const LocalizedNumberFormatter formatter = NumberFormatter::withLocale(...)
    + *     .unit(NoUnit::percent())
    + *     .rounding(Rounder::fixedFraction(3));
    + * formatter.format(5.9831).toString();  // 5.983% in en-US
    + *
    + * // Create a "template" in a singleton but without setting a locale until the call site:
    + * static const UnlocalizedNumberFormatter template = NumberFormatter::with()
    + *     .sign(UNumberSignDisplay::UNUM_SIGN_ALWAYS)
    + *     .adoptUnit(MeasureUnit::createMeter(status))
    + *     .unitWidth(UNumberUnitWidth::UNUM_UNIT_WIDTH_FULL_NAME);
    + * template.locale(...).format(1234).toString();  // +1,234 meters in en-US
    + * 
    + * + *

    + * This API offers more features than DecimalFormat and is geared toward new users of ICU. + * + *

    + * NumberFormatter instances are immutable and thread safe. This means that invoking a configuration method has no + * effect on the receiving instance; you must store and use the new number formatter instance it returns instead. + * + *

    + * UnlocalizedNumberFormatter formatter = UnlocalizedNumberFormatter::with().notation(Notation::scientific());
    + * formatter.rounding(Rounder.maxFraction(2)); // does nothing!
    + * formatter.locale(Locale.getEnglish()).format(9.8765).toString(); // prints "9.8765E0", not "9.88E0"
    + * 
    + * + *

    + * This API is based on the fluent design pattern popularized by libraries such as Google's Guava. For + * extensive details on the design of this API, read the design doc. + * + * @author Shane Carr + */ + +/** + * An enum declaring how to render units, including currencies. Example outputs when formatting 123 USD and 123 + * meters in en-CA: + * + *

    + *

      + *
    • NARROW*: "$123.00" and "123 m" + *
    • SHORT: "US$ 123.00" and "123 m" + *
    • FULL_NAME: "123.00 US dollars" and "123 meters" + *
    • ISO_CODE: "USD 123.00" and undefined behavior + *
    • HIDDEN: "123.00" and "123" + *
    + * + *

    + * * The narrow format for currencies is not currently supported; this is a known issue that will be fixed in a + * future version. See #11666 for more information. + * + *

    + * This enum is similar to {@link com.ibm.icu.text.MeasureFormat.FormatWidth}. + * + * @draft ICU 60 + */ +typedef enum UNumberUnitWidth { + /** + * Print an abbreviated version of the unit name. Similar to SHORT, but always use the shortest available + * abbreviation or symbol. This option can be used when the context hints at the identity of the unit. For more + * information on the difference between NARROW and SHORT, see SHORT. + * + *

    + * In CLDR, this option corresponds to the "Narrow" format for measure units and the "¤¤¤¤¤" placeholder for + * currencies. + * + * @draft ICU 60 + */ + UNUM_UNIT_WIDTH_NARROW, + + /** + * Print an abbreviated version of the unit name. Similar to NARROW, but use a slightly wider abbreviation or + * symbol when there may be ambiguity. This is the default behavior. + * + *

    + * For example, in es-US, the SHORT form for Fahrenheit is "{0} °F", but the NARROW form is "{0}°", + * since Fahrenheit is the customary unit for temperature in that locale. + * + *

    + * In CLDR, this option corresponds to the "Short" format for measure units and the "¤" placeholder for + * currencies. + * + * @draft ICU 60 + */ + UNUM_UNIT_WIDTH_SHORT, + + /** + * Print the full name of the unit, without any abbreviations. + * + *

    + * In CLDR, this option corresponds to the default format for measure units and the "¤¤¤" placeholder for + * currencies. + * + * @draft ICU 60 + */ + UNUM_UNIT_WIDTH_FULL_NAME, + + /** + * Use the three-digit ISO XXX code in place of the symbol for displaying currencies. The behavior of this + * option is currently undefined for use with measure units. + * + *

    + * In CLDR, this option corresponds to the "¤¤" placeholder for currencies. + * + * @draft ICU 60 + */ + UNUM_UNIT_WIDTH_ISO_CODE, + + /** + * Format the number according to the specified unit, but do not display the unit. For currencies, apply + * monetary symbols and formats as with SHORT, but omit the currency symbol. For measure units, the behavior is + * equivalent to not specifying the unit at all. + * + * @draft ICU 60 + */ + UNUM_UNIT_WIDTH_HIDDEN, + + /** + * One more than the highest UNumberUnitWidth value. + * + * @internal ICU 60: The numeric value may change over time; see ICU ticket #12420. + */ + UNUM_UNIT_WIDTH_COUNT +} UNumberUnitWidth; + +/** + * An enum declaring how to denote positive and negative numbers. Example outputs when formatting 123 and -123 in + * en-US: + * + *

    + *

      + *
    • AUTO: "123", "-123" + *
    • ALWAYS: "+123", "-123" + *
    • NEVER: "123", "123" + *
    • ACCOUNTING: "$123", "($123)" + *
    • ACCOUNTING_ALWAYS: "+$123", "($123)" + *
    + * + *

    + * The exact format, including the position and the code point of the sign, differ by locale. + * + * @draft ICU 60 + */ +typedef enum UNumberSignDisplay { + /** + * Show the minus sign on negative numbers, and do not show the sign on positive numbers. This is the default + * behavior. + * + * @draft ICU 60 + */ + UNUM_SIGN_AUTO, + + /** + * Show the minus sign on negative numbers and the plus sign on positive numbers. + * + * @draft ICU 60 + */ + UNUM_SIGN_ALWAYS, + + /** + * Do not show the sign on positive or negative numbers. + * + * @draft ICU 60 + */ + UNUM_SIGN_NEVER, + + /** + * Use the locale-dependent accounting format on negative numbers, and do not show the sign on positive numbers. + * + *

    + * The accounting format is defined in CLDR and varies by locale; in many Western locales, the format is a pair + * of parentheses around the number. + * + *

    + * Note: Since CLDR defines the accounting format in the monetary context only, this option falls back to the + * AUTO sign display strategy when formatting without a currency unit. This limitation may be lifted in the + * future. + * + * @draft ICU 60 + */ + UNUM_SIGN_ACCOUNTING, + + /** + * Use the locale-dependent accounting format on negative numbers, and show the plus sign on positive numbers. + * For more information on the accounting format, see the ACCOUNTING sign display strategy. + * + * @draft ICU 60 + */ + UNUM_SIGN_ACCOUNTING_ALWAYS, + + /** + * One more than the highest UNumberSignDisplay value. + * + * @internal ICU 60: The numeric value may change over time; see ICU ticket #12420. + */ + UNUM_SIGN_COUNT +} UNumberSignDisplay; + +/** + * An enum declaring how to render the decimal separator. + * + *

    + *

      + *
    • UNUM_DECIMAL_SEPARATOR_AUTO: "1", "1.1" + *
    • UNUM_DECIMAL_SEPARATOR_ALWAYS: "1.", "1.1" + *
    + */ +typedef enum UNumberDecimalSeparatorDisplay { + /** + * Show the decimal separator when there are one or more digits to display after the separator, and do not show + * it otherwise. This is the default behavior. + * + * @draft ICU 60 + */ + UNUM_DECIMAL_SEPARATOR_AUTO, + + /** + * Always show the decimal separator, even if there are no digits to display after the separator. + * + * @draft ICU 60 + */ + UNUM_DECIMAL_SEPARATOR_ALWAYS, + + /** + * One more than the highest UNumberDecimalSeparatorDisplay value. + * + * @internal ICU 60: The numeric value may change over time; see ICU ticket #12420. + */ + UNUM_DECIMAL_SEPARATOR_COUNT +} UNumberDecimalMarkDisplay; + +U_NAMESPACE_BEGIN namespace number { // icu::number + +// Forward declarations: +class UnlocalizedNumberFormatter; +class LocalizedNumberFormatter; +class FormattedNumber; +class Notation; +class ScientificNotation; +class Rounder; +class FractionRounder; +class CurrencyRounder; +class IncrementRounder; +class Grouper; +class IntegerWidth; + +namespace impl { + +// Forward declarations: +class Padder; +struct MacroProps; +struct MicroProps; +class DecimalQuantity; +struct NumberFormatterResults; +class NumberFormatterImpl; +struct ParsedPatternInfo; +class ScientificModifier; +class MultiplierProducer; +class MutablePatternModifier; +class LongNameHandler; +class ScientificHandler; +class CompactHandler; +class Modifier; +class NumberStringBuilder; + +} // namespace impl + +// Reserve extra names in case they are added as classes in the future: +typedef Notation CompactNotation; +typedef Notation SimpleNotation; + +/** + * A class that defines the notation style to be used when formatting numbers in NumberFormatter. + * + * @draft ICU 60 + */ +class U_I18N_API Notation : public UMemory { + public: + /** + * Print the number using scientific notation (also known as scientific form, standard index form, or standard form + * in the UK). The format for scientific notation varies by locale; for example, many Western locales display the + * number in the form "#E0", where the number is displayed with one digit before the decimal separator, zero or more + * digits after the decimal separator, and the corresponding power of 10 displayed after the "E". + * + *

    + * Example outputs in en-US when printing 8.765E4 through 8.765E-3: + * + *

    +     * 8.765E4
    +     * 8.765E3
    +     * 8.765E2
    +     * 8.765E1
    +     * 8.765E0
    +     * 8.765E-1
    +     * 8.765E-2
    +     * 8.765E-3
    +     * 0E0
    +     * 
    + * + * @return A ScientificNotation for chaining or passing to the NumberFormatter notation() setter. + * @draft ICU 60 + */ + static ScientificNotation scientific(); + + /** + * Print the number using engineering notation, a variant of scientific notation in which the exponent must be + * divisible by 3. + * + *

    + * Example outputs in en-US when printing 8.765E4 through 8.765E-3: + * + *

    +     * 87.65E3
    +     * 8.765E3
    +     * 876.5E0
    +     * 87.65E0
    +     * 8.765E0
    +     * 876.5E-3
    +     * 87.65E-3
    +     * 8.765E-3
    +     * 0E0
    +     * 
    + * + * @return A ScientificNotation for chaining or passing to the NumberFormatter notation() setter. + * @draft ICU 60 + */ + static ScientificNotation engineering(); + + /** + * Print the number using short-form compact notation. + * + *

    + * Compact notation, defined in Unicode Technical Standard #35 Part 3 Section 2.4.1, prints numbers with + * localized prefixes or suffixes corresponding to different powers of ten. Compact notation is similar to + * engineering notation in how it scales numbers. + * + *

    + * Compact notation is ideal for displaying large numbers (over ~1000) to humans while at the same time minimizing + * screen real estate. + * + *

    + * In short form, the powers of ten are abbreviated. In en-US, the abbreviations are "K" for thousands, "M" + * for millions, "B" for billions, and "T" for trillions. Example outputs in en-US when printing 8.765E7 + * through 8.765E0: + * + *

    +     * 88M
    +     * 8.8M
    +     * 876K
    +     * 88K
    +     * 8.8K
    +     * 876
    +     * 88
    +     * 8.8
    +     * 
    + * + *

    + * When compact notation is specified without an explicit rounding strategy, numbers are rounded off to the closest + * integer after scaling the number by the corresponding power of 10, but with a digit shown after the decimal + * separator if there is only one digit before the decimal separator. The default compact notation rounding strategy + * is equivalent to: + * + *

    +     * Rounder.integer().withMinDigits(2)
    +     * 
    + * + * @return A CompactNotation for passing to the NumberFormatter notation() setter. + * @draft ICU 60 + */ + static CompactNotation compactShort(); + + /** + * Print the number using long-form compact notation. For more information on compact notation, see + * {@link #compactShort}. + * + *

    + * In long form, the powers of ten are spelled out fully. Example outputs in en-US when printing 8.765E7 + * through 8.765E0: + * + *

    +     * 88 million
    +     * 8.8 million
    +     * 876 thousand
    +     * 88 thousand
    +     * 8.8 thousand
    +     * 876
    +     * 88
    +     * 8.8
    +     * 
    + * + * @return A CompactNotation for passing to the NumberFormatter notation() setter. + * @draft ICU 60 + */ + static CompactNotation compactLong(); + + /** + * Print the number using simple notation without any scaling by powers of ten. This is the default behavior. + * + *

    + * Since this is the default behavior, this method needs to be called only when it is necessary to override a + * previous setting. + * + *

    + * Example outputs in en-US when printing 8.765E7 through 8.765E0: + * + *

    +     * 87,650,000
    +     * 8,765,000
    +     * 876,500
    +     * 87,650
    +     * 8,765
    +     * 876.5
    +     * 87.65
    +     * 8.765
    +     * 
    + * + * @return A SimpleNotation for passing to the NumberFormatter notation() setter. + * @draft ICU 60 + */ + static SimpleNotation simple(); + + private: + enum NotationType { + NTN_SCIENTIFIC, NTN_COMPACT, NTN_SIMPLE, NTN_ERROR + } fType; + + union NotationUnion { + // For NTN_SCIENTIFIC + struct ScientificSettings { + int8_t fEngineeringInterval; + bool fRequireMinInt; + int8_t fMinExponentDigits; + UNumberSignDisplay fExponentSignDisplay; + } scientific; + + // For NTN_COMPACT + UNumberCompactStyle compactStyle; + + // For NTN_ERROR + UErrorCode errorCode; + } fUnion; + + typedef NotationUnion::ScientificSettings ScientificSettings; + + Notation(const NotationType &type, const NotationUnion &union_) : fType(type), fUnion(union_) {} + + Notation(UErrorCode errorCode) : fType(NTN_ERROR) { + fUnion.errorCode = errorCode; + } + + Notation() : fType(NTN_SIMPLE), fUnion() {} + + UBool copyErrorTo(UErrorCode &status) const { + if (fType == NTN_ERROR) { + status = fUnion.errorCode; + return TRUE; + } + return FALSE; + } + + // To allow MacroProps to initialize empty instances: + friend struct impl::MacroProps; + friend class ScientificNotation; + + // To allow implementation to access internal types: + friend class impl::NumberFormatterImpl; + friend class impl::ScientificModifier; + friend class impl::ScientificHandler; +}; + +/** + * A class that defines the scientific notation style to be used when formatting numbers in NumberFormatter. + * + *

    + * To create a ScientificNotation, use one of the factory methods in {@link Notation}. + * + * @draft ICU 60 + */ +class U_I18N_API ScientificNotation : public Notation { + public: + /** + * Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros if + * necessary. Useful for fixed-width display. + * + *

    + * For example, with minExponentDigits=2, the number 123 will be printed as "1.23E02" in en-US instead of + * the default "1.23E2". + * + * @param minExponentDigits + * The minimum number of digits to show in the exponent. + * @return A ScientificNotation, for chaining. + * @draft ICU 60 + */ + ScientificNotation withMinExponentDigits(int32_t minExponentDigits) const; + + /** + * Sets whether to show the sign on positive and negative exponents in scientific notation. The default is AUTO, + * showing the minus sign but not the plus sign. + * + *

    + * For example, with exponentSignDisplay=ALWAYS, the number 123 will be printed as "1.23E+2" in en-US + * instead of the default "1.23E2". + * + * @param exponentSignDisplay + * The strategy for displaying the sign in the exponent. + * @return A ScientificNotation, for chaining. + * @draft ICU 60 + */ + ScientificNotation withExponentSignDisplay(UNumberSignDisplay exponentSignDisplay) const; + + private: + // Inherit constructor + using Notation::Notation; + + friend class Notation; +}; + +// Reserve extra names in case they are added as classes in the future: +typedef Rounder DigitRounder; + +/** + * A class that defines the rounding strategy to be used when formatting numbers in NumberFormatter. + * + *

    + * To create a Rounder, use one of the factory methods. + * + * @draft ICU 60 + */ +class U_I18N_API Rounder : public UMemory { + + public: + /** + * Show all available digits to full precision. + * + *

    + * NOTE: When formatting a double, this method, along with {@link #minFraction} and + * {@link #minDigits}, will trigger complex algorithm similar to Dragon4 to determine the low-order digits + * and the number of digits to display based on the value of the double. If the number of fraction places or + * significant digits can be bounded, consider using {@link #maxFraction} or {@link #maxDigits} instead to maximize + * performance. For more information, read the following blog post. + * + *

    + * http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/ + * + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static Rounder unlimited(); + + /** + * Show numbers rounded if necessary to the nearest integer. + * + * @return A FractionRounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static FractionRounder integer(); + + /** + * Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator). + * Additionally, pad with zeros to ensure that this number of places are always shown. + * + *

    + * Example output with minMaxFractionPlaces = 3: + * + *

    + * 87,650.000
    + * 8,765.000
    + * 876.500
    + * 87.650
    + * 8.765
    + * 0.876
    + * 0.088
    + * 0.009
    + * 0.000 (zero) + * + *

    + * This method is equivalent to {@link #minMaxFraction} with both arguments equal. + * + * @param minMaxFractionPlaces + * The minimum and maximum number of numerals to display after the decimal separator (rounding if too + * long or padding with zeros if too short). + * @return A FractionRounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static FractionRounder fixedFraction(int32_t minMaxFractionPlaces); + + /** + * Always show at least a certain number of fraction places after the decimal separator, padding with zeros if + * necessary. Do not perform rounding (display numbers to their full precision). + * + *

    + * NOTE: If you are formatting doubles, see the performance note in {@link #unlimited}. + * + * @param minFractionPlaces + * The minimum number of numerals to display after the decimal separator (padding with zeros if + * necessary). + * @return A FractionRounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static FractionRounder minFraction(int32_t minFractionPlaces); + + /** + * Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator). + * Unlike the other fraction rounding strategies, this strategy does not pad zeros to the end of the + * number. + * + * @param maxFractionPlaces + * The maximum number of numerals to display after the decimal mark (rounding if necessary). + * @return A FractionRounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static FractionRounder maxFraction(int32_t maxFractionPlaces); + + /** + * Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator); + * in addition, always show at least a certain number of places after the decimal separator, padding with zeros if + * necessary. + * + * @param minFractionPlaces + * The minimum number of numerals to display after the decimal separator (padding with zeros if + * necessary). + * @param maxFractionPlaces + * The maximum number of numerals to display after the decimal separator (rounding if necessary). + * @return A FractionRounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static FractionRounder minMaxFraction(int32_t minFractionPlaces, int32_t maxFractionPlaces); + + /** + * Show numbers rounded if necessary to a certain number of significant digits or significant figures. Additionally, + * pad with zeros to ensure that this number of significant digits/figures are always shown. + * + *

    + * This method is equivalent to {@link #minMaxDigits} with both arguments equal. + * + * @param minMaxSignificantDigits + * The minimum and maximum number of significant digits to display (rounding if too long or padding with + * zeros if too short). + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static DigitRounder fixedDigits(int32_t minMaxSignificantDigits); + + /** + * Always show at least a certain number of significant digits/figures, padding with zeros if necessary. Do not + * perform rounding (display numbers to their full precision). + * + *

    + * NOTE: If you are formatting doubles, see the performance note in {@link #unlimited}. + * + * @param minSignificantDigits + * The minimum number of significant digits to display (padding with zeros if too short). + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static DigitRounder minDigits(int32_t minSignificantDigits); + + /** + * Show numbers rounded if necessary to a certain number of significant digits/figures. + * + * @param maxSignificantDigits + * The maximum number of significant digits to display (rounding if too long). + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static DigitRounder maxDigits(int32_t maxSignificantDigits); + + /** + * Show numbers rounded if necessary to a certain number of significant digits/figures; in addition, always show at + * least a certain number of significant digits, padding with zeros if necessary. + * + * @param minSignificantDigits + * The minimum number of significant digits to display (padding with zeros if necessary). + * @param maxSignificantDigits + * The maximum number of significant digits to display (rounding if necessary). + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static DigitRounder minMaxDigits(int32_t minSignificantDigits, int32_t maxSignificantDigits); + + /** + * Show numbers rounded if necessary to the closest multiple of a certain rounding increment. For example, if the + * rounding increment is 0.5, then round 1.2 to 1 and round 1.3 to 1.5. + * + *

    + * In order to ensure that numbers are padded to the appropriate number of fraction places, call + * withMinFraction() on the return value of this method. + * For example, to round to the nearest 0.5 and always display 2 numerals after the + * decimal separator (to display 1.2 as "1.00" and 1.3 as "1.50"), you can run: + * + *

    +     * Rounder::increment(0.5).withMinFraction(2)
    +     * 
    + * + * @param roundingIncrement + * The increment to which to round numbers. + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static IncrementRounder increment(double roundingIncrement); + + /** + * Show numbers rounded and padded according to the rules for the currency unit. The most common rounding settings + * for currencies include Rounder.fixedFraction(2), Rounder.integer(), and + * Rounder.increment(0.05) for cash transactions ("nickel rounding"). + * + *

    + * The exact rounding details will be resolved at runtime based on the currency unit specified in the + * NumberFormatter chain. To round according to the rules for one currency while displaying the symbol for another + * currency, the withCurrency() method can be called on the return value of this method. + * + * @param currencyUsage + * Either STANDARD (for digital transactions) or CASH (for transactions where the rounding increment may + * be limited by the available denominations of cash or coins). + * @return A CurrencyRounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + static CurrencyRounder currency(UCurrencyUsage currencyUsage); + + /** + * Sets the rounding mode to use when picking the direction to round (up or down). Common values + * include HALF_EVEN, HALF_UP, and FLOOR. The default is HALF_EVEN. + * + * @param roundingMode + * The RoundingMode to use. + * @return A Rounder for passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + Rounder withMode(UNumberFormatRoundingMode roundingMode) const; + + private: + enum RounderType { + RND_BOGUS, + RND_NONE, + RND_FRACTION, + RND_SIGNIFICANT, + RND_FRACTION_SIGNIFICANT, + RND_INCREMENT, + RND_CURRENCY, + RND_PASS_THROUGH, + RND_ERROR + } fType; + + union RounderUnion { + struct FractionSignificantSettings { + // For RND_FRACTION, RND_SIGNIFICANT, and RND_FRACTION_SIGNIFICANT + int8_t fMinFrac; + int8_t fMaxFrac; + int8_t fMinSig; + int8_t fMaxSig; + } fracSig; + struct IncrementSettings { + double fIncrement; + int32_t fMinFrac; + } increment; // For RND_INCREMENT + UCurrencyUsage currencyUsage; // For RND_CURRENCY + UErrorCode errorCode; // For RND_ERROR + } fUnion; + + typedef RounderUnion::FractionSignificantSettings FractionSignificantSettings; + typedef RounderUnion::IncrementSettings IncrementSettings; + + UNumberFormatRoundingMode fRoundingMode; + + Rounder(const RounderType &type, const RounderUnion &union_, UNumberFormatRoundingMode roundingMode) + : fType(type), fUnion(union_), fRoundingMode(roundingMode) {} + + Rounder(UErrorCode errorCode) : fType(RND_ERROR) { + fUnion.errorCode = errorCode; + } + + Rounder() : fType(RND_BOGUS) {} + + bool isBogus() const { + return fType == RND_BOGUS; + } + + UBool copyErrorTo(UErrorCode &status) const { + if (fType == RND_ERROR) { + status = fUnion.errorCode; + return TRUE; + } + return FALSE; + } + + // On the parent type so that this method can be called internally on Rounder instances. + Rounder withCurrency(const CurrencyUnit ¤cy, UErrorCode &status) const; + + /** NON-CONST: mutates the current instance. */ + void setLocaleData(const CurrencyUnit ¤cy, UErrorCode &status); + + void apply(impl::DecimalQuantity &value, UErrorCode &status) const; + + /** Version of {@link #apply} that obeys minInt constraints. Used for scientific notation compatibility mode. */ + void apply(impl::DecimalQuantity &value, int32_t minInt, UErrorCode status); + + int32_t + chooseMultiplierAndApply(impl::DecimalQuantity &input, const impl::MultiplierProducer &producer, + UErrorCode &status); + + static FractionRounder constructFraction(int32_t minFrac, int32_t maxFrac); + + static Rounder constructSignificant(int32_t minSig, int32_t maxSig); + + static Rounder + constructFractionSignificant(const FractionRounder &base, int32_t minSig, int32_t maxSig); + + static IncrementRounder constructIncrement(double increment, int32_t minFrac); + + static CurrencyRounder constructCurrency(UCurrencyUsage usage); + + static Rounder constructPassThrough(); + + // To allow MacroProps/MicroProps to initialize bogus instances: + friend struct impl::MacroProps; + friend struct impl::MicroProps; + + // To allow NumberFormatterImpl to access isBogus() and other internal methods: + friend class impl::NumberFormatterImpl; + + // To give access to apply() and chooseMultiplierAndApply(): + friend class impl::MutablePatternModifier; + friend class impl::LongNameHandler; + friend class impl::ScientificHandler; + friend class impl::CompactHandler; + + // To allow child classes to call private methods: + friend class FractionRounder; + friend class CurrencyRounder; + friend class IncrementRounder; +}; + +/** + * A class that defines a rounding strategy based on a number of fraction places and optionally significant digits to be + * used when formatting numbers in NumberFormatter. + * + *

    + * To create a FractionRounder, use one of the factory methods on Rounder. + * + * @draft ICU 60 + */ +class U_I18N_API FractionRounder : public Rounder { + public: + /** + * Ensure that no less than this number of significant digits are retained when rounding according to fraction + * rules. + * + *

    + * For example, with integer rounding, the number 3.141 becomes "3". However, with minimum figures set to 2, 3.141 + * becomes "3.1" instead. + * + *

    + * This setting does not affect the number of trailing zeros. For example, 3.01 would print as "3", not "3.0". + * + * @param minSignificantDigits + * The number of significant figures to guarantee. + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + Rounder withMinDigits(int32_t minSignificantDigits) const; + + /** + * Ensure that no more than this number of significant digits are retained when rounding according to fraction + * rules. + * + *

    + * For example, with integer rounding, the number 123.4 becomes "123". However, with maximum figures set to 2, 123.4 + * becomes "120" instead. + * + *

    + * This setting does not affect the number of trailing zeros. For example, with fixed fraction of 2, 123.4 would + * become "120.00". + * + * @param maxSignificantDigits + * Round the number to no more than this number of significant figures. + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + Rounder withMaxDigits(int32_t maxSignificantDigits) const; + + private: + // Inherit constructor + using Rounder::Rounder; + + // To allow parent class to call this class's constructor: + friend class Rounder; +}; + +/** + * A class that defines a rounding strategy parameterized by a currency to be used when formatting numbers in + * NumberFormatter. + * + *

    + * To create a CurrencyRounder, use one of the factory methods on Rounder. + * + * @draft ICU 60 + */ +class U_I18N_API CurrencyRounder : public Rounder { + public: + /** + * Associates a currency with this rounding strategy. + * + *

    + * Calling this method is not required, because the currency specified in unit() + * is automatically applied to currency rounding strategies. However, + * this method enables you to override that automatic association. + * + *

    + * This method also enables numbers to be formatted using currency rounding rules without explicitly using a + * currency format. + * + * @param currency + * The currency to associate with this rounding strategy. + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + Rounder withCurrency(const CurrencyUnit ¤cy) const; + + private: + // Inherit constructor + using Rounder::Rounder; + + // To allow parent class to call this class's constructor: + friend class Rounder; +}; + +/** + * A class that defines a rounding strategy parameterized by a rounding increment to be used when formatting numbers in + * NumberFormatter. + * + *

    + * To create an IncrementRounder, use one of the factory methods on Rounder. + * + * @draft ICU 60 + */ +class U_I18N_API IncrementRounder : public Rounder { + public: + /** + * Specifies the minimum number of fraction digits to render after the decimal separator, padding with zeros if + * necessary. By default, no trailing zeros are added. + * + *

    + * For example, if the rounding increment is 0.5 and minFrac is 2, then the resulting strings include "0.00", + * "0.50", "1.00", and "1.50". + * + *

    + * Note: In ICU4J, this functionality is accomplished via the scale of the BigDecimal rounding increment. + * + * @param minFrac The minimum number of digits after the decimal separator. + * @return A Rounder for chaining or passing to the NumberFormatter rounding() setter. + * @draft ICU 60 + */ + Rounder withMinFraction(int32_t minFrac) const; + + private: + // Inherit constructor + using Rounder::Rounder; + + // To allow parent class to call this class's constructor: + friend class Rounder; +}; + +/** + * @internal This API is a technical preview. It is likely to change in an upcoming release. + */ +class U_I18N_API Grouper : public UMemory { + public: + /** + * @internal This API is a technical preview. It is likely to change in an upcoming release. + */ + static Grouper defaults(); + + /** + * @internal This API is a technical preview. It is likely to change in an upcoming release. + */ + static Grouper minTwoDigits(); + + /** + * @internal This API is a technical preview. It is likely to change in an upcoming release. + */ + static Grouper none(); + + private: + int8_t fGrouping1; // -3 means "bogus"; -2 means "needs locale data"; -1 means "no grouping" + int8_t fGrouping2; + bool fMin2; + + Grouper(int8_t grouping1, int8_t grouping2, bool min2) + : fGrouping1(grouping1), fGrouping2(grouping2), fMin2(min2) {} + + Grouper() : fGrouping1(-3) {}; + + bool isBogus() const { + return fGrouping1 == -3; + } + + /** NON-CONST: mutates the current instance. */ + void setLocaleData(const impl::ParsedPatternInfo &patternInfo); + + bool groupAtPosition(int32_t position, const impl::DecimalQuantity &value) const; + + // To allow MacroProps/MicroProps to initialize empty instances: + friend struct impl::MacroProps; + friend struct impl::MicroProps; + + // To allow NumberFormatterImpl to access isBogus() and perform other operations: + friend class impl::NumberFormatterImpl; +}; + +/** + * A class that defines the strategy for padding and truncating integers before the decimal separator. + * + *

    + * To create an IntegerWidth, use one of the factory methods. + * + * @draft ICU 60 + * @see NumberFormatter + */ +class U_I18N_API IntegerWidth : public UMemory { + public: + /** + * Pad numbers at the beginning with zeros to guarantee a certain number of numerals before the decimal separator. + * + *

    + * For example, with minInt=3, the number 55 will get printed as "055". + * + * @param minInt + * The minimum number of places before the decimal separator. + * @return An IntegerWidth for chaining or passing to the NumberFormatter integerWidth() setter. + * @draft ICU 60 + * @see NumberFormatter + */ + static IntegerWidth zeroFillTo(int32_t minInt); + + /** + * Truncate numbers exceeding a certain number of numerals before the decimal separator. + * + * For example, with maxInt=3, the number 1234 will get printed as "234". + * + * @param maxInt + * The maximum number of places before the decimal separator. + * @return An IntegerWidth for passing to the NumberFormatter integerWidth() setter. + * @draft ICU 60 + * @see NumberFormatter + */ + IntegerWidth truncateAt(int32_t maxInt); + + private: + union { + struct { + int8_t fMinInt; + int8_t fMaxInt; + } minMaxInt; + UErrorCode errorCode; + } fUnion; + bool fHasError = false; + + IntegerWidth(int8_t minInt, int8_t maxInt); + + IntegerWidth(UErrorCode errorCode) { // NOLINT + fUnion.errorCode = errorCode; + fHasError = true; + } + + IntegerWidth() { // NOLINT + fUnion.minMaxInt.fMinInt = -1; + } + + bool isBogus() const { + return !fHasError && fUnion.minMaxInt.fMinInt == -1; + } + + UBool copyErrorTo(UErrorCode &status) const { + if (fHasError) { + status = fUnion.errorCode; + return TRUE; + } + return FALSE; + } + + void apply(impl::DecimalQuantity &quantity, UErrorCode &status) const; + + // To allow MacroProps/MicroProps to initialize empty instances: + friend struct impl::MacroProps; + friend struct impl::MicroProps; + + // To allow NumberFormatterImpl to access isBogus() and perform other operations: + friend class impl::NumberFormatterImpl; +}; + +namespace impl { + +/** + * Use a default threshold of 3. This means that the third time .format() is called, the data structures get built + * using the "safe" code path. The first two calls to .format() will trigger the unsafe code path. + * + * @internal + */ +static constexpr int32_t DEFAULT_THRESHOLD = 3; + +/** @internal */ +class U_I18N_API SymbolsWrapper : public UMemory { + public: + /** @internal */ + SymbolsWrapper() : fType(SYMPTR_NONE), fPtr{nullptr} {} + + /** @internal */ + SymbolsWrapper(const SymbolsWrapper &other); + + /** @internal */ + ~SymbolsWrapper(); + + /** @internal */ + SymbolsWrapper &operator=(const SymbolsWrapper &other); + + /** + * The provided object is copied, but we do not adopt it. + * @internal + */ + void setTo(const DecimalFormatSymbols &dfs); + + /** + * Adopt the provided object. + * @internal + */ + void setTo(const NumberingSystem *ns); + + /** + * Whether the object is currently holding a DecimalFormatSymbols. + * @internal + */ + bool isDecimalFormatSymbols() const; + + /** + * Whether the object is currently holding a NumberingSystem. + * @internal + */ + bool isNumberingSystem() const; + + /** + * Get the DecimalFormatSymbols pointer. No ownership change. + * @internal + */ + const DecimalFormatSymbols *getDecimalFormatSymbols() const; + + /** + * Get the NumberingSystem pointer. No ownership change. + * @internal + */ + const NumberingSystem *getNumberingSystem() const; + + /** @internal */ + UBool copyErrorTo(UErrorCode &status) const { + if (fType == SYMPTR_DFS && fPtr.dfs == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return TRUE; + } else if (fType == SYMPTR_NS && fPtr.ns == nullptr) { + status = U_MEMORY_ALLOCATION_ERROR; + return TRUE; + } + return FALSE; + } + + private: + enum SymbolsPointerType { + SYMPTR_NONE, SYMPTR_DFS, SYMPTR_NS + } fType; + + union { + const DecimalFormatSymbols *dfs; + const NumberingSystem *ns; + } fPtr; + + void doCopyFrom(const SymbolsWrapper &other); + + void doCleanup(); +}; + +/** @internal */ +class U_I18N_API Padder : public UMemory { + public: + /** @internal */ + static Padder none(); + + /** @internal */ + static Padder codePoints(UChar32 cp, int32_t targetWidth, UNumberFormatPadPosition position); + + private: + UChar32 fWidth; // -3 = error; -2 = bogus; -1 = no padding + union { + struct { + int32_t fCp; + UNumberFormatPadPosition fPosition; + } padding; + UErrorCode errorCode; + } fUnion; + + Padder(UChar32 cp, int32_t width, UNumberFormatPadPosition position); + + Padder(int32_t width); + + Padder(UErrorCode errorCode) : fWidth(-3) { // NOLINT + fUnion.errorCode = errorCode; + } + + Padder() : fWidth(-2) {} // NOLINT + + bool isBogus() const { + return fWidth == -2; + } + + UBool copyErrorTo(UErrorCode &status) const { + if (fWidth == -3) { + status = fUnion.errorCode; + return TRUE; + } + return FALSE; + } + + bool isValid() const { + return fWidth > 0; + } + + int32_t padAndApply(const impl::Modifier &mod1, const impl::Modifier &mod2, + impl::NumberStringBuilder &string, int32_t leftIndex, int32_t rightIndex, + UErrorCode &status) const; + + // To allow MacroProps/MicroProps to initialize empty instances: + friend struct MacroProps; + friend struct MicroProps; + + // To allow NumberFormatterImpl to access isBogus() and perform other operations: + friend class impl::NumberFormatterImpl; +}; + +/** @internal */ +struct U_I18N_API MacroProps : public UMemory { + /** @internal */ + Notation notation; + + /** @internal */ + MeasureUnit unit; // = NoUnit::base(); + + /** @internal */ + Rounder rounder; // = Rounder(); (bogus) + + /** @internal */ + Grouper grouper; // = Grouper(); (bogus) + + /** @internal */ + Padder padder; // = Padder(); (bogus) + + /** @internal */ + IntegerWidth integerWidth; // = IntegerWidth(); (bogus) + + /** @internal */ + SymbolsWrapper symbols; + + // UNUM_XYZ_COUNT denotes null (bogus) values. + + /** @internal */ + UNumberUnitWidth unitWidth = UNUM_UNIT_WIDTH_COUNT; + + /** @internal */ + UNumberSignDisplay sign = UNUM_SIGN_COUNT; + + /** @internal */ + UNumberDecimalSeparatorDisplay decimal = UNUM_DECIMAL_SEPARATOR_COUNT; + + /** @internal */ + PluralRules *rules = nullptr; // no ownership + + /** @internal */ + int32_t threshold = DEFAULT_THRESHOLD; + Locale locale; + + /** + * Check all members for errors. + * @internal + */ + bool copyErrorTo(UErrorCode &status) const { + return notation.copyErrorTo(status) || rounder.copyErrorTo(status) || + padder.copyErrorTo(status) || integerWidth.copyErrorTo(status) || + symbols.copyErrorTo(status); + } +}; + +} // namespace impl + +/** + * An abstract base class for specifying settings related to number formatting. This class is implemented by + * {@link UnlocalizedNumberFormatter} and {@link LocalizedNumberFormatter}. + */ +template +class U_I18N_API NumberFormatterSettings { + public: + /** + * Specifies the notation style (simple, scientific, or compact) for rendering numbers. + * + *

      + *
    • Simple notation: "12,300" + *
    • Scientific notation: "1.23E4" + *
    • Compact notation: "12K" + *
    + * + *

    + * All notation styles will be properly localized with locale data, and all notation styles are compatible with + * units, rounding strategies, and other number formatter settings. + * + *

    + * Pass this method the return value of a {@link Notation} factory method. For example: + * + *

    +     * NumberFormatter::with().notation(Notation::compactShort())
    +     * 
    + * + * The default is to use simple notation. + * + * @param notation + * The notation strategy to use. + * @return The fluent chain. + * @see Notation + * @draft ICU 60 + */ + Derived notation(const Notation ¬ation) const; + + /** + * Specifies the unit (unit of measure, currency, or percent) to associate with rendered numbers. + * + *
      + *
    • Unit of measure: "12.3 meters" + *
    • Currency: "$12.30" + *
    • Percent: "12.3%" + *
    + * + *

    + * All units will be properly localized with locale data, and all units are compatible with notation styles, + * rounding strategies, and other number formatter settings. + * + *

    + * Pass this method any instance of {@link MeasureUnit}. For units of measure: + * + *

    +     * NumberFormatter.with().adoptUnit(MeasureUnit::createMeter(status))
    +     * 
    + * + * Currency: + * + *
    +     * NumberFormatter.with()::unit(CurrencyUnit(u"USD", status))
    +     * 
    + * + * Percent: + * + *
    +     * NumberFormatter.with()::unit(NoUnit.percent())
    +     * 
    + * + * The default is to render without units (equivalent to NoUnit.base()). + * + * @param unit + * The unit to render. + * @return The fluent chain. + * @see MeasureUnit + * @see Currency + * @see NoUnit + * @draft ICU 60 + */ + Derived unit(const icu::MeasureUnit &unit) const; + + /** + * Like unit(), but takes ownership of a pointer. Convenient for use with the MeasureFormat factory + * methods, which return pointers that need ownership. + * + * @param unit + * The unit to render. + * @return The fluent chain. + * @see #unit + * @see MeasureUnit + * @draft ICU 60 + */ + Derived adoptUnit(const icu::MeasureUnit *unit) const; + + /** + * Specifies the rounding strategy to use when formatting numbers. + * + *
      + *
    • Round to 3 decimal places: "3.142" + *
    • Round to 3 significant figures: "3.14" + *
    • Round to the closest nickel: "3.15" + *
    • Do not perform rounding: "3.1415926..." + *
    + * + *

    + * Pass this method the return value of one of the factory methods on {@link Rounder}. For example: + * + *

    +     * NumberFormatter::with().rounding(Rounder::fixedFraction(2))
    +     * 
    + * + *

    + * In most cases, the default rounding strategy is to round to 6 fraction places; i.e., + * Rounder.maxFraction(6). The exceptions are if compact notation is being used, then the compact + * notation rounding strategy is used (see {@link Notation#compactShort} for details), or if the unit is a currency, + * then standard currency rounding is used, which varies from currency to currency (see {@link Rounder#currency} for + * details). + * + * @param rounder + * The rounding strategy to use. + * @return The fluent chain. + * @see Rounder + * @provisional This API might change or be removed in a future release. + * @draft ICU 60 + */ + Derived rounding(const Rounder &rounder) const; + +#ifndef U_HIDE_INTERNAL_API + + /** + * Specifies the grouping strategy to use when formatting numbers. + * + *

      + *
    • Default grouping: "12,300" and "1,230" + *
    • Grouping with at least 2 digits: "12,300" and "1230" + *
    • No grouping: "12300" and "1230" + *
    + * + *

    + * The exact grouping widths will be chosen based on the locale. + * + *

    + * Pass this method the return value of one of the factory methods on {@link Grouper}. For example: + * + *

    +     * NumberFormatter::with().grouping(Grouper::min2())
    +     * 
    + * + * The default is to perform grouping without concern for the minimum grouping digits. + * + * @param grouper + * The grouping strategy to use. + * @return The fluent chain. + * @see Grouper + * @see Notation + * @internal + * @internal ICU 60: This API is technical preview. + */ + Derived grouping(const Grouper &grouper) const; + +#endif /* U_HIDE_INTERNAL_API */ + + /** + * Specifies the minimum and maximum number of digits to render before the decimal mark. + * + *
      + *
    • Zero minimum integer digits: ".08" + *
    • One minimum integer digit: "0.08" + *
    • Two minimum integer digits: "00.08" + *
    + * + *

    + * Pass this method the return value of {@link IntegerWidth#zeroFillTo(int)}. For example: + * + *

    +     * NumberFormatter::with().integerWidth(IntegerWidth::zeroFillTo(2))
    +     * 
    + * + * The default is to have one minimum integer digit. + * + * @param style + * The integer width to use. + * @return The fluent chain. + * @see IntegerWidth + * @draft ICU 60 + */ + Derived integerWidth(const IntegerWidth &style) const; + + /** + * Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.) to use when rendering + * numbers. + * + *
      + *
    • en_US symbols: "12,345.67" + *
    • fr_FR symbols: "12 345,67" + *
    • de_CH symbols: "12’345.67" + *
    • my_MY symbols: "၁၂,၃၄၅.၆၇" + *
    + * + *

    + * Pass this method an instance of {@link DecimalFormatSymbols}. For example: + * + *

    +     * NumberFormatter::with().symbols(DecimalFormatSymbols(Locale("de_CH"), status))
    +     * 
    + * + *

    + * Note: DecimalFormatSymbols automatically chooses the best numbering system based on the locale. + * In the examples above, the first three are using the Latin numbering system, and the fourth is using the Myanmar + * numbering system. + * + *

    + * Note: The instance of DecimalFormatSymbols will be copied: changes made to the symbols object + * after passing it into the fluent chain will not be seen. + * + *

    + * Note: Calling this method will override the NumberingSystem previously specified in + * {@link #symbols(NumberingSystem)}. + * + *

    + * The default is to choose the symbols based on the locale specified in the fluent chain. + * + * @param symbols + * The DecimalFormatSymbols to use. + * @return The fluent chain. + * @see DecimalFormatSymbols + * @draft ICU 60 + */ + Derived symbols(const DecimalFormatSymbols &symbols) const; + + /** + * Specifies that the given numbering system should be used when fetching symbols. + * + *

      + *
    • Latin numbering system: "12,345" + *
    • Myanmar numbering system: "၁၂,၃၄၅" + *
    • Math Sans Bold numbering system: "𝟭𝟮,𝟯𝟰𝟱" + *
    + * + *

    + * Pass this method an instance of {@link NumberingSystem}. For example, to force the locale to always use the Latin + * alphabet numbering system (ASCII digits): + * + *

    +     * NumberFormatter::with().adoptSymbols(NumberingSystem::createInstanceByName("latn", status))
    +     * 
    + * + *

    + * Note: Calling this method will override the DecimalFormatSymbols previously specified in + * {@link #symbols(DecimalFormatSymbols)}. + * + *

    + * The default is to choose the best numbering system for the locale. + * + *

    + * This method takes ownership of a pointer in order to work nicely with the NumberingSystem factory methods. + * + * @param symbols + * The NumberingSystem to use. + * @return The fluent chain. + * @see NumberingSystem + * @draft ICU 60 + */ + Derived adoptSymbols(const NumberingSystem *symbols) const; + + /** + * Sets the width of the unit (measure unit or currency). Most common values: + * + *

      + *
    • Short: "$12.00", "12 m" + *
    • ISO Code: "USD 12.00" + *
    • Full name: "12.00 US dollars", "12 meters" + *
    + * + *

    + * Pass an element from the {@link UNumberUnitWidth} enum to this setter. For example: + * + *

    +     * NumberFormatter::with().unitWidth(UNumberUnitWidth::UNUM_UNIT_WIDTH_FULL_NAME)
    +     * 
    + * + *

    + * The default is the SHORT width. + * + * @param width + * The width to use when rendering numbers. + * @return The fluent chain + * @see UNumberUnitWidth + * @draft ICU 60 + */ + Derived unitWidth(const UNumberUnitWidth &width) const; + + /** + * Sets the plus/minus sign display strategy. Most common values: + * + *

      + *
    • Auto: "123", "-123" + *
    • Always: "+123", "-123" + *
    • Accounting: "$123", "($123)" + *
    + * + *

    + * Pass an element from the {@link UNumberSignDisplay} enum to this setter. For example: + * + *

    +     * NumberFormatter::with().sign(UNumberSignDisplay::UNUM_SIGN_ALWAYS)
    +     * 
    + * + *

    + * The default is AUTO sign display. + * + * @param width + * The sign display strategy to use when rendering numbers. + * @return The fluent chain + * @see UNumberSignDisplay + * @provisional This API might change or be removed in a future release. + * @draft ICU 60 + */ + Derived sign(const UNumberSignDisplay &width) const; + + /** + * Sets the decimal separator display strategy. This affects integer numbers with no fraction part. Most common + * values: + * + *

      + *
    • Auto: "1" + *
    • Always: "1." + *
    + * + *

    + * Pass an element from the {@link UNumberDecimalSeparatorDisplay} enum to this setter. For example: + * + *

    +     * NumberFormatter::with().decimal(UNumberDecimalSeparatorDisplay::UNUM_DECIMAL_SEPARATOR_ALWAYS)
    +     * 
    + * + *

    + * The default is AUTO decimal separator display. + * + * @param width + * The decimal separator display strategy to use when rendering numbers. + * @return The fluent chain + * @see UNumberDecimalSeparatorDisplay + * @provisional This API might change or be removed in a future release. + * @draft ICU 60 + */ + Derived decimal(const UNumberDecimalSeparatorDisplay &width) const; + +#ifndef U_HIDE_INTERNAL_API + + /** + * Set the padding strategy. May be added to ICU 61; see #13338. + * + * @internal ICU 60: This API is ICU internal only. + */ + Derived padding(const impl::Padder &padder) const; + + /** + * Internal fluent setter to support a custom regulation threshold. A threshold of 1 causes the data structures to + * be built right away. A threshold of 0 prevents the data structures from being built. + * + * @internal ICU 60: This API is ICU internal only. + */ + Derived threshold(int32_t threshold) const; + +#endif /* U_HIDE_INTERNAL_API */ + + /** + * Sets the UErrorCode if an error occurred in the fluent chain. + * Preserves older error codes in the outErrorCode. + * @return TRUE if U_FAILURE(outErrorCode) + * @draft ICU 60 + */ + UBool copyErrorTo(UErrorCode &outErrorCode) const { + if (U_FAILURE(outErrorCode)) { + // Do not overwrite the older error code + return TRUE; + } + fMacros.copyErrorTo(outErrorCode); + return U_FAILURE(outErrorCode); + } + + protected: + impl::MacroProps fMacros; + + private: + // Don't construct me directly! Use (Un)LocalizedNumberFormatter. + NumberFormatterSettings() = default; + + friend class LocalizedNumberFormatter; + friend class UnlocalizedNumberFormatter; +}; + +/** + * A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be specified. + * + * @see NumberFormatter + * @draft ICU 60 + */ +class U_I18N_API UnlocalizedNumberFormatter + : public NumberFormatterSettings, public UMemory { + + public: + /** + * Associate the given locale with the number formatter. The locale is used for picking the appropriate symbols, + * formats, and other data for number display. + * + *

    + * To use the Java default locale, call Locale::getDefault(): + * + *

    +     * NumberFormatter::with(). ... .locale(Locale::getDefault())
    +     * 
    + * + * @param locale + * The locale to use when loading data for number formatting. + * @return The fluent chain. + * @draft ICU 60 + */ + LocalizedNumberFormatter locale(const icu::Locale &locale) const; + + // Make default copy constructor call the NumberFormatterSettings copy constructor. + /** + * Returns a copy of this UnlocalizedNumberFormatter. + * @draft ICU 60 + */ + UnlocalizedNumberFormatter(const UnlocalizedNumberFormatter &other) : UnlocalizedNumberFormatter( + static_cast &>(other)) {} + + private: + UnlocalizedNumberFormatter() = default; + + explicit UnlocalizedNumberFormatter( + const NumberFormatterSettings &other); + + // To give the fluent setters access to this class's constructor: + friend class NumberFormatterSettings; + + // To give NumberFormatter::with() access to this class's constructor: + friend class NumberFormatter; +}; + +/** + * A NumberFormatter that has a locale associated with it; this means .format() methods are available. + * + * @see NumberFormatter + * @draft ICU 60 + */ +class U_I18N_API LocalizedNumberFormatter + : public NumberFormatterSettings, public UMemory { + public: + /** + * Format the given integer number to a string using the settings specified in the NumberFormatter fluent + * setting chain. + * + * @param value + * The number to format. + * @param status + * Set to an ErrorCode if one occurred in the setter chain or during formatting. + * @return A FormattedNumber object; call .toString() to get the string. + * @draft ICU 60 + */ + FormattedNumber formatInt(int64_t value, UErrorCode &status) const; + + /** + * Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting + * chain. + * + * @param value + * The number to format. + * @param status + * Set to an ErrorCode if one occurred in the setter chain or during formatting. + * @return A FormattedNumber object; call .toString() to get the string. + * @draft ICU 60 + */ + FormattedNumber formatDouble(double value, UErrorCode &status) const; + + /** + * Format the given decimal number to a string using the settings + * specified in the NumberFormatter fluent setting chain. + * The syntax of the unformatted number is a "numeric string" + * as defined in the Decimal Arithmetic Specification, available at + * http://speleotrove.com/decimal + * + * @param value + * The number to format. + * @param status + * Set to an ErrorCode if one occurred in the setter chain or during formatting. + * @return A FormattedNumber object; call .toString() to get the string. + * @draft ICU 60 + */ + FormattedNumber formatDecimal(StringPiece value, UErrorCode &status) const; + + // Make default copy constructor call the NumberFormatterSettings copy constructor. + /** + * Returns a copy of this LocalizedNumberFormatter. + * @draft ICU 60 + */ + LocalizedNumberFormatter(const LocalizedNumberFormatter &other) : LocalizedNumberFormatter( + static_cast &>(other)) {} + + /** + * Destruct this LocalizedNumberFormatter, cleaning up any memory it might own. + * @draft ICU 60 + */ + ~LocalizedNumberFormatter(); + + private: + const impl::NumberFormatterImpl* fCompiled {nullptr}; + char fUnsafeCallCount[8] {}; // internally cast to u_atomic_int32_t + + LocalizedNumberFormatter() = default; + + explicit LocalizedNumberFormatter(const NumberFormatterSettings &other); + + LocalizedNumberFormatter(const impl::MacroProps ¯os, const Locale &locale); + + /** + * This is the core entrypoint to the number formatting pipeline. It performs self-regulation: a static code path + * for the first few calls, and compiling a more efficient data structure if called repeatedly. + * + *

    + * This function is very hot, being called in every call to the number formatting pipeline. + * + * @param results + * The results object. This method takes ownership. + * @return The formatted number result. + */ + FormattedNumber formatImpl(impl::NumberFormatterResults *results, UErrorCode &status) const; + + // To give the fluent setters access to this class's constructor: + friend class NumberFormatterSettings; + friend class NumberFormatterSettings; + + // To give UnlocalizedNumberFormatter::locale() access to this class's constructor: + friend class UnlocalizedNumberFormatter; +}; + +/** + * The result of a number formatting operation. This class allows the result to be exported in several data types, + * including a UnicodeString and a FieldPositionIterator. + * + * @draft ICU 60 + */ +class U_I18N_API FormattedNumber : public UMemory { + public: + /** + * Returns a UnicodeString representation of the formatted number. + * + * @return a UnicodeString containing the localized number. + * @draft ICU 60 + */ + UnicodeString toString() const; + + /** + * Appends the formatted number to an Appendable. + * + * @param appendable + * The Appendable to which to append the formatted number string. + * @return The same Appendable, for chaining. + * @draft ICU 60 + * @see Appendable + */ + Appendable &appendTo(Appendable &appendable); + + /** + * Determine the start and end indices of the first occurrence of the given field in the output string. + * This allows you to determine the locations of the integer part, fraction part, and sign. + * + *

    + * If multiple different field attributes are needed, this method can be called repeatedly, or if all field + * attributes are needed, consider using populateFieldPositionIterator(). + * + *

    + * If a field occurs multiple times in an output string, such as a grouping separator, this method will only ever + * return the first occurrence. Use populateFieldPositionIterator() to access all occurrences of an attribute. + * + * @param fieldPosition + * The FieldPosition to populate with the start and end indices of the desired field. + * @param status + * Set if an error occurs while populating the FieldPosition. + * @draft ICU 60 + * @see UNumberFormatFields + */ + void populateFieldPosition(FieldPosition &fieldPosition, UErrorCode &status); + + /** + * Export the formatted number to a FieldPositionIterator. This allows you to determine which characters in + * the output string correspond to which fields, such as the integer part, fraction part, and sign. + * + *

    + * If information on only one field is needed, consider using populateFieldPosition() instead. + * + * @param iterator + * The FieldPositionIterator to populate with all of the fields present in the formatted number. + * @param status + * Set if an error occurs while populating the FieldPositionIterator. + * @draft ICU 60 + * @see UNumberFormatFields + */ + void populateFieldPositionIterator(FieldPositionIterator &iterator, UErrorCode &status); + + /** + * Destruct an instance of FormattedNumber, cleaning up any memory it might own. + * @draft ICU 60 + */ + ~FormattedNumber(); + + private: + // Can't use LocalPointer because NumberFormatterResults is forward-declared + const impl::NumberFormatterResults *fResults; + + // Error code for the terminal methods + UErrorCode fErrorCode; + + explicit FormattedNumber(impl::NumberFormatterResults *results) + : fResults(results), fErrorCode(U_ZERO_ERROR) {}; + + explicit FormattedNumber(UErrorCode errorCode) + : fResults(nullptr), fErrorCode(errorCode) {}; + + // To give LocalizedNumberFormatter format methods access to this class's constructor: + friend class LocalizedNumberFormatter; +}; + +/** + * See the main description in numberformatter.h for documentation and examples. + * + * @draft ICU 60 + */ +class U_I18N_API NumberFormatter final { + public: + /** + * Call this method at the beginning of a NumberFormatter fluent chain in which the locale is not currently known at + * the call site. + * + * @return An {@link UnlocalizedNumberFormatter}, to be used for chaining. + * @draft ICU 60 + */ + static UnlocalizedNumberFormatter with(); + + /** + * Call this method at the beginning of a NumberFormatter fluent chain in which the locale is known at the call + * site. + * + * @param locale + * The locale from which to load formats and symbols for number formatting. + * @return A {@link LocalizedNumberFormatter}, to be used for chaining. + * @draft ICU 60 + */ + static LocalizedNumberFormatter withLocale(const Locale &locale); + + /** + * Use factory methods instead of the constructor to create a NumberFormatter. + * @draft ICU 60 + */ + NumberFormatter() = delete; +}; + +} // namespace number +U_NAMESPACE_END + +#endif // U_HIDE_DRAFT_API + +#endif // __NUMBERFORMATTER_H__ + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/unicode/numfmt.h b/deps/icu-small/source/i18n/unicode/numfmt.h index 9e3d5d34ec4cca..d6b2a6d53c081d 100644 --- a/deps/icu-small/source/i18n/unicode/numfmt.h +++ b/deps/icu-small/source/i18n/unicode/numfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -58,6 +58,11 @@ class StringEnumeration; * formatting and parsing a number. Also provides methods for * determining which locales have number formats, and what their names * are. + * + *

    NOTE: Starting in ICU 60, there is a new set of APIs for localized number + * formatting that are designed to be an improvement over DecimalFormat. New users are discouraged + * from using DecimalFormat. For more information, see numberformatter.h. + * * \headerfile unicode/numfmt.h "unicode/numfmt.h" *

    * NumberFormat helps you to format and parse numbers for any locale. @@ -168,6 +173,33 @@ class StringEnumeration; */ class U_I18N_API NumberFormat : public Format { public: + /** + * Rounding mode. + * + *

    + * For more detail on rounding modes, see: + * http://userguide.icu-project.org/formatparse/numbers/rounding-modes + * + * @stable ICU 2.4 + */ + enum ERoundingMode { + kRoundCeiling, /**< Round towards positive infinity */ + kRoundFloor, /**< Round towards negative infinity */ + kRoundDown, /**< Round towards zero */ + kRoundUp, /**< Round away from zero */ + kRoundHalfEven, /**< Round towards the nearest integer, or + towards the nearest even integer if equidistant */ + kRoundHalfDown, /**< Round towards the nearest integer, or + towards zero if equidistant */ + kRoundHalfUp, /**< Round towards the nearest integer, or + away from zero if equidistant */ + /** + * Return U_FORMAT_INEXACT_ERROR if number does not format exactly. + * @stable ICU 4.8 + */ + kRoundUnnecessary + }; + /** * Alignment Field constants used to construct a FieldPosition object. * Signifies that the position of the integer part or fraction part of @@ -814,7 +846,7 @@ class U_I18N_API NumberFormat : public Format { * Returns true if grouping is used in this format. For example, * in the English locale, with grouping on, the number 1234567 * might be formatted as "1,234,567". The grouping separator as - * well as the size of each group is locale dependant and is + * well as the size of each group is locale dependent and is * determined by sub-classes of NumberFormat. * @see setGroupingUsed * @stable ICU 2.0 @@ -931,7 +963,7 @@ class U_I18N_API NumberFormat : public Format { * @param ec input-output error code * @stable ICU 3.0 */ - virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec); + virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec); /** * Gets the currency used to display currency @@ -940,7 +972,7 @@ class U_I18N_API NumberFormat : public Format { * the currency in use, or a pointer to the empty string. * @stable ICU 2.6 */ - const UChar* getCurrency() const; + const char16_t* getCurrency() const; /** * Set a particular UDisplayContext value in the formatter, such as @@ -965,6 +997,21 @@ class U_I18N_API NumberFormat : public Format { */ virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode& status) const; + /** + * Get the rounding mode. This will always return NumberFormat::ERoundingMode::kRoundUnnecessary + * if the subclass does not support rounding. + * @return A rounding mode + * @draft ICU 60 + */ + virtual ERoundingMode getRoundingMode(void) const; + + /** + * Set the rounding mode. If a subclass does not support rounding, this will do nothing. + * @param roundingMode A rounding mode + * @draft ICU 60 + */ + virtual void setRoundingMode(ERoundingMode roundingMode); + public: /** @@ -1018,7 +1065,7 @@ class U_I18N_API NumberFormat : public Format { * have a capacity of at least 4 * @internal */ - virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const; + virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const; #ifndef U_HIDE_INTERNAL_API /** @@ -1065,7 +1112,7 @@ class U_I18N_API NumberFormat : public Format { UBool fLenient; // TRUE => lenient parse is enabled // ISO currency code - UChar fCurrency[4]; + char16_t fCurrency[4]; UDisplayContext fCapitalizationContext; diff --git a/deps/icu-small/source/i18n/unicode/numsys.h b/deps/icu-small/source/i18n/unicode/numsys.h index da181551c272d0..5f527212783ccd 100644 --- a/deps/icu-small/source/i18n/unicode/numsys.h +++ b/deps/icu-small/source/i18n/unicode/numsys.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -193,7 +193,7 @@ class U_I18N_API NumberingSystem : public UObject { void setAlgorithmic(UBool algorithmic); - void setDesc(UnicodeString desc); + void setDesc(const UnicodeString &desc); void setName(const char* name); diff --git a/deps/icu-small/source/i18n/unicode/plurfmt.h b/deps/icu-small/source/i18n/unicode/plurfmt.h index b10e4179b6bab0..9a83e52550c540 100644 --- a/deps/icu-small/source/i18n/unicode/plurfmt.h +++ b/deps/icu-small/source/i18n/unicode/plurfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/plurrule.h b/deps/icu-small/source/i18n/unicode/plurrule.h index 146e6bea831f09..d372d79c845179 100644 --- a/deps/icu-small/source/i18n/unicode/plurrule.h +++ b/deps/icu-small/source/i18n/unicode/plurrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -29,6 +29,9 @@ #include "unicode/format.h" #include "unicode/upluralrules.h" +#ifndef U_HIDE_INTERNAL_API +#include "unicode/numfmt.h" +#endif /* U_HIDE_INTERNAL_API */ /** * Value returned by PluralRules::getUniqueKeywordValue() when there is no @@ -40,7 +43,7 @@ U_NAMESPACE_BEGIN class Hashtable; -class FixedDecimal; +class IFixedDecimal; class VisibleDigitsWithExponent; class RuleChain; class PluralRuleParser; @@ -345,10 +348,26 @@ class U_I18N_API PluralRules : public UObject { UnicodeString select(double number) const; #ifndef U_HIDE_INTERNAL_API + /** + * Given a number and a format, returns the keyword of the first applicable + * rule for this PluralRules object. + * Note: This internal preview interface may be removed in the future if + * an architecturally cleaner solution reaches stable status. + * @param obj The numeric object for which the rule should be determined. + * @param fmt The NumberFormat specifying how the number will be formatted + * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars"). + * @param status Input/output parameter. If at entry this indicates a + * failure status, the method returns immediately; otherwise + * this is set to indicate the outcome of the call. + * @return The keyword of the selected rule. Undefined in the case of an error. + * @internal ICU 59 technology preview, may be removed in the future + */ + UnicodeString select(const Formattable& obj, const NumberFormat& fmt, UErrorCode& status) const; + /** * @internal */ - UnicodeString select(const FixedDecimal &number) const; + UnicodeString select(const IFixedDecimal &number) const; /** * @internal */ @@ -383,7 +402,7 @@ class U_I18N_API PluralRules : public UObject { /** * Deprecated Function, does not produce useful results. * - * Orginally intended to return all the values for which select() would return the keyword. + * Originally intended to return all the values for which select() would return the keyword. * If the keyword is unknown, returns no values, but this is not an error. If * the number of values is unlimited, returns no values and -1 as the * count. diff --git a/deps/icu-small/source/i18n/unicode/rbnf.h b/deps/icu-small/source/i18n/unicode/rbnf.h index 14230f8982d2ef..d8d33420c2a015 100644 --- a/deps/icu-small/source/i18n/unicode/rbnf.h +++ b/deps/icu-small/source/i18n/unicode/rbnf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -866,6 +866,52 @@ class U_I18N_API RuleBasedNumberFormat : public NumberFormat { FieldPosition& pos, UErrorCode& status) const; +protected: + /** + * Format a decimal number. + * The number is a DigitList wrapper onto a floating point decimal number. + * The default implementation in NumberFormat converts the decimal number + * to a double and formats that. Subclasses of NumberFormat that want + * to specifically handle big decimal numbers must override this method. + * class DecimalFormat does so. + * + * @param number The number, a DigitList format Decimal Floating Point. + * @param appendTo Output parameter to receive result. + * Result is appended to existing contents. + * @param posIter On return, can be used to iterate over positions + * of fields generated by this format call. + * @param status Output param filled with success/failure status. + * @return Reference to 'appendTo' parameter. + * @internal + */ + virtual UnicodeString& format(const DigitList &number, + UnicodeString& appendTo, + FieldPositionIterator* posIter, + UErrorCode& status) const; + + /** + * Format a decimal number. + * The number is a DigitList wrapper onto a floating point decimal number. + * The default implementation in NumberFormat converts the decimal number + * to a double and formats that. Subclasses of NumberFormat that want + * to specifically handle big decimal numbers must override this method. + * class DecimalFormat does so. + * + * @param number The number, a DigitList format Decimal Floating Point. + * @param appendTo Output parameter to receive result. + * Result is appended to existing contents. + * @param pos On input: an alignment field, if desired. + * On output: the offsets of the alignment field. + * @param status Output param filled with success/failure status. + * @return Reference to 'appendTo' parameter. + * @internal + */ + virtual UnicodeString& format(const DigitList &number, + UnicodeString& appendTo, + FieldPosition& pos, + UErrorCode& status) const; +public: + using NumberFormat::parse; /** @@ -964,6 +1010,20 @@ class U_I18N_API RuleBasedNumberFormat : public NumberFormat { */ virtual void setContext(UDisplayContext value, UErrorCode& status); + /** + * Get the rounding mode. + * @return A rounding mode + * @draft ICU 60 + */ + virtual ERoundingMode getRoundingMode(void) const; + + /** + * Set the rounding mode. + * @param roundingMode A rounding mode + * @draft ICU 60 + */ + virtual void setRoundingMode(ERoundingMode roundingMode); + public: /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -1013,7 +1073,6 @@ class U_I18N_API RuleBasedNumberFormat : public NumberFormat { void dispose(); void stripWhitespace(UnicodeString& src); void initDefaultRuleSet(); - void format(double number, NFRuleSet& ruleSet); NFRuleSet* findRuleSet(const UnicodeString& name, UErrorCode& status) const; /* friend access */ @@ -1031,7 +1090,9 @@ class U_I18N_API RuleBasedNumberFormat : public NumberFormat { NFRule * initializeDefaultNaNRule(UErrorCode &status); const NFRule * getDefaultNaNRule() const; PluralFormat *createPluralFormat(UPluralType pluralType, const UnicodeString &pattern, UErrorCode& status) const; - UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult) const; + UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult, UErrorCode& status) const; + UnicodeString& format(int64_t number, NFRuleSet *ruleSet, UnicodeString& toAppendTo, UErrorCode& status) const; + void format(double number, NFRuleSet& rs, UnicodeString& toAppendTo, UErrorCode& status) const; private: NFRuleSet **ruleSets; @@ -1043,6 +1104,7 @@ class U_I18N_API RuleBasedNumberFormat : public NumberFormat { DecimalFormatSymbols* decimalFormatSymbols; NFRule *defaultInfinityRule; NFRule *defaultNaNRule; + ERoundingMode roundingMode; UBool lenient; UnicodeString* lenientParseRules; LocalizationInfo* localizations; diff --git a/deps/icu-small/source/i18n/unicode/rbtz.h b/deps/icu-small/source/i18n/unicode/rbtz.h index 20de34bb1743dc..542a7c140cda2b 100644 --- a/deps/icu-small/source/i18n/unicode/rbtz.h +++ b/deps/icu-small/source/i18n/unicode/rbtz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/regex.h b/deps/icu-small/source/i18n/unicode/regex.h index 96c64874a4cf43..7a68039fe80ab1 100644 --- a/deps/icu-small/source/i18n/unicode/regex.h +++ b/deps/icu-small/source/i18n/unicode/regex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: regex.h -* encoding: US-ASCII +* encoding: UTF-8 * indentation:4 * * created on: 2002oct22 @@ -350,17 +350,17 @@ class U_I18N_API RegexPattern U_FINAL : public UObject { private: /** * Cause a compilation error if an application accidentally attempts to - * create a matcher with a (UChar *) string as input rather than + * create a matcher with a (char16_t *) string as input rather than * a UnicodeString. Avoids a dangling reference to a temporary string. *

    - * To efficiently work with UChar *strings, wrap the data in a UnicodeString + * To efficiently work with char16_t *strings, wrap the data in a UnicodeString * using one of the aliasing constructors, such as - * UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength); + * UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength); * or in a UText, using - * utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status); + * utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status); * */ - RegexMatcher *matcher(const UChar *input, + RegexMatcher *matcher(const char16_t *input, UErrorCode &status) const; public: @@ -748,17 +748,17 @@ class U_I18N_API RegexMatcher U_FINAL : public UObject { private: /** * Cause a compilation error if an application accidentally attempts to - * create a matcher with a (UChar *) string as input rather than + * create a matcher with a (char16_t *) string as input rather than * a UnicodeString. Avoids a dangling reference to a temporary string. *

    - * To efficiently work with UChar *strings, wrap the data in a UnicodeString + * To efficiently work with char16_t *strings, wrap the data in a UnicodeString * using one of the aliasing constructors, such as - * UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength); + * UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength); * or in a UText, using - * utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status); + * utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status); * */ - RegexMatcher(const UnicodeString ®exp, const UChar *input, + RegexMatcher(const UnicodeString ®exp, const char16_t *input, uint32_t flags, UErrorCode &status); public: @@ -1156,17 +1156,17 @@ class U_I18N_API RegexMatcher U_FINAL : public UObject { private: /** * Cause a compilation error if an application accidentally attempts to - * reset a matcher with a (UChar *) string as input rather than + * reset a matcher with a (char16_t *) string as input rather than * a UnicodeString. Avoids a dangling reference to a temporary string. *

    - * To efficiently work with UChar *strings, wrap the data in a UnicodeString + * To efficiently work with char16_t *strings, wrap the data in a UnicodeString * using one of the aliasing constructors, such as - * UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength); + * UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength); * or in a UText, using - * utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status); + * utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status); * */ - RegexMatcher &reset(const UChar *input); + RegexMatcher &reset(const char16_t *input); public: /** diff --git a/deps/icu-small/source/i18n/unicode/region.h b/deps/icu-small/source/i18n/unicode/region.h index 47829944a3bfaf..667c4051f0eb74 100644 --- a/deps/icu-small/source/i18n/unicode/region.h +++ b/deps/icu-small/source/i18n/unicode/region.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/reldatefmt.h b/deps/icu-small/source/i18n/unicode/reldatefmt.h index 8e659e2bc83b1a..abd43522c3a965 100644 --- a/deps/icu-small/source/i18n/unicode/reldatefmt.h +++ b/deps/icu-small/source/i18n/unicode/reldatefmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** @@ -230,6 +230,7 @@ typedef enum UDateDirection { U_NAMESPACE_BEGIN +class BreakIterator; class RelativeDateTimeCacheData; class SharedNumberFormat; class SharedPluralRules; @@ -414,7 +415,6 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject { UnicodeString& appendTo, UErrorCode& status) const; -#ifndef U_HIDE_DRAFT_API /** * Format a combination of URelativeDateTimeUnit and numeric offset * using a numeric style, e.g. "1 week ago", "in 1 week", @@ -430,7 +430,7 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject { * appended. * @param status ICU error code returned here. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString& formatNumeric( double offset, @@ -453,14 +453,13 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject { * appended. * @param status ICU error code returned here. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString& format( double offset, URelativeDateTimeUnit unit, UnicodeString& appendTo, UErrorCode& status) const; -#endif /* U_HIDE_DRAFT_API */ /** * Combines a relative date string and a time string in this object's diff --git a/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h b/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h index 0b34755dc2858b..30edee7ecce289 100644 --- a/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h +++ b/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/search.h b/deps/icu-small/source/i18n/unicode/search.h index 35a05526236db7..12dd5c77278f67 100644 --- a/deps/icu-small/source/i18n/unicode/search.h +++ b/deps/icu-small/source/i18n/unicode/search.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/selfmt.h b/deps/icu-small/source/i18n/unicode/selfmt.h index 37a8f2b82192fc..08e9d444ee9715 100755 --- a/deps/icu-small/source/i18n/unicode/selfmt.h +++ b/deps/icu-small/source/i18n/unicode/selfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/i18n/unicode/simpletz.h b/deps/icu-small/source/i18n/unicode/simpletz.h index 7e41a4ab8a4849..1b23ab79d11383 100644 --- a/deps/icu-small/source/i18n/unicode/simpletz.h +++ b/deps/icu-small/source/i18n/unicode/simpletz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/smpdtfmt.h b/deps/icu-small/source/i18n/unicode/smpdtfmt.h index e6cf28d22be00d..9801b29bdb749b 100644 --- a/deps/icu-small/source/i18n/unicode/smpdtfmt.h +++ b/deps/icu-small/source/i18n/unicode/smpdtfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 1997-2016, International Business Machines Corporation and @@ -1170,7 +1170,7 @@ class U_I18N_API SimpleDateFormat: public DateFormat { * @param field The UDateFormatField to get * @stable ICU 54 */ - const NumberFormat * getNumberFormatForField(UChar field) const; + const NumberFormat * getNumberFormatForField(char16_t field) const; #ifndef U_HIDE_INTERNAL_API /** @@ -1262,7 +1262,7 @@ class U_I18N_API SimpleDateFormat: public DateFormat { * succeeds. */ void subFormat(UnicodeString &appendTo, - UChar ch, + char16_t ch, int32_t count, UDisplayContext capitalizationContext, int32_t fieldNum, @@ -1294,7 +1294,7 @@ class U_I18N_API SimpleDateFormat: public DateFormat { * Return true if the given format character, occuring count * times, represents a numeric field. */ - static UBool isNumeric(UChar formatChar, int32_t count); + static UBool isNumeric(char16_t formatChar, int32_t count); /** * Returns TRUE if the patternOffset is at the start of a numeric field. @@ -1412,7 +1412,7 @@ class U_I18N_API SimpleDateFormat: public DateFormat { * @return the new start position if matching succeeded; a negative number * indicating matching failure, otherwise. */ - int32_t subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count, + int32_t subParse(const UnicodeString& text, int32_t& start, char16_t ch, int32_t count, UBool obeyCount, UBool allowNegative, UBool ambiguousYear[], int32_t& saveHebrewMonth, Calendar& cal, int32_t patLoc, MessageFormat * numericLeapMonthFormatter, UTimeZoneFormatTimeType *tzTimeType, SimpleDateFormatMutableNFs &mutableNFs, int32_t *dayPeriod=NULL) const; @@ -1433,6 +1433,16 @@ class U_I18N_API SimpleDateFormat: public DateFormat { int32_t checkIntSuffix(const UnicodeString& text, int32_t start, int32_t patLoc, UBool isNegative) const; + /** + * Counts number of digit code points in the specified text. + * + * @param text input text + * @param start start index, inclusive + * @param end end index, exclusive + * @return number of digits found in the text in the specified range. + */ + int32_t countDigits(const UnicodeString& text, int32_t start, int32_t end) const; + /** * Translate a pattern, mapping each character in the from string to the * corresponding character in the to string. Return an error if the original @@ -1523,12 +1533,12 @@ class U_I18N_API SimpleDateFormat: public DateFormat { /** * Map calendar field letter into calendar field level. */ - static int32_t getLevelFromChar(UChar ch); + static int32_t getLevelFromChar(char16_t ch); /** * Tell if a character can be used to define a field in a format string. */ - static UBool isSyntaxChar(UChar ch); + static UBool isSyntaxChar(char16_t ch); /** * The formatting pattern for this formatter. diff --git a/deps/icu-small/source/i18n/unicode/sortkey.h b/deps/icu-small/source/i18n/unicode/sortkey.h index 6f1543da4003d9..6895be7a2b0ee4 100644 --- a/deps/icu-small/source/i18n/unicode/sortkey.h +++ b/deps/icu-small/source/i18n/unicode/sortkey.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/stsearch.h b/deps/icu-small/source/i18n/unicode/stsearch.h index 1cae53d12859de..46bc51b30e2346 100644 --- a/deps/icu-small/source/i18n/unicode/stsearch.h +++ b/deps/icu-small/source/i18n/unicode/stsearch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/tblcoll.h b/deps/icu-small/source/i18n/unicode/tblcoll.h index c48ea38c130a2f..24ba213b41eacc 100644 --- a/deps/icu-small/source/i18n/unicode/tblcoll.h +++ b/deps/icu-small/source/i18n/unicode/tblcoll.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -308,8 +308,8 @@ class U_I18N_API RuleBasedCollator : public Collator { * than target * @stable ICU 2.6 */ - virtual UCollationResult compare(const UChar* source, int32_t sourceLength, - const UChar* target, int32_t targetLength, + virtual UCollationResult compare(const char16_t* source, int32_t sourceLength, + const char16_t* target, int32_t targetLength, UErrorCode &status) const; /** @@ -377,7 +377,7 @@ class U_I18N_API RuleBasedCollator : public Collator { * @see CollationKey * @stable ICU 2.0 */ - virtual CollationKey& getCollationKey(const UChar *source, + virtual CollationKey& getCollationKey(const char16_t *source, int32_t sourceLength, CollationKey& key, UErrorCode& status) const; @@ -552,7 +552,7 @@ class U_I18N_API RuleBasedCollator : public Collator { * the top of one of the supported reordering groups, * and it must not be beyond the last of those groups. * See setMaxVariable(). - * @param varTop one or more (if contraction) UChars to which the variable top should be set + * @param varTop one or more (if contraction) char16_ts to which the variable top should be set * @param len length of variable top string. If -1 it is considered to be zero terminated. * @param status error code. If error code is set, the return value is undefined. Errors set by this function are:
    * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
    @@ -561,7 +561,7 @@ class U_I18N_API RuleBasedCollator : public Collator { * @return variable top primary weight * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status); + virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status); /** * Sets the variable top to the primary weight of the specified string. @@ -570,7 +570,7 @@ class U_I18N_API RuleBasedCollator : public Collator { * the top of one of the supported reordering groups, * and it must not be beyond the last of those groups. * See setMaxVariable(). - * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set + * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set * @param status error code. If error code is set, the return value is undefined. Errors set by this function are:
    * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
    * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond @@ -631,7 +631,7 @@ class U_I18N_API RuleBasedCollator : public Collator { int32_t resultLength) const; /** - * Get the sort key as an array of bytes from a UChar buffer. + * Get the sort key as an array of bytes from a char16_t buffer. * * Note that sort keys are often less efficient than simply doing comparison. * For more details, see the ICU User Guide. @@ -646,7 +646,7 @@ class U_I18N_API RuleBasedCollator : public Collator { * @return Number of bytes needed for storing the sort key * @stable ICU 2.2 */ - virtual int32_t getSortKey(const UChar *source, int32_t sourceLength, + virtual int32_t getSortKey(const char16_t *source, int32_t sourceLength, uint8_t *result, int32_t resultLength) const; /** @@ -821,17 +821,17 @@ class U_I18N_API RuleBasedCollator : public Collator { void adoptTailoring(CollationTailoring *t, UErrorCode &errorCode); // Both lengths must be <0 or else both must be >=0. - UCollationResult doCompare(const UChar *left, int32_t leftLength, - const UChar *right, int32_t rightLength, + UCollationResult doCompare(const char16_t *left, int32_t leftLength, + const char16_t *right, int32_t rightLength, UErrorCode &errorCode) const; UCollationResult doCompare(const uint8_t *left, int32_t leftLength, const uint8_t *right, int32_t rightLength, UErrorCode &errorCode) const; - void writeSortKey(const UChar *s, int32_t length, + void writeSortKey(const char16_t *s, int32_t length, SortKeyByteSink &sink, UErrorCode &errorCode) const; - void writeIdenticalLevel(const UChar *s, const UChar *limit, + void writeIdenticalLevel(const char16_t *s, const char16_t *limit, SortKeyByteSink &sink, UErrorCode &errorCode) const; const CollationSettings &getDefaultSettings() const; diff --git a/deps/icu-small/source/i18n/unicode/timezone.h b/deps/icu-small/source/i18n/unicode/timezone.h index 58c84d062bebad..d4cd7cb36d326a 100644 --- a/deps/icu-small/source/i18n/unicode/timezone.h +++ b/deps/icu-small/source/i18n/unicode/timezone.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /************************************************************************* * Copyright (c) 1997-2016, International Business Machines Corporation @@ -863,7 +863,7 @@ class U_I18N_API TimeZone : public UObject { * @param id zone id string * @return the pointer of the ID resource, or NULL. */ - static const UChar* findID(const UnicodeString& id); + static const char16_t* findID(const UnicodeString& id); /** * Resolve a link in Olson tzdata. When the given id is known and it's not a link, @@ -873,7 +873,7 @@ class U_I18N_API TimeZone : public UObject { * @param id zone id string * @return the dereferenced zone or NULL */ - static const UChar* dereferOlsonLink(const UnicodeString& id); + static const char16_t* dereferOlsonLink(const UnicodeString& id); /** * Returns the region code associated with the given zone, @@ -881,7 +881,7 @@ class U_I18N_API TimeZone : public UObject { * @param id zone id string * @return the region associated with the given zone */ - static const UChar* getRegion(const UnicodeString& id); + static const char16_t* getRegion(const UnicodeString& id); public: #ifndef U_HIDE_INTERNAL_API @@ -893,7 +893,7 @@ class U_I18N_API TimeZone : public UObject { * @return the region associated with the given zone * @internal */ - static const UChar* getRegion(const UnicodeString& id, UErrorCode& status); + static const char16_t* getRegion(const UnicodeString& id, UErrorCode& status); #endif /* U_HIDE_INTERNAL_API */ private: diff --git a/deps/icu-small/source/i18n/unicode/tmunit.h b/deps/icu-small/source/i18n/unicode/tmunit.h index a19a1f3c1760c3..fa59f104734baa 100644 --- a/deps/icu-small/source/i18n/unicode/tmunit.h +++ b/deps/icu-small/source/i18n/unicode/tmunit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tmutamt.h b/deps/icu-small/source/i18n/unicode/tmutamt.h index 887150121fe545..1717b7605fb3c5 100644 --- a/deps/icu-small/source/i18n/unicode/tmutamt.h +++ b/deps/icu-small/source/i18n/unicode/tmutamt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tmutfmt.h b/deps/icu-small/source/i18n/unicode/tmutfmt.h index b90d4a096d71bb..8f245859a622ba 100644 --- a/deps/icu-small/source/i18n/unicode/tmutfmt.h +++ b/deps/icu-small/source/i18n/unicode/tmutfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/translit.h b/deps/icu-small/source/i18n/unicode/translit.h index 1e49bfb9697a62..dc31d97bc63643 100644 --- a/deps/icu-small/source/i18n/unicode/translit.h +++ b/deps/icu-small/source/i18n/unicode/translit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -1319,7 +1319,7 @@ inline int32_t Transliterator::getMaximumContextLength(void) const { inline void Transliterator::setID(const UnicodeString& id) { ID = id; // NUL-terminate the ID string, which is a non-aliased copy. - ID.append((UChar)0); + ID.append((char16_t)0); ID.truncate(ID.length()-1); } diff --git a/deps/icu-small/source/i18n/unicode/tzfmt.h b/deps/icu-small/source/i18n/unicode/tzfmt.h index dd86f1b48c9619..633cd8dc6987ce 100644 --- a/deps/icu-small/source/i18n/unicode/tzfmt.h +++ b/deps/icu-small/source/i18n/unicode/tzfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -942,7 +942,7 @@ class U_I18N_API TimeZoneFormat : public Format { * @param parsedLen the parsed length, or 0 on failure. * @return the parsed offset in milliseconds. */ - int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, UChar separator, + int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, char16_t separator, int32_t& parsedLen) const; /** @@ -982,7 +982,7 @@ class U_I18N_API TimeZoneFormat : public Format { * @param maxFields The maximum fields * @return The offset string */ - static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, UChar sep, + static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, char16_t sep, OffsetFields minFields, OffsetFields maxFields, UnicodeString& result); /** @@ -1012,7 +1012,7 @@ class U_I18N_API TimeZoneFormat : public Format { * @param maxFields The maximum Fields to be parsed * @return Parsed offset, 0 or positive number. */ - static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, UChar sep, + static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, char16_t sep, OffsetFields minFields, OffsetFields maxFields); /** diff --git a/deps/icu-small/source/i18n/unicode/tznames.h b/deps/icu-small/source/i18n/unicode/tznames.h index 8861a7d026b89b..399265d85ae66c 100644 --- a/deps/icu-small/source/i18n/unicode/tznames.h +++ b/deps/icu-small/source/i18n/unicode/tznames.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -291,14 +291,12 @@ class U_I18N_API TimeZoneNames : public UObject { virtual UnicodeString& getDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UDate date, UnicodeString& name) const; /** - * @internal For specific users only until proposed publicly. - * @deprecated This API is ICU internal only. + * @internal ICU internal only, for specific users only until proposed publicly. */ virtual void loadAllDisplayNames(UErrorCode& status); /** - * @internal For specific users only until proposed publicly. - * @deprecated This API is ICU internal only. + * @internal ICU internal only, for specific users only until proposed publicly. */ virtual void getDisplayNames(const UnicodeString& tzID, const UTimeZoneNameType types[], int32_t numTypes, UDate date, UnicodeString dest[], UErrorCode& status) const; diff --git a/deps/icu-small/source/i18n/unicode/tzrule.h b/deps/icu-small/source/i18n/unicode/tzrule.h index 5e020bc1a38c56..171486f1c79d2a 100644 --- a/deps/icu-small/source/i18n/unicode/tzrule.h +++ b/deps/icu-small/source/i18n/unicode/tzrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tztrans.h b/deps/icu-small/source/i18n/unicode/tztrans.h index b2e09999bb9263..1276d67c312b9a 100644 --- a/deps/icu-small/source/i18n/unicode/tztrans.h +++ b/deps/icu-small/source/i18n/unicode/tztrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/ucal.h b/deps/icu-small/source/i18n/unicode/ucal.h index 18522f6475e15e..10d8bc52745d2b 100644 --- a/deps/icu-small/source/i18n/unicode/ucal.h +++ b/deps/icu-small/source/i18n/unicode/ucal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -425,8 +425,8 @@ enum UCalendarDateFields { */ UCAL_IS_LEAP_MONTH, - // Do not conditionalize with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of Calendar, DateFormat, and other objects + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of Calendar, DateFormat, and other objects */ /** * One more than the highest normal UCalendarDateFields value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. diff --git a/deps/icu-small/source/i18n/unicode/ucol.h b/deps/icu-small/source/i18n/unicode/ucol.h index 0b3fab90b1a05d..b5bacbfcb4734e 100644 --- a/deps/icu-small/source/i18n/unicode/ucol.h +++ b/deps/icu-small/source/i18n/unicode/ucol.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -131,7 +131,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UCOL_ATTRIBUTE_VALUE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UColAttributeValue; /** @@ -204,7 +204,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UCOL_REORDER_CODE_LIMIT = 0x1005 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UColReorderCode; /** @@ -342,8 +342,8 @@ typedef enum { */ UCOL_NUMERIC_COLLATION = UCOL_STRENGTH + 2, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of RuleBasedCollator object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of RuleBasedCollator object. */ /** * One more than the highest normal UColAttribute value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. @@ -1067,7 +1067,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UCOL_BOUND_VALUE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UColBoundMode; /** diff --git a/deps/icu-small/source/i18n/unicode/ucoleitr.h b/deps/icu-small/source/i18n/unicode/ucoleitr.h index 89fd9e85cf79a0..96c67f2018a6c3 100644 --- a/deps/icu-small/source/i18n/unicode/ucoleitr.h +++ b/deps/icu-small/source/i18n/unicode/ucoleitr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -152,7 +152,7 @@ ucol_reset(UCollationElements *elems); * A single character may contain more than one collation element. * @param elems The UCollationElements containing the text. * @param status A pointer to a UErrorCode to receive any errors. - * @return The next collation elements ordering, otherwise returns NULLORDER + * @return The next collation elements ordering, otherwise returns UCOL_NULLORDER * if an error has occured or if the end of string has been reached * @stable ICU 2.0 */ @@ -168,7 +168,7 @@ ucol_next(UCollationElements *elems, UErrorCode *status); * a U_BUFFER_OVERFLOW_ERROR is returned if the internal stack * buffer has been exhausted. * @return The previous collation elements ordering, otherwise returns - * NULLORDER if an error has occured or if the start of string has + * UCOL_NULLORDER if an error has occured or if the start of string has * been reached. * @stable ICU 2.0 */ diff --git a/deps/icu-small/source/i18n/unicode/ucsdet.h b/deps/icu-small/source/i18n/unicode/ucsdet.h index a926d2f22cbbc4..7a8564f9eabe37 100644 --- a/deps/icu-small/source/i18n/unicode/ucsdet.h +++ b/deps/icu-small/source/i18n/unicode/ucsdet.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucsdet.h - * encoding: US-ASCII + * encoding: UTF-8 * indentation:4 * * created on: 2005Aug04 @@ -45,6 +45,10 @@ * in a single language, and a minimum of a few hundred bytes worth of plain text * in the language are needed. The detection process will attempt to * ignore html or xml style markup that could otherwise obscure the content. + *

    + * An alternative to the ICU Charset Detector is the + * Compact Encoding Detector, https://github.com/google/compact_enc_det. + * It often gives more accurate results, especially with short input samples. */ @@ -395,7 +399,7 @@ ucsdet_getDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status); /** * Enable or disable individual charset encoding. * A name of charset encoding must be included in the names returned by - * {@link #getAllDetectableCharsets()}. + * {@link #ucsdet_getAllDetectableCharsets()}. * * @param ucsd a Charset detector. * @param encoding encoding the name of charset encoding. diff --git a/deps/icu-small/source/i18n/unicode/udat.h b/deps/icu-small/source/i18n/unicode/udat.h index cacfbe85009c23..90aff20df2a122 100644 --- a/deps/icu-small/source/i18n/unicode/udat.h +++ b/deps/icu-small/source/i18n/unicode/udat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -763,21 +763,19 @@ typedef enum UDateFormatField { UDAT_RELATED_YEAR_FIELD = 34, #endif /* U_HIDE_INTERNAL_API */ -#ifndef U_HIDE_DRAFT_API /** * FieldPosition selector for 'b' field alignment. * Displays midnight and noon for 12am and 12pm, respectively, if available; * otherwise fall back to AM / PM. - * @draft ICU 57 + * @stable ICU 57 */ UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, /* FieldPosition selector for 'B' field alignment. * Displays flexible day periods, such as "in the morning", if available. - * @draft ICU 57 + * @stable ICU 57 */ UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, -#endif /* U_HIDE_DRAFT_API */ #ifndef U_HIDE_INTERNAL_API /** @@ -797,7 +795,7 @@ typedef enum UDateFormatField { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UDAT_FIELD_COUNT = 38 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UDateFormatField; @@ -819,7 +817,7 @@ typedef enum UDateFormatField { * of error (e.g., the input field is UDAT_FIELD_COUNT). * @stable ICU 4.4 */ -U_STABLE UCalendarDateFields U_EXPORT2 +U_CAPI UCalendarDateFields U_EXPORT2 udat_toCalendarDateField(UDateFormatField field); @@ -851,7 +849,7 @@ udat_toCalendarDateField(UDateFormatField field); * an error occurred. * @stable ICU 2.0 */ -U_STABLE UDateFormat* U_EXPORT2 +U_CAPI UDateFormat* U_EXPORT2 udat_open(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char *locale, @@ -868,7 +866,7 @@ udat_open(UDateFormatStyle timeStyle, * @param format The formatter to close. * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_close(UDateFormat* format); @@ -902,8 +900,8 @@ typedef enum UDateFormatBooleanAttribute { */ UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of DateFormat object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DateFormat object. */ /** * One more than the highest normal UDateFormatBooleanAttribute value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. @@ -921,7 +919,7 @@ typedef enum UDateFormatBooleanAttribute { * @return The value of attr. * @stable ICU 53 */ -U_STABLE UBool U_EXPORT2 +U_CAPI UBool U_EXPORT2 udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status); /** @@ -934,7 +932,7 @@ udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute att * @param status A pointer to an UErrorCode to receive any errors * @stable ICU 53 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status); @@ -966,7 +964,7 @@ U_NAMESPACE_END * @return A pointer to a UDateFormat identical to fmt. * @stable ICU 2.0 */ -U_STABLE UDateFormat* U_EXPORT2 +U_CAPI UDateFormat* U_EXPORT2 udat_clone(const UDateFormat *fmt, UErrorCode *status); @@ -988,7 +986,7 @@ udat_clone(const UDateFormat *fmt, * @see UFieldPosition * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_format( const UDateFormat* format, UDate dateToFormat, UChar* result, @@ -1018,7 +1016,7 @@ udat_format( const UDateFormat* format, * @see UFieldPosition * @stable ICU 55 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_formatCalendar( const UDateFormat* format, UCalendar* calendar, UChar* result, @@ -1053,7 +1051,7 @@ udat_formatCalendar( const UDateFormat* format, * @see UFieldPositionIterator * @stable ICU 55 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_formatForFields( const UDateFormat* format, UDate dateToFormat, UChar* result, @@ -1091,7 +1089,7 @@ udat_formatForFields( const UDateFormat* format, * @see UFieldPositionIterator * @stable ICU 55 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_formatCalendarForFields( const UDateFormat* format, UCalendar* calendar, UChar* result, @@ -1125,7 +1123,7 @@ udat_formatCalendarForFields( const UDateFormat* format, * @see udat_format * @stable ICU 2.0 */ -U_STABLE UDate U_EXPORT2 +U_CAPI UDate U_EXPORT2 udat_parse(const UDateFormat* format, const UChar* text, int32_t textLength, @@ -1153,7 +1151,7 @@ udat_parse(const UDateFormat* format, * @see udat_format * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_parseCalendar(const UDateFormat* format, UCalendar* calendar, const UChar* text, @@ -1170,7 +1168,7 @@ udat_parseCalendar(const UDateFormat* format, * @see udat_setLenient * @stable ICU 2.0 */ -U_STABLE UBool U_EXPORT2 +U_CAPI UBool U_EXPORT2 udat_isLenient(const UDateFormat* fmt); /** @@ -1182,7 +1180,7 @@ udat_isLenient(const UDateFormat* fmt); * @see dat_isLenient * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setLenient( UDateFormat* fmt, UBool isLenient); @@ -1195,7 +1193,7 @@ udat_setLenient( UDateFormat* fmt, * @see udat_setCalendar * @stable ICU 2.0 */ -U_STABLE const UCalendar* U_EXPORT2 +U_CAPI const UCalendar* U_EXPORT2 udat_getCalendar(const UDateFormat* fmt); /** @@ -1207,7 +1205,7 @@ udat_getCalendar(const UDateFormat* fmt); * @see udat_setCalendar * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setCalendar( UDateFormat* fmt, const UCalendar* calendarToSet); @@ -1220,7 +1218,7 @@ udat_setCalendar( UDateFormat* fmt, * @see udat_setNumberFormat * @stable ICU 2.0 */ -U_STABLE const UNumberFormat* U_EXPORT2 +U_CAPI const UNumberFormat* U_EXPORT2 udat_getNumberFormat(const UDateFormat* fmt); /** @@ -1232,7 +1230,7 @@ udat_getNumberFormat(const UDateFormat* fmt); * @see udat_setNumberFormatForField * @stable ICU 54 */ -U_STABLE const UNumberFormat* U_EXPORT2 +U_CAPI const UNumberFormat* U_EXPORT2 udat_getNumberFormatForField(const UDateFormat* fmt, UChar field); /** @@ -1250,7 +1248,7 @@ udat_getNumberFormatForField(const UDateFormat* fmt, UChar field); * @see udat_getNumberFormatForField * @stable ICU 54 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_adoptNumberFormatForFields( UDateFormat* fmt, const UChar* fields, UNumberFormat* numberFormatToSet, @@ -1267,7 +1265,7 @@ udat_adoptNumberFormatForFields( UDateFormat* fmt, * @see udat_setNumberFormatForField * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setNumberFormat( UDateFormat* fmt, const UNumberFormat* numberFormatToSet); /** @@ -1279,7 +1277,7 @@ udat_setNumberFormat( UDateFormat* fmt, * @see udat_getNumberFormat * @stable ICU 54 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_adoptNumberFormat( UDateFormat* fmt, UNumberFormat* numberFormatToAdopt); /** @@ -1291,7 +1289,7 @@ udat_adoptNumberFormat( UDateFormat* fmt, * @see udat_countAvailable * @stable ICU 2.0 */ -U_STABLE const char* U_EXPORT2 +U_CAPI const char* U_EXPORT2 udat_getAvailable(int32_t localeIndex); /** @@ -1302,7 +1300,7 @@ udat_getAvailable(int32_t localeIndex); * @see udat_getAvailable * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_countAvailable(void); /** @@ -1315,7 +1313,7 @@ udat_countAvailable(void); * @see udat_Set2DigitYearStart * @stable ICU 2.0 */ -U_STABLE UDate U_EXPORT2 +U_CAPI UDate U_EXPORT2 udat_get2DigitYearStart( const UDateFormat *fmt, UErrorCode *status); @@ -1329,7 +1327,7 @@ udat_get2DigitYearStart( const UDateFormat *fmt, * @see udat_Set2DigitYearStart * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_set2DigitYearStart( UDateFormat *fmt, UDate d, UErrorCode *status); @@ -1346,7 +1344,7 @@ udat_set2DigitYearStart( UDateFormat *fmt, * @see udat_applyPattern * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_toPattern( const UDateFormat *fmt, UBool localized, UChar *result, @@ -1363,7 +1361,7 @@ udat_toPattern( const UDateFormat *fmt, * @see udat_toPattern * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_applyPattern( UDateFormat *format, UBool localized, const UChar *pattern, @@ -1489,7 +1487,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols; * @see udat_setSymbols * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_getSymbols(const UDateFormat *fmt, UDateFormatSymbolType type, int32_t symbolIndex, @@ -1509,7 +1507,7 @@ udat_getSymbols(const UDateFormat *fmt, * @see udat_setSymbols * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_countSymbols( const UDateFormat *fmt, UDateFormatSymbolType type); @@ -1528,7 +1526,7 @@ udat_countSymbols( const UDateFormat *fmt, * @see udat_countSymbols * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setSymbols( UDateFormat *format, UDateFormatSymbolType type, int32_t symbolIndex, @@ -1545,7 +1543,7 @@ udat_setSymbols( UDateFormat *format, * @return the locale name * @stable ICU 2.8 */ -U_STABLE const char* U_EXPORT2 +U_CAPI const char* U_EXPORT2 udat_getLocaleByType(const UDateFormat *fmt, ULocDataLocaleType type, UErrorCode* status); @@ -1558,7 +1556,7 @@ udat_getLocaleByType(const UDateFormat *fmt, * @param status A pointer to an UErrorCode to receive any errors * @stable ICU 51 */ -U_DRAFT void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status); /** @@ -1570,7 +1568,7 @@ udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status); * @return The UDisplayContextValue for the specified type. * @stable ICU 53 */ -U_STABLE UDisplayContext U_EXPORT2 +U_CAPI UDisplayContext U_EXPORT2 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status); #ifndef U_HIDE_INTERNAL_API diff --git a/deps/icu-small/source/i18n/unicode/udateintervalformat.h b/deps/icu-small/source/i18n/unicode/udateintervalformat.h index 81bff16d6e67af..70cbadeb575597 100644 --- a/deps/icu-small/source/i18n/unicode/udateintervalformat.h +++ b/deps/icu-small/source/i18n/unicode/udateintervalformat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/udatpg.h b/deps/icu-small/source/i18n/unicode/udatpg.h index 365d51c493c5fe..9e3bdd411490b6 100644 --- a/deps/icu-small/source/i18n/unicode/udatpg.h +++ b/deps/icu-small/source/i18n/unicode/udatpg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: udatpg.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -86,8 +86,8 @@ typedef enum UDateTimePatternField { /** @stable ICU 3.8 */ UDATPG_ZONE_FIELD, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of DateTimePatternGenerator object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DateTimePatternGenerator object. */ /** * One more than the highest normal UDateTimePatternField value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. diff --git a/deps/icu-small/source/i18n/unicode/ufieldpositer.h b/deps/icu-small/source/i18n/unicode/ufieldpositer.h index 8dfa3df5a409d0..3ae73b6d843974 100644 --- a/deps/icu-small/source/i18n/unicode/ufieldpositer.h +++ b/deps/icu-small/source/i18n/unicode/ufieldpositer.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/uformattable.h b/deps/icu-small/source/i18n/unicode/uformattable.h index e4683d56c35898..9ba2a36901aa83 100644 --- a/deps/icu-small/source/i18n/unicode/uformattable.h +++ b/deps/icu-small/source/i18n/unicode/uformattable.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -57,7 +57,7 @@ typedef enum UFormattableType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UFMT_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UFormattableType; diff --git a/deps/icu-small/source/i18n/unicode/ugender.h b/deps/icu-small/source/i18n/unicode/ugender.h index c1e591ed28fb0e..d015a2300cf6d6 100644 --- a/deps/icu-small/source/i18n/unicode/ugender.h +++ b/deps/icu-small/source/i18n/unicode/ugender.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/ulocdata.h b/deps/icu-small/source/i18n/unicode/ulocdata.h index ecf6fdcb3f532e..de8d8539c6749a 100644 --- a/deps/icu-small/source/i18n/unicode/ulocdata.h +++ b/deps/icu-small/source/i18n/unicode/ulocdata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * * ****************************************************************************** * file name: ulocdata.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -55,7 +55,7 @@ typedef enum ULocaleDataExemplarSetType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ ULOCDATA_ES_COUNT=4 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } ULocaleDataExemplarSetType; /** The possible types of delimiters. @@ -76,7 +76,7 @@ typedef enum ULocaleDataDelimiterType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ ULOCDATA_DELIMITER_COUNT = 4 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } ULocaleDataDelimiterType; /** @@ -207,7 +207,7 @@ typedef enum UMeasurementSystem { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UMS_LIMIT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UMeasurementSystem; /** diff --git a/deps/icu-small/source/i18n/unicode/umsg.h b/deps/icu-small/source/i18n/unicode/umsg.h index 0beb39d5abbee0..68188206129148 100644 --- a/deps/icu-small/source/i18n/unicode/umsg.h +++ b/deps/icu-small/source/i18n/unicode/umsg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: @@ -8,7 +8,7 @@ ******************************************************************** * * file name: umsg.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/unicode/unirepl.h b/deps/icu-small/source/i18n/unicode/unirepl.h index 37815a9a24cfa4..8fb25d46890d9e 100644 --- a/deps/icu-small/source/i18n/unicode/unirepl.h +++ b/deps/icu-small/source/i18n/unicode/unirepl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/unum.h b/deps/icu-small/source/i18n/unicode/unum.h index 7c652e09cf701b..9154bce661ae03 100644 --- a/deps/icu-small/source/i18n/unicode/unum.h +++ b/deps/icu-small/source/i18n/unicode/unum.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -25,6 +25,7 @@ #include "unicode/parseerr.h" #include "unicode/uformattable.h" #include "unicode/udisplaycontext.h" +#include "unicode/ufieldpositer.h" /** * \file @@ -114,7 +115,7 @@ *

    * You can also control the display of numbers with such function as * unum_getAttributes() and unum_setAttributes(), which let you set the - * miminum fraction digits, grouping, etc. + * minimum fraction digits, grouping, etc. * @see UNumberFormatAttributes for more details *

    * You can also use forms of the parse and format methods with @@ -125,7 +126,7 @@ * *

    * It is also possible to change or set the symbols used for a particular - * locale like the currency symbol, the grouping seperator , monetary seperator + * locale like the currency symbol, the grouping separator , monetary separator * etc by making use of functions unum_setSymbols() and unum_getSymbols(). */ @@ -249,7 +250,7 @@ typedef enum UNumberFormatStyle { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FORMAT_STYLE_COUNT=17, -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ /** * Default format @@ -264,7 +265,12 @@ typedef enum UNumberFormatStyle { } UNumberFormatStyle; /** The possible number format rounding modes. - * @stable ICU 2.0 + * + *

    + * For more detail on rounding modes, see: + * http://userguide.icu-project.org/formatparse/numbers/rounding-modes + * + * @stable ICU 2.0 */ typedef enum UNumberFormatRoundingMode { UNUM_ROUND_CEILING, @@ -326,8 +332,8 @@ enum UCurrencySpacing { /** @stable ICU 4.8 */ UNUM_CURRENCY_INSERT, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of DecimalFormatSymbols object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DecimalFormatSymbols object. */ /** * One more than the highest normal UCurrencySpacing value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. @@ -371,7 +377,7 @@ typedef enum UNumberFormatFields { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FIELD_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UNumberFormatFields; @@ -553,6 +559,59 @@ unum_formatDouble( const UNumberFormat* fmt, UFieldPosition *pos, /* 0 if ignore */ UErrorCode* status); +#ifndef U_HIDE_DRAFT_API +/** +* Format a double using a UNumberFormat according to the UNumberFormat's locale, +* and initialize a UFieldPositionIterator that enumerates the subcomponents of +* the resulting string. +* +* @param format +* The formatter to use. +* @param number +* The number to format. +* @param result +* A pointer to a buffer to receive the NULL-terminated formatted +* number. If the formatted number fits into dest but cannot be +* NULL-terminated (length == resultLength) then the error code is set +* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't +* fit into result then the error code is set to +* U_BUFFER_OVERFLOW_ERROR. +* @param resultLength +* The maximum size of result. +* @param fpositer +* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open} +* (may be NULL if field position information is not needed, but in this +* case it's preferable to use {@link #unum_formatDouble}). Iteration +* information already present in the UFieldPositionIterator is deleted, +* and the iterator is reset to apply to the fields in the formatted +* string created by this function call. The field values and indexes +* returned by {@link #ufieldpositer_next} represent fields denoted by +* the UNumberFormatFields enum. Fields are not returned in a guaranteed +* order. Fields cannot overlap, but they may nest. For example, 1234 +* could format as "1,234" which might consist of a grouping separator +* field for ',' and an integer field encompassing the entire string. +* @param status +* A pointer to an UErrorCode to receive any errors +* @return +* The total buffer size needed; if greater than resultLength, the +* output was truncated. +* @see unum_formatDouble +* @see unum_parse +* @see unum_parseDouble +* @see UFieldPositionIterator +* @see UNumberFormatFields +* @draft ICU 59 +*/ +U_DRAFT int32_t U_EXPORT2 +unum_formatDoubleForFields(const UNumberFormat* format, + double number, + UChar* result, + int32_t resultLength, + UFieldPositionIterator* fpositer, + UErrorCode* status); + +#endif /* U_HIDE_DRAFT_API */ + /** * Format a decimal number using a UNumberFormat. * The number will be formatted according to the UNumberFormat's locale. @@ -829,7 +888,7 @@ unum_parseToUFormattable(const UNumberFormat* fmt, * @param localized TRUE if the pattern is localized, FALSE otherwise. * @param pattern The new pattern * @param patternLength The length of pattern, or -1 if null-terminated. - * @param parseError A pointer to UParseError to recieve information + * @param parseError A pointer to UParseError to receive information * about errors occurred during parsing, or NULL if no parse error * information is desired. * @param status A pointer to an input-output UErrorCode. @@ -1291,7 +1350,7 @@ typedef enum UNumberFormatSymbol { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FORMAT_SYMBOL_COUNT = 28 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UNumberFormatSymbol; /** diff --git a/deps/icu-small/source/i18n/unicode/unumsys.h b/deps/icu-small/source/i18n/unicode/unumsys.h index 396d55d6b7699b..2c794c23d3c8a7 100644 --- a/deps/icu-small/source/i18n/unicode/unumsys.h +++ b/deps/icu-small/source/i18n/unicode/unumsys.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/upluralrules.h b/deps/icu-small/source/i18n/unicode/upluralrules.h index 52e34d8d25dd66..99d93a4e0517ab 100644 --- a/deps/icu-small/source/i18n/unicode/upluralrules.h +++ b/deps/icu-small/source/i18n/unicode/upluralrules.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -15,6 +15,10 @@ #if !UCONFIG_NO_FORMATTING #include "unicode/localpointer.h" +#include "unicode/uenum.h" +#ifndef U_HIDE_INTERNAL_API +#include "unicode/unum.h" +#endif /* U_HIDE_INTERNAL_API */ /** * \file @@ -60,7 +64,7 @@ enum UPluralType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UPLURAL_TYPE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ }; /** * @stable ICU 50 @@ -83,7 +87,7 @@ typedef struct UPluralRules UPluralRules; /**< C typedef for struct UPluralRule * @return A UPluralRules for the specified locale, or NULL if an error occurred. * @stable ICU 4.8 */ -U_STABLE UPluralRules* U_EXPORT2 +U_CAPI UPluralRules* U_EXPORT2 uplrules_open(const char *locale, UErrorCode *status); /** @@ -95,7 +99,7 @@ uplrules_open(const char *locale, UErrorCode *status); * @return A UPluralRules for the specified locale, or NULL if an error occurred. * @stable ICU 50 */ -U_DRAFT UPluralRules* U_EXPORT2 +U_CAPI UPluralRules* U_EXPORT2 uplrules_openForType(const char *locale, UPluralType type, UErrorCode *status); /** @@ -103,7 +107,7 @@ uplrules_openForType(const char *locale, UPluralType type, UErrorCode *status); * @param uplrules The UPluralRules object to close. * @stable ICU 4.8 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 uplrules_close(UPluralRules *uplrules); @@ -138,12 +142,55 @@ U_NAMESPACE_END * @return The length of keyword. * @stable ICU 4.8 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 uplrules_select(const UPluralRules *uplrules, double number, UChar *keyword, int32_t capacity, UErrorCode *status); +#ifndef U_HIDE_INTERNAL_API +/** + * Given a number, returns the keyword of the first rule that applies to the + * number, according to the UPluralRules object and given the number format + * specified by the UNumberFormat object. + * Note: This internal preview interface may be removed in the future if + * an architecturally cleaner solution reaches stable status. + * @param uplrules The UPluralRules object specifying the rules. + * @param number The number for which the rule has to be determined. + * @param fmt The UNumberFormat specifying how the number will be formatted + * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars"). + * If this is NULL, the function behaves like uplrules_select. + * @param keyword The keyword of the rule that applies to number. + * @param capacity The capacity of the keyword buffer. + * @param status A pointer to a UErrorCode to receive any errors. + * @return The length of keyword. + * @internal ICU 59 technology preview, may be removed in the future + */ +U_INTERNAL int32_t U_EXPORT2 +uplrules_selectWithFormat(const UPluralRules *uplrules, + double number, + const UNumberFormat *fmt, + UChar *keyword, int32_t capacity, + UErrorCode *status); + +#endif /* U_HIDE_INTERNAL_API */ + +#ifndef U_HIDE_DRAFT_API +/** + * Creates a string enumeration of all plural rule keywords used in this + * UPluralRules object. The rule "other" is always present by default. + * @param uplrules The UPluralRules object specifying the rules for + * a given locale. + * @param status A pointer to a UErrorCode to receive any errors. + * @return a string enumeration over plural rule keywords, or NULL + * upon error. The caller is responsible for closing the result. + * @draft ICU 59 + */ +U_DRAFT UEnumeration* U_EXPORT2 +uplrules_getKeywords(const UPluralRules *uplrules, + UErrorCode *status); +#endif /* U_HIDE_DRAFT_API */ + #endif /* #if !UCONFIG_NO_FORMATTING */ #endif diff --git a/deps/icu-small/source/i18n/unicode/uregex.h b/deps/icu-small/source/i18n/unicode/uregex.h index 7806a74afcc745..69c0eead956fc9 100644 --- a/deps/icu-small/source/i18n/unicode/uregex.h +++ b/deps/icu-small/source/i18n/unicode/uregex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: uregex.h -* encoding: US-ASCII +* encoding: UTF-8 * indentation:4 * * created on: 2004mar09 diff --git a/deps/icu-small/source/i18n/unicode/uregion.h b/deps/icu-small/source/i18n/unicode/uregion.h index b5d03691cabfe9..9d0c1e99de3864 100644 --- a/deps/icu-small/source/i18n/unicode/uregion.h +++ b/deps/icu-small/source/i18n/unicode/uregion.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -113,7 +113,7 @@ typedef enum URegionType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ URGN_LIMIT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } URegionType; #if !UCONFIG_NO_FORMATTING diff --git a/deps/icu-small/source/i18n/unicode/ureldatefmt.h b/deps/icu-small/source/i18n/unicode/ureldatefmt.h index fad8ffd9e184b8..0eff80a16b2086 100644 --- a/deps/icu-small/source/i18n/unicode/ureldatefmt.h +++ b/deps/icu-small/source/i18n/unicode/ureldatefmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -34,7 +34,7 @@ * for determining which unit to use, such as deciding between "in 7 days" * and "in 1 week". * - * @draft ICU 57 + * @stable ICU 57 */ /** @@ -66,104 +66,103 @@ typedef enum UDateRelativeDateTimeFormatterStyle { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UDAT_STYLE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UDateRelativeDateTimeFormatterStyle; -#ifndef U_HIDE_DRAFT_API /** * Represents the unit for formatting a relative date. e.g "in 5 days" * or "next year" - * @draft ICU 57 + * @stable ICU 57 */ typedef enum URelativeDateTimeUnit { /** * Specifies that relative unit is year, e.g. "last year", * "in 5 years". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_YEAR, /** * Specifies that relative unit is quarter, e.g. "last quarter", * "in 5 quarters". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_QUARTER, /** * Specifies that relative unit is month, e.g. "last month", * "in 5 months". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_MONTH, /** * Specifies that relative unit is week, e.g. "last week", * "in 5 weeks". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_WEEK, /** * Specifies that relative unit is day, e.g. "yesterday", * "in 5 days". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_DAY, /** * Specifies that relative unit is hour, e.g. "1 hour ago", * "in 5 hours". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_HOUR, /** * Specifies that relative unit is minute, e.g. "1 minute ago", * "in 5 minutes". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_MINUTE, /** * Specifies that relative unit is second, e.g. "1 second ago", * "in 5 seconds". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_SECOND, /** * Specifies that relative unit is Sunday, e.g. "last Sunday", * "this Sunday", "next Sunday", "in 5 Sundays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_SUNDAY, /** * Specifies that relative unit is Monday, e.g. "last Monday", * "this Monday", "next Monday", "in 5 Mondays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_MONDAY, /** * Specifies that relative unit is Tuesday, e.g. "last Tuesday", * "this Tuesday", "next Tuesday", "in 5 Tuesdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_TUESDAY, /** * Specifies that relative unit is Wednesday, e.g. "last Wednesday", * "this Wednesday", "next Wednesday", "in 5 Wednesdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_WEDNESDAY, /** * Specifies that relative unit is Thursday, e.g. "last Thursday", * "this Thursday", "next Thursday", "in 5 Thursdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_THURSDAY, /** * Specifies that relative unit is Friday, e.g. "last Friday", * "this Friday", "next Friday", "in 5 Fridays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_FRIDAY, /** * Specifies that relative unit is Saturday, e.g. "last Saturday", * "this Saturday", "next Saturday", "in 5 Saturdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_SATURDAY, #ifndef U_HIDE_DEPRECATED_API @@ -172,18 +171,15 @@ typedef enum URelativeDateTimeUnit { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UDAT_REL_UNIT_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } URelativeDateTimeUnit; -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API /** * Opaque URelativeDateTimeFormatter object for use in C programs. - * @draft ICU 57 + * @stable ICU 57 */ struct URelativeDateTimeFormatter; -typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @draft ICU 57 */ +typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @stable ICU 57 */ /** @@ -216,9 +212,9 @@ typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C ty * @return * A pointer to a URelativeDateTimeFormatter object for the specified locale, * or NULL if an error occurred. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT URelativeDateTimeFormatter* U_EXPORT2 +U_STABLE URelativeDateTimeFormatter* U_EXPORT2 ureldatefmt_open( const char* locale, UNumberFormat* nfToAdopt, UDateRelativeDateTimeFormatterStyle width, @@ -229,9 +225,9 @@ ureldatefmt_open( const char* locale, * Close a URelativeDateTimeFormatter object. Once closed it may no longer be used. * @param reldatefmt * The URelativeDateTimeFormatter object to close. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT void U_EXPORT2 +U_STABLE void U_EXPORT2 ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt); #if U_SHOW_CPLUSPLUS_API @@ -245,7 +241,7 @@ U_NAMESPACE_BEGIN * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 57 + * @stable ICU 57 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close); @@ -279,9 +275,9 @@ U_NAMESPACE_END * @return * The length of the formatted result; may be greater * than resultCapacity, in which case an error is returned. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt, double offset, URelativeDateTimeUnit unit, @@ -315,9 +311,9 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt, * @return * The length of the formatted result; may be greater * than resultCapacity, in which case an error is returned. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt, double offset, URelativeDateTimeUnit unit, @@ -352,9 +348,9 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt, * @return * The length of the formatted result; may be greater than resultCapacity, * in which case an error is returned. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt, const UChar * relativeDateString, int32_t relativeDateStringLen, @@ -364,8 +360,6 @@ ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt, int32_t resultCapacity, UErrorCode* status ); -#endif /* U_HIDE_DRAFT_API */ - #endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */ #endif diff --git a/deps/icu-small/source/i18n/unicode/usearch.h b/deps/icu-small/source/i18n/unicode/usearch.h index dcdb7fe420b814..600f9142b45021 100644 --- a/deps/icu-small/source/i18n/unicode/usearch.h +++ b/deps/icu-small/source/i18n/unicode/usearch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -196,7 +196,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ USEARCH_ATTRIBUTE_COUNT = 3 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } USearchAttribute; /** @@ -272,7 +272,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ USEARCH_ATTRIBUTE_VALUE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } USearchAttributeValue; /* open and close ------------------------------------------------------ */ diff --git a/deps/icu-small/source/i18n/unicode/uspoof.h b/deps/icu-small/source/i18n/unicode/uspoof.h index 40b73380c57d52..9fcfcd3ede836c 100644 --- a/deps/icu-small/source/i18n/unicode/uspoof.h +++ b/deps/icu-small/source/i18n/unicode/uspoof.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -6,7 +6,7 @@ * and others. All Rights Reserved. *************************************************************************** * file name: uspoof.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -368,18 +368,17 @@ */ struct USpoofChecker; -typedef struct USpoofChecker USpoofChecker; /**< typedef for C of USpoofChecker */ - -#ifndef U_HIDE_DRAFT_API /** - * @see uspoof_openCheckResult + * @stable ICU 4.2 */ +typedef struct USpoofChecker USpoofChecker; /**< typedef for C of USpoofChecker */ + struct USpoofCheckResult; /** * @see uspoof_openCheckResult + * @stable ICU 58 */ typedef struct USpoofCheckResult USpoofCheckResult; -#endif /* U_HIDE_DRAFT_API */ /** * Enum for the kinds of checks that USpoofChecker can perform. @@ -419,7 +418,6 @@ typedef enum USpoofChecks { */ USPOOF_WHOLE_SCRIPT_CONFUSABLE = 4, -#ifndef U_HIDE_DRAFT_API /** * Enable this flag in {@link uspoof_setChecks} to turn on all types of confusables. You may set * the checks to some subset of SINGLE_SCRIPT_CONFUSABLE, MIXED_SCRIPT_CONFUSABLE, or WHOLE_SCRIPT_CONFUSABLE to @@ -427,10 +425,9 @@ typedef enum USpoofChecks { * * @see uspoof_areConfusable * @see uspoof_getSkeleton - * @draft ICU 58 + * @stable ICU 58 */ USPOOF_CONFUSABLE = USPOOF_SINGLE_SCRIPT_CONFUSABLE | USPOOF_MIXED_SCRIPT_CONFUSABLE | USPOOF_WHOLE_SCRIPT_CONFUSABLE, -#endif /* U_HIDE_DRAFT_API */ #ifndef U_HIDE_DEPRECATED_API /** @@ -1058,7 +1055,6 @@ uspoof_checkUnicodeString(const USpoofChecker *sc, #endif -#ifndef U_HIDE_DRAFT_API /** * Check the specified string for possible security issues. * The text to be checked will typically be an identifier of some sort. @@ -1085,9 +1081,9 @@ uspoof_checkUnicodeString(const USpoofChecker *sc, * @see uspoof_openCheckResult * @see uspoof_check2UTF8 * @see uspoof_check2UnicodeString - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uspoof_check2(const USpoofChecker *sc, const UChar* id, int32_t length, USpoofCheckResult* checkResult, @@ -1122,9 +1118,9 @@ uspoof_check2(const USpoofChecker *sc, * @see uspoof_openCheckResult * @see uspoof_check2 * @see uspoof_check2UnicodeString - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uspoof_check2UTF8(const USpoofChecker *sc, const char *id, int32_t length, USpoofCheckResult* checkResult, @@ -1154,9 +1150,9 @@ uspoof_check2UTF8(const USpoofChecker *sc, * @see uspoof_openCheckResult * @see uspoof_check2 * @see uspoof_check2UTF8 - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uspoof_check2UnicodeString(const USpoofChecker *sc, const icu::UnicodeString &id, USpoofCheckResult* checkResult, @@ -1179,9 +1175,9 @@ uspoof_check2UnicodeString(const USpoofChecker *sc, * @see uspoof_check2 * @see uspoof_check2UTF8 * @see uspoof_check2UnicodeString - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT USpoofCheckResult* U_EXPORT2 +U_STABLE USpoofCheckResult* U_EXPORT2 uspoof_openCheckResult(UErrorCode *status); /** @@ -1189,9 +1185,9 @@ uspoof_openCheckResult(UErrorCode *status); * its implementation. * * @param checkResult The instance of USpoofCheckResult to close - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT void U_EXPORT2 +U_STABLE void U_EXPORT2 uspoof_closeCheckResult(USpoofCheckResult *checkResult); #if U_SHOW_CPLUSPLUS_API @@ -1205,7 +1201,7 @@ U_NAMESPACE_BEGIN * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 58 + * @stable ICU 58 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalUSpoofCheckResultPointer, USpoofCheckResult, uspoof_closeCheckResult); @@ -1225,9 +1221,9 @@ U_NAMESPACE_END * will be zero if the input string passes all of the * enabled checks. * @see uspoof_setChecks - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uspoof_getCheckResultChecks(const USpoofCheckResult *checkResult, UErrorCode *status); /** @@ -1238,9 +1234,9 @@ uspoof_getCheckResultChecks(const USpoofCheckResult *checkResult, UErrorCode *st * @param status The error code, set if an error occurred. * @return The restriction level contained in the USpoofCheckResult * @see uspoof_setRestrictionLevel - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT URestrictionLevel U_EXPORT2 +U_STABLE URestrictionLevel U_EXPORT2 uspoof_getCheckResultRestrictionLevel(const USpoofCheckResult *checkResult, UErrorCode *status); /** @@ -1252,11 +1248,10 @@ uspoof_getCheckResultRestrictionLevel(const USpoofCheckResult *checkResult, UErr * @param checkResult The instance of USpoofCheckResult created by {@link uspoof_openCheckResult} * @return The set of numerics contained in the USpoofCheckResult * @param status The error code, set if an error occurred. - * @draft ICU 58 + * @stable ICU 58 */ -U_DRAFT const USet* U_EXPORT2 +U_STABLE const USet* U_EXPORT2 uspoof_getCheckResultNumerics(const USpoofCheckResult *checkResult, UErrorCode *status); -#endif /* U_HIDE_DRAFT_API */ /** diff --git a/deps/icu-small/source/i18n/unicode/utmscale.h b/deps/icu-small/source/i18n/unicode/utmscale.h index 6b4b389ac8ad24..2392c6414e4f8b 100644 --- a/deps/icu-small/source/i18n/unicode/utmscale.h +++ b/deps/icu-small/source/i18n/unicode/utmscale.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -283,10 +283,14 @@ typedef enum UDateTimeScale { */ UDTS_UNIX_MICROSECONDS_TIME, +#ifndef U_HIDE_DEPRECATED_API /** * The first unused time scale value. The limit of this enum + * @deprecated ICU 59 The numeric value may change over time, see ICU ticket #12420. */ UDTS_MAX_SCALE +#endif /* U_HIDE_DEPRECATED_API */ + } UDateTimeScale; /** @@ -423,12 +427,15 @@ typedef enum UTimeScaleValue { #endif /* U_HIDE_INTERNAL_API */ +#ifndef U_HIDE_DEPRECATED_API /** * The number of time scale values, in other words limit of this enum. * * @see utmscale_getTimeScaleValue + * @deprecated ICU 59 The numeric value may change over time, see ICU ticket #12420. */ UTSV_MAX_SCALE_VALUE=11 +#endif /* U_HIDE_DEPRECATED_API */ } UTimeScaleValue; diff --git a/deps/icu-small/source/i18n/unicode/utrans.h b/deps/icu-small/source/i18n/unicode/utrans.h index 661ee5d3850860..a4158726ca08c6 100644 --- a/deps/icu-small/source/i18n/unicode/utrans.h +++ b/deps/icu-small/source/i18n/unicode/utrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/vtzone.h b/deps/icu-small/source/i18n/unicode/vtzone.h index 1682a3d526ccfb..5d161778682313 100644 --- a/deps/icu-small/source/i18n/unicode/vtzone.h +++ b/deps/icu-small/source/i18n/unicode/vtzone.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unum.cpp b/deps/icu-small/source/i18n/unum.cpp index 0e224858db0a1d..907a1cd95e138f 100644 --- a/deps/icu-small/source/i18n/unum.cpp +++ b/deps/icu-small/source/i18n/unum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -247,6 +247,33 @@ unum_formatDouble( const UNumberFormat* fmt, return res.extract(result, resultLength, *status); } +U_CAPI int32_t U_EXPORT2 +unum_formatDoubleForFields(const UNumberFormat* format, + double number, + UChar* result, + int32_t resultLength, + UFieldPositionIterator* fpositer, + UErrorCode* status) +{ + if (U_FAILURE(*status)) + return -1; + + if (result == NULL ? resultLength != 0 : resultLength < 0) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return -1; + } + + UnicodeString res; + if (result != NULL) { + // NULL destination for pure preflighting: empty dummy string + // otherwise, alias the destination buffer + res.setTo(result, 0, resultLength); + } + + ((const NumberFormat*)format)->format(number, res, (FieldPositionIterator*)fpositer, *status); + + return res.extract(result, resultLength, *status); +} U_CAPI int32_t U_EXPORT2 unum_formatDecimal(const UNumberFormat* fmt, @@ -271,7 +298,7 @@ unum_formatDecimal(const UNumberFormat* fmt, } if (length < 0) { - length = uprv_strlen(number); + length = static_cast(uprv_strlen(number)); } StringPiece numSP(number, length); Formattable numFmtbl(numSP, *status); @@ -480,20 +507,43 @@ U_CAPI int32_t U_EXPORT2 unum_getAttribute(const UNumberFormat* fmt, UNumberFormatAttribute attr) { - const NumberFormat* nf = reinterpret_cast(fmt); - if ( attr == UNUM_LENIENT_PARSE ) { - // Supported for all subclasses - return nf->isLenient(); - } + const NumberFormat* nf = reinterpret_cast(fmt); + if (attr == UNUM_LENIENT_PARSE) { + // Supported for all subclasses + return nf->isLenient(); + } + else if (attr == UNUM_MAX_INTEGER_DIGITS) { + return nf->getMaximumIntegerDigits(); + } + else if (attr == UNUM_MIN_INTEGER_DIGITS) { + return nf->getMinimumIntegerDigits(); + } + else if (attr == UNUM_INTEGER_DIGITS) { + // TODO: what should this return? + return nf->getMinimumIntegerDigits(); + } + else if (attr == UNUM_MAX_FRACTION_DIGITS) { + return nf->getMaximumFractionDigits(); + } + else if (attr == UNUM_MIN_FRACTION_DIGITS) { + return nf->getMinimumFractionDigits(); + } + else if (attr == UNUM_FRACTION_DIGITS) { + // TODO: what should this return? + return nf->getMinimumFractionDigits(); + } + else if (attr == UNUM_ROUNDING_MODE) { + return nf->getRoundingMode(); + } - // The remaining attributea are only supported for DecimalFormat - const DecimalFormat* df = dynamic_cast(nf); - if (df != NULL) { - UErrorCode ignoredStatus = U_ZERO_ERROR; - return df->getAttribute( attr, ignoredStatus ); - } + // The remaining attributes are only supported for DecimalFormat + const DecimalFormat* df = dynamic_cast(nf); + if (df != NULL) { + UErrorCode ignoredStatus = U_ZERO_ERROR; + return df->getAttribute(attr, ignoredStatus); + } - return -1; + return -1; } U_CAPI void U_EXPORT2 @@ -501,18 +551,42 @@ unum_setAttribute( UNumberFormat* fmt, UNumberFormatAttribute attr, int32_t newValue) { - NumberFormat* nf = reinterpret_cast(fmt); - if ( attr == UNUM_LENIENT_PARSE ) { - // Supported for all subclasses - // keep this here as the class may not be a DecimalFormat - return nf->setLenient(newValue != 0); - } - // The remaining attributea are only supported for DecimalFormat - DecimalFormat* df = dynamic_cast(nf); - if (df != NULL) { - UErrorCode ignoredStatus = U_ZERO_ERROR; - df->setAttribute(attr, newValue, ignoredStatus); - } + NumberFormat* nf = reinterpret_cast(fmt); + if (attr == UNUM_LENIENT_PARSE) { + // Supported for all subclasses + // keep this here as the class may not be a DecimalFormat + return nf->setLenient(newValue != 0); + } + else if (attr == UNUM_MAX_INTEGER_DIGITS) { + return nf->setMaximumIntegerDigits(newValue); + } + else if (attr == UNUM_MIN_INTEGER_DIGITS) { + return nf->setMinimumIntegerDigits(newValue); + } + else if (attr == UNUM_INTEGER_DIGITS) { + nf->setMinimumIntegerDigits(newValue); + return nf->setMaximumIntegerDigits(newValue); + } + else if (attr == UNUM_MAX_FRACTION_DIGITS) { + return nf->setMaximumFractionDigits(newValue); + } + else if (attr == UNUM_MIN_FRACTION_DIGITS) { + return nf->setMinimumFractionDigits(newValue); + } + else if (attr == UNUM_FRACTION_DIGITS) { + nf->setMinimumFractionDigits(newValue); + return nf->setMaximumFractionDigits(newValue); + } + else if (attr == UNUM_ROUNDING_MODE) { + return nf->setRoundingMode((NumberFormat::ERoundingMode)newValue); + } + + // The remaining attributes are only supported for DecimalFormat + DecimalFormat* df = dynamic_cast(nf); + if (df != NULL) { + UErrorCode ignoredStatus = U_ZERO_ERROR; + df->setAttribute(attr, newValue, ignoredStatus); + } } U_CAPI double U_EXPORT2 diff --git a/deps/icu-small/source/i18n/unumsys.cpp b/deps/icu-small/source/i18n/unumsys.cpp index f643e342ebc762..4a0d0fa3b6f347 100644 --- a/deps/icu-small/source/i18n/unumsys.cpp +++ b/deps/icu-small/source/i18n/unumsys.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/upluralrules.cpp b/deps/icu-small/source/i18n/upluralrules.cpp index 5e1eebf53d5dc2..24e74e3ee223f5 100644 --- a/deps/icu-small/source/i18n/upluralrules.cpp +++ b/deps/icu-small/source/i18n/upluralrules.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -15,6 +15,8 @@ #include "unicode/plurrule.h" #include "unicode/locid.h" #include "unicode/unistr.h" +#include "unicode/unum.h" +#include "unicode/numfmt.h" U_NAMESPACE_USE @@ -54,5 +56,48 @@ uplrules_select(const UPluralRules *uplrules, return result.extract(keyword, capacity, *status); } +U_CAPI int32_t U_EXPORT2 +uplrules_selectWithFormat(const UPluralRules *uplrules, + double number, + const UNumberFormat *fmt, + UChar *keyword, int32_t capacity, + UErrorCode *status) +{ + if (U_FAILURE(*status)) { + return 0; + } + const PluralRules* plrules = reinterpret_cast(uplrules); + const NumberFormat* nf = reinterpret_cast(fmt); + if (plrules == NULL || nf == NULL || ((keyword == NULL)? capacity != 0 : capacity < 0)) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + Formattable obj(number); + UnicodeString result = plrules->select(obj, *nf, *status); + return result.extract(keyword, capacity, *status); +} + +U_CAPI UEnumeration* U_EXPORT2 +uplrules_getKeywords(const UPluralRules *uplrules, + UErrorCode *status) +{ + if (U_FAILURE(*status)) { + return NULL; + } + const PluralRules* plrules = reinterpret_cast(uplrules); + if (plrules == NULL) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return NULL; + } + StringEnumeration *senum = plrules->getKeywords(*status); + if (U_FAILURE(*status)) { + return NULL; + } + if (senum == NULL) { + *status = U_MEMORY_ALLOCATION_ERROR; + return NULL; + } + return uenum_openFromStringEnumeration(senum, status); +} #endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/deps/icu-small/source/i18n/uregex.cpp b/deps/icu-small/source/i18n/uregex.cpp index 03e2586c5f74f4..a5dee6241dce24 100644 --- a/deps/icu-small/source/i18n/uregex.cpp +++ b/deps/icu-small/source/i18n/uregex.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/uregexc.cpp b/deps/icu-small/source/i18n/uregexc.cpp index 6d0dc2062c6037..8674b4f17f5876 100644 --- a/deps/icu-small/source/i18n/uregexc.cpp +++ b/deps/icu-small/source/i18n/uregexc.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/uregion.cpp b/deps/icu-small/source/i18n/uregion.cpp index 8e079ec593318c..79a623730c9487 100644 --- a/deps/icu-small/source/i18n/uregion.cpp +++ b/deps/icu-small/source/i18n/uregion.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/usearch.cpp b/deps/icu-small/source/i18n/usearch.cpp index 5e1617eb3e8d8d..e1e6c28e2bc985 100644 --- a/deps/icu-small/source/i18n/usearch.cpp +++ b/deps/icu-small/source/i18n/usearch.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/uspoof.cpp b/deps/icu-small/source/i18n/uspoof.cpp index d81b5b2149a206..019819b11cdde1 100644 --- a/deps/icu-small/source/i18n/uspoof.cpp +++ b/deps/icu-small/source/i18n/uspoof.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -6,7 +6,7 @@ * and others. All Rights Reserved. *************************************************************************** * file name: uspoof.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -374,7 +374,7 @@ uspoof_check2UTF8(const USpoofChecker *sc, if (U_FAILURE(*status)) { return 0; } - UnicodeString idStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : uprv_strlen(id))); + UnicodeString idStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : static_cast(uprv_strlen(id)))); int32_t result = uspoof_check2UnicodeString(sc, idStr, checkResult, status); return result; } @@ -413,8 +413,8 @@ uspoof_areConfusableUTF8(const USpoofChecker *sc, *status = U_ILLEGAL_ARGUMENT_ERROR; return 0; } - UnicodeString id1Str = UnicodeString::fromUTF8(StringPiece(id1, length1>=0? length1 : uprv_strlen(id1))); - UnicodeString id2Str = UnicodeString::fromUTF8(StringPiece(id2, length2>=0? length2 : uprv_strlen(id2))); + UnicodeString id1Str = UnicodeString::fromUTF8(StringPiece(id1, length1>=0? length1 : static_cast(uprv_strlen(id1)))); + UnicodeString id2Str = UnicodeString::fromUTF8(StringPiece(id2, length2>=0? length2 : static_cast(uprv_strlen(id2)))); int32_t results = uspoof_areConfusableUnicodeString(sc, id1Str, id2Str, status); return results; } @@ -680,7 +680,7 @@ uspoof_getSkeletonUTF8(const USpoofChecker *sc, return 0; } - UnicodeString srcStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : uprv_strlen(id))); + UnicodeString srcStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : static_cast(uprv_strlen(id)))); UnicodeString destStr; uspoof_getSkeletonUnicodeString(sc, type, srcStr, destStr, status); if (U_FAILURE(*status)) { diff --git a/deps/icu-small/source/i18n/uspoof_build.cpp b/deps/icu-small/source/i18n/uspoof_build.cpp index d676fe997741b3..7d2440e5af65e8 100644 --- a/deps/icu-small/source/i18n/uspoof_build.cpp +++ b/deps/icu-small/source/i18n/uspoof_build.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -6,7 +6,7 @@ * and others. All Rights Reserved. *************************************************************************** * file name: uspoof_build.cpp - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/uspoof_conf.cpp b/deps/icu-small/source/i18n/uspoof_conf.cpp index 6edd1fa3f3cd66..3a061d9dfcffe1 100644 --- a/deps/icu-small/source/i18n/uspoof_conf.cpp +++ b/deps/icu-small/source/i18n/uspoof_conf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: uspoof_conf.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -396,6 +396,7 @@ void ConfusabledataBuilder::outputData(UErrorCode &status) { for (i=0; ielementAti(i); UChar32 codePoint = ConfusableDataUtils::keyToCodePoint(key); + (void)previousCodePoint; // Suppress unused variable warning. // strictly greater because there can be only one entry per code point U_ASSERT(codePoint > previousCodePoint); keys[i] = key; diff --git a/deps/icu-small/source/i18n/uspoof_conf.h b/deps/icu-small/source/i18n/uspoof_conf.h index 72cd028104fdad..ad040edf105271 100644 --- a/deps/icu-small/source/i18n/uspoof_conf.h +++ b/deps/icu-small/source/i18n/uspoof_conf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * file name: uspoof_conf.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -21,6 +21,8 @@ #ifndef __USPOOF_BUILDCONF_H__ #define __USPOOF_BUILDCONF_H__ +#include "unicode/utypes.h" + #if !UCONFIG_NO_NORMALIZATION #if !UCONFIG_NO_REGULAR_EXPRESSIONS diff --git a/deps/icu-small/source/i18n/uspoof_impl.cpp b/deps/icu-small/source/i18n/uspoof_impl.cpp index fba742c3ffc013..0ca85c00a98a8d 100644 --- a/deps/icu-small/source/i18n/uspoof_impl.cpp +++ b/deps/icu-small/source/i18n/uspoof_impl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/uspoof_impl.h b/deps/icu-small/source/i18n/uspoof_impl.h index 62480e39e89791..1184b8d9060662 100644 --- a/deps/icu-small/source/i18n/uspoof_impl.h +++ b/deps/icu-small/source/i18n/uspoof_impl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** diff --git a/deps/icu-small/source/i18n/usrchimp.h b/deps/icu-small/source/i18n/usrchimp.h index e6693d16b7ac51..5438417e7e60aa 100644 --- a/deps/icu-small/source/i18n/usrchimp.h +++ b/deps/icu-small/source/i18n/usrchimp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/utf16collationiterator.cpp b/deps/icu-small/source/i18n/utf16collationiterator.cpp index 733729fae79ece..7598b0ee521f6e 100644 --- a/deps/icu-small/source/i18n/utf16collationiterator.cpp +++ b/deps/icu-small/source/i18n/utf16collationiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/utf16collationiterator.h b/deps/icu-small/source/i18n/utf16collationiterator.h index 505ab810d37921..fd3a05e9efab0b 100644 --- a/deps/icu-small/source/i18n/utf16collationiterator.h +++ b/deps/icu-small/source/i18n/utf16collationiterator.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/utf8collationiterator.cpp b/deps/icu-small/source/i18n/utf8collationiterator.cpp index 0a0205e7b31cc2..345b1994ef0e77 100644 --- a/deps/icu-small/source/i18n/utf8collationiterator.cpp +++ b/deps/icu-small/source/i18n/utf8collationiterator.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -49,26 +49,25 @@ UTF8CollationIterator::handleNextCE32(UChar32 &c, UErrorCode & /*errorCode*/) { } // Optimized combination of U8_NEXT_OR_FFFD() and UTRIE2_U8_NEXT32(). c = u8[pos++]; - if(c < 0xc0) { - // ASCII 00..7F; trail bytes 80..BF map to error values. + if(U8_IS_SINGLE(c)) { + // ASCII 00..7F return trie->data32[c]; } uint8_t t1, t2; - if(c < 0xe0 && pos != length && (t1 = (u8[pos] - 0x80)) <= 0x3f) { - // U+0080..U+07FF; 00..7F map to error values. + if(0xe0 <= c && c < 0xf0 && + ((pos + 1) < length || length < 0) && + U8_IS_VALID_LEAD3_AND_T1(c, t1 = u8[pos]) && + (t2 = (u8[pos + 1] - 0x80)) <= 0x3f) { + // U+0800..U+FFFF except surrogates + c = (((c & 0xf) << 12) | ((t1 & 0x3f) << 6) | t2); + pos += 2; + return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c); + } else if(c < 0xe0 && c >= 0xc2 && pos != length && (t1 = (u8[pos] - 0x80)) <= 0x3f) { + // U+0080..U+07FF uint32_t ce32 = trie->data32[trie->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET - 0xc0) + c] + t1]; c = ((c & 0x1f) << 6) | t1; ++pos; return ce32; - } else if(c <= 0xef && - ((pos + 1) < length || length < 0) && - (t1 = (u8[pos] - 0x80)) <= 0x3f && (c != 0xe0 || t1 >= 0x20) && - (t2 = (u8[pos + 1] - 0x80)) <= 0x3f - ) { - // U+0800..U+FFFF; caller maps surrogates to error values. - c = (UChar)((c << 12) | (t1 << 6) | t2); - pos += 2; - return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c); } else { // Function call for supplementary code points and error cases. // Illegal byte sequences yield U+FFFD. @@ -158,28 +157,17 @@ FCDUTF8CollationIterator::handleNextCE32(UChar32 &c, UErrorCode &errorCode) { return Collation::FALLBACK_CE32; } c = u8[pos++]; - if(c < 0xc0) { - // ASCII 00..7F; trail bytes 80..BF map to error values. + if(U8_IS_SINGLE(c)) { + // ASCII 00..7F return trie->data32[c]; } uint8_t t1, t2; - if(c < 0xe0 && pos != length && (t1 = (u8[pos] - 0x80)) <= 0x3f) { - // U+0080..U+07FF; 00..7F map to error values. - uint32_t ce32 = trie->data32[trie->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET - 0xc0) + c] + t1]; - c = ((c & 0x1f) << 6) | t1; - ++pos; - if(CollationFCD::hasTccc(c) && pos != length && nextHasLccc()) { - pos -= 2; - } else { - return ce32; - } - } else if(c <= 0xef && - ((pos + 1) < length || length < 0) && - (t1 = (u8[pos] - 0x80)) <= 0x3f && (c != 0xe0 || t1 >= 0x20) && - (t2 = (u8[pos + 1] - 0x80)) <= 0x3f - ) { - // U+0800..U+FFFF; caller maps surrogates to error values. - c = (UChar)((c << 12) | (t1 << 6) | t2); + if(0xe0 <= c && c < 0xf0 && + ((pos + 1) < length || length < 0) && + U8_IS_VALID_LEAD3_AND_T1(c, t1 = u8[pos]) && + (t2 = (u8[pos + 1] - 0x80)) <= 0x3f) { + // U+0800..U+FFFF except surrogates + c = (((c & 0xf) << 12) | ((t1 & 0x3f) << 6) | t2); pos += 2; if(CollationFCD::hasTccc(c) && (CollationFCD::maybeTibetanCompositeVowel(c) || @@ -188,6 +176,16 @@ FCDUTF8CollationIterator::handleNextCE32(UChar32 &c, UErrorCode &errorCode) { } else { break; // return CE32(BMP) } + } else if(c < 0xe0 && c >= 0xc2 && pos != length && (t1 = (u8[pos] - 0x80)) <= 0x3f) { + // U+0080..U+07FF + uint32_t ce32 = trie->data32[trie->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET - 0xc0) + c] + t1]; + c = ((c & 0x1f) << 6) | t1; + ++pos; + if(CollationFCD::hasTccc(c) && pos != length && nextHasLccc()) { + pos -= 2; + } else { + return ce32; + } } else { // Function call for supplementary code points and error cases. // Illegal byte sequences yield U+FFFD. @@ -237,7 +235,7 @@ UBool FCDUTF8CollationIterator::previousHasTccc() const { U_ASSERT(state == CHECK_BWD && pos != 0); UChar32 c = u8[pos - 1]; - if(c < 0x80) { return FALSE; } + if(U8_IS_SINGLE(c)) { return FALSE; } int32_t i = pos; U8_PREV_OR_FFFD(u8, 0, i, c); if(c > 0xffff) { c = U16_LEAD(c); } @@ -271,7 +269,7 @@ FCDUTF8CollationIterator::nextCodePoint(UErrorCode &errorCode) { if(pos == length || ((c = u8[pos]) == 0 && length < 0)) { return U_SENTINEL; } - if(c < 0x80) { + if(U8_IS_SINGLE(c)) { ++pos; return c; } @@ -309,7 +307,7 @@ FCDUTF8CollationIterator::previousCodePoint(UErrorCode &errorCode) { if(pos == 0) { return U_SENTINEL; } - if((c = u8[pos - 1]) < 0x80) { + if(U8_IS_SINGLE(c = u8[pos - 1])) { --pos; return c; } diff --git a/deps/icu-small/source/i18n/utf8collationiterator.h b/deps/icu-small/source/i18n/utf8collationiterator.h index 8deb5ea395b7af..9a3ec45aeb41eb 100644 --- a/deps/icu-small/source/i18n/utf8collationiterator.h +++ b/deps/icu-small/source/i18n/utf8collationiterator.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/utmscale.c b/deps/icu-small/source/i18n/utmscale.cpp similarity index 99% rename from deps/icu-small/source/i18n/utmscale.c rename to deps/icu-small/source/i18n/utmscale.cpp index 6868b9db2261a1..461985937acca4 100644 --- a/deps/icu-small/source/i18n/utmscale.c +++ b/deps/icu-small/source/i18n/utmscale.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/utrans.cpp b/deps/icu-small/source/i18n/utrans.cpp index aed817ce2636e7..62fd630d9e83d3 100644 --- a/deps/icu-small/source/i18n/utrans.cpp +++ b/deps/icu-small/source/i18n/utrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/valueformatter.cpp b/deps/icu-small/source/i18n/valueformatter.cpp index 45b08f60b653ac..e769f369d48609 100644 --- a/deps/icu-small/source/i18n/valueformatter.cpp +++ b/deps/icu-small/source/i18n/valueformatter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/valueformatter.h b/deps/icu-small/source/i18n/valueformatter.h index da2dd1b33787e5..836a05b17c5209 100644 --- a/deps/icu-small/source/i18n/valueformatter.h +++ b/deps/icu-small/source/i18n/valueformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/visibledigits.cpp b/deps/icu-small/source/i18n/visibledigits.cpp index 1fea3504dfeee8..03cfc68d255380 100644 --- a/deps/icu-small/source/i18n/visibledigits.cpp +++ b/deps/icu-small/source/i18n/visibledigits.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2016, International Business Machines diff --git a/deps/icu-small/source/i18n/visibledigits.h b/deps/icu-small/source/i18n/visibledigits.h index cd18239a56601a..03c8013e393374 100644 --- a/deps/icu-small/source/i18n/visibledigits.h +++ b/deps/icu-small/source/i18n/visibledigits.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * Copyright (C) 2015, International Business Machines diff --git a/deps/icu-small/source/i18n/vtzone.cpp b/deps/icu-small/source/i18n/vtzone.cpp index ba5f3bc0d7bde2..0c76c9b6c98bf2 100644 --- a/deps/icu-small/source/i18n/vtzone.cpp +++ b/deps/icu-small/source/i18n/vtzone.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -358,7 +358,7 @@ static void millisToOffset(int32_t millis, UnicodeString& str) { /* * Create a default TZNAME from TZID */ -static void getDefaultTZName(const UnicodeString tzid, UBool isDST, UnicodeString& zonename) { +static void getDefaultTZName(const UnicodeString &tzid, UBool isDST, UnicodeString& zonename) { zonename = tzid; if (isDST) { zonename += UNICODE_STRING_SIMPLE("(DST)"); @@ -1747,26 +1747,16 @@ VTimeZone::write(VTZWriter& writer, UErrorCode& status) const { } } } else { - UVector *customProps = NULL; + UnicodeString icutzprop; + UVector customProps(nullptr, uhash_compareUnicodeString, status); if (olsonzid.length() > 0 && icutzver.length() > 0) { - customProps = new UVector(uprv_deleteUObject, uhash_compareUnicodeString, status); - if (U_FAILURE(status)) { - return; - } - UnicodeString *icutzprop = new UnicodeString(ICU_TZINFO_PROP); - icutzprop->append(olsonzid); - icutzprop->append((UChar)0x005B/*'['*/); - icutzprop->append(icutzver); - icutzprop->append((UChar)0x005D/*']'*/); - customProps->addElement(icutzprop, status); - if (U_FAILURE(status)) { - delete icutzprop; - delete customProps; - return; - } + icutzprop.append(olsonzid); + icutzprop.append(u'['); + icutzprop.append(icutzver); + icutzprop.append(u']'); + customProps.addElement(&icutzprop, status); } - writeZone(writer, *tz, customProps, status); - delete customProps; + writeZone(writer, *tz, &customProps, status); } } diff --git a/deps/icu-small/source/i18n/vzone.cpp b/deps/icu-small/source/i18n/vzone.cpp index 7ee95e4edecd6a..6db3ba04c581f7 100644 --- a/deps/icu-small/source/i18n/vzone.cpp +++ b/deps/icu-small/source/i18n/vzone.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/vzone.h b/deps/icu-small/source/i18n/vzone.h index 22a41b4e37b478..700687e0cb76ab 100644 --- a/deps/icu-small/source/i18n/vzone.h +++ b/deps/icu-small/source/i18n/vzone.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/windtfmt.cpp b/deps/icu-small/source/i18n/windtfmt.cpp index 20ce338bb4b88a..e8e32abd3ff477 100644 --- a/deps/icu-small/source/i18n/windtfmt.cpp +++ b/deps/icu-small/source/i18n/windtfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -13,7 +13,7 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API #if !UCONFIG_NO_FORMATTING @@ -35,7 +35,9 @@ #include "windtfmt.h" #include "wintzimpl.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -92,12 +94,83 @@ UnicodeString* Win32DateFormat::getTimeDateFormat(const Calendar *cal, const Loc return result; } +// TODO: This is copied in both winnmfmt.cpp and windtfmt.cpp, but really should +// be factored out into a common helper for both. +static UErrorCode GetEquivalentWindowsLocaleName(const Locale& locale, UnicodeString** buffer) +{ + UErrorCode status = U_ZERO_ERROR; + char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + + // Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk". + (void)uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status); + + if (U_SUCCESS(status)) + { + // Need it to be UTF-16, not 8-bit + // TODO: This seems like a good thing for a helper + wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + int32_t i; + for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++) + { + if (asciiBCP47Tag[i] == '\0') + { + break; + } + else + { + // normally just copy the character + bcp47Tag[i] = static_cast(asciiBCP47Tag[i]); + } + } + + // Ensure it's null terminated + if (i < (UPRV_LENGTHOF(bcp47Tag) - 1)) + { + bcp47Tag[i] = L'\0'; + } + else + { + // Ran out of room. + bcp47Tag[UPRV_LENGTHOF(bcp47Tag) - 1] = L'\0'; + } + + + wchar_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {}; + + // Note: On Windows versions below 10, there is no support for locale name aliases. + // This means that it will fail for locales where ICU has a completely different + // name (like ku vs ckb), and it will also not work for alternate sort locale + // names like "de-DE-u-co-phonebk". + + // TODO: We could add some sort of exception table for cases like ku vs ckb. + + int length = ResolveLocaleName(bcp47Tag, windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName)); + + if (length > 0) + { + *buffer = new UnicodeString(windowsLocaleName); + } + else + { + status = U_UNSUPPORTED_ERROR; + } + } + return status; +} + // TODO: Range-check timeStyle, dateStyle Win32DateFormat::Win32DateFormat(DateFormat::EStyle timeStyle, DateFormat::EStyle dateStyle, const Locale &locale, UErrorCode &status) - : DateFormat(), fDateTimeMsg(NULL), fTimeStyle(timeStyle), fDateStyle(dateStyle), fLocale(locale), fZoneID() + : DateFormat(), fDateTimeMsg(NULL), fTimeStyle(timeStyle), fDateStyle(dateStyle), fLocale(locale), fZoneID(), fWindowsLocaleName(nullptr) { if (U_SUCCESS(status)) { - fLCID = locale.getLCID(); + GetEquivalentWindowsLocaleName(locale, &fWindowsLocaleName); + // Note: In the previous code, it would look up the LCID for the locale, and if + // the locale was not recognized then it would get an LCID of 0, which is a + // synonym for LOCALE_USER_DEFAULT on Windows. + // If the above method fails, then fWindowsLocaleName will remain as nullptr, and + // then we will pass nullptr to API GetLocaleInfoEx, which is the same as passing + // LOCALE_USER_DEFAULT. + fTZI = NEW_ARRAY(TIME_ZONE_INFORMATION, 1); uprv_memset(fTZI, 0, sizeof(TIME_ZONE_INFORMATION)); adoptCalendar(Calendar::createInstance(locale, status)); @@ -115,6 +188,7 @@ Win32DateFormat::~Win32DateFormat() // delete fCalendar; uprv_free(fTZI); delete fDateTimeMsg; + delete fWindowsLocaleName; } Win32DateFormat &Win32DateFormat::operator=(const Win32DateFormat &other) @@ -128,13 +202,14 @@ Win32DateFormat &Win32DateFormat::operator=(const Win32DateFormat &other) this->fTimeStyle = other.fTimeStyle; this->fDateStyle = other.fDateStyle; this->fLocale = other.fLocale; - this->fLCID = other.fLCID; // this->fCalendar = other.fCalendar->clone(); this->fZoneID = other.fZoneID; this->fTZI = NEW_ARRAY(TIME_ZONE_INFORMATION, 1); *this->fTZI = *other.fTZI; + this->fWindowsLocaleName = other.fWindowsLocaleName == NULL ? NULL : new UnicodeString(*other.fWindowsLocaleName); + return *this; } @@ -144,7 +219,7 @@ Format *Win32DateFormat::clone(void) const } // TODO: Is just ignoring pos the right thing? -UnicodeString &Win32DateFormat::format(Calendar &cal, UnicodeString &appendTo, FieldPosition &pos) const +UnicodeString &Win32DateFormat::format(Calendar &cal, UnicodeString &appendTo, FieldPosition & /* pos */) const { FILETIME ft; SYSTEMTIME st_gmt; @@ -188,7 +263,7 @@ UnicodeString &Win32DateFormat::format(Calendar &cal, UnicodeString &appendTo, F return appendTo; } -void Win32DateFormat::parse(const UnicodeString& text, Calendar& cal, ParsePosition& pos) const +void Win32DateFormat::parse(const UnicodeString& /* text */, Calendar& /* cal */, ParsePosition& pos) const { pos.setErrorIndex(pos.getIndex()); } @@ -231,18 +306,25 @@ static const DWORD dfFlags[] = {DATE_LONGDATE, DATE_LONGDATE, DATE_SHORTDATE, DA void Win32DateFormat::formatDate(const SYSTEMTIME *st, UnicodeString &appendTo) const { - int result; + int result=0; wchar_t stackBuffer[STACK_BUFFER_SIZE]; wchar_t *buffer = stackBuffer; + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } - result = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE); + result = GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE, NULL); if (result == 0) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0); + int newLength = GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0, NULL); buffer = NEW_ARRAY(wchar_t, newLength); - GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength); + + GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength, NULL); } } @@ -260,15 +342,22 @@ void Win32DateFormat::formatTime(const SYSTEMTIME *st, UnicodeString &appendTo) int result; wchar_t stackBuffer[STACK_BUFFER_SIZE]; wchar_t *buffer = stackBuffer; + const wchar_t *localeName = nullptr; - result = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE); + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + + result = GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE); if (result == 0) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, NULL, 0); + int newLength = GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, NULL, 0); buffer = NEW_ARRAY(wchar_t, newLength); - GetDateFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, newLength); + + GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, buffer, newLength); } } @@ -314,4 +403,4 @@ U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ -#endif // U_PLATFORM_HAS_WIN32_API +#endif // U_PLATFORM_USES_ONLY_WIN32_API diff --git a/deps/icu-small/source/i18n/windtfmt.h b/deps/icu-small/source/i18n/windtfmt.h index a8221943706ef0..43b6fe6dba269e 100644 --- a/deps/icu-small/source/i18n/windtfmt.h +++ b/deps/icu-small/source/i18n/windtfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -16,7 +16,7 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API #if !UCONFIG_NO_FORMATTING @@ -95,7 +95,7 @@ class Win32DateFormat : public DateFormat *

          * .   Base* polymorphic_pointer = createPolymorphicObject();
          * .   if (polymorphic_pointer->getDynamicClassID() ==
    -     * .       erived::getStaticClassID()) ...
    +     * .       derived::getStaticClassID()) ...
          * 
    * @return The class ID for all objects of this class. */ @@ -124,15 +124,16 @@ class Win32DateFormat : public DateFormat DateFormat::EStyle fTimeStyle; DateFormat::EStyle fDateStyle; Locale fLocale; - int32_t fLCID; UnicodeString fZoneID; TIME_ZONE_INFORMATION *fTZI; + + UnicodeString* fWindowsLocaleName; // Stores the equivalent Windows locale name. }; U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ -#endif // U_PLATFORM_HAS_WIN32_API +#endif // U_PLATFORM_USES_ONLY_WIN32_API #endif // __WINDTFMT diff --git a/deps/icu-small/source/i18n/winnmfmt.cpp b/deps/icu-small/source/i18n/winnmfmt.cpp index d7e98723bb271d..b1724b62c27279 100644 --- a/deps/icu-small/source/i18n/winnmfmt.cpp +++ b/deps/icu-small/source/i18n/winnmfmt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -28,7 +28,9 @@ #include "uassert.h" #include "locmap.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -58,43 +60,43 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Win32NumberFormat) * end in ";0" then the return value should be multiplied by 10. * (e.g. "3" => 30, "3;2" => 320) */ -static UINT getGrouping(const char *grouping) +static UINT getGrouping(const wchar_t *grouping) { UINT g = 0; - const char *s; + const wchar_t *s; - for (s = grouping; *s != '\0'; s += 1) { - if (*s > '0' && *s < '9') { - g = g * 10 + (*s - '0'); - } else if (*s != ';') { + for (s = grouping; *s != L'\0'; s += 1) { + if (*s > L'0' && *s < L'9') { + g = g * 10 + (*s - L'0'); + } else if (*s != L';') { break; } } - if (*s != '0') { + if (*s != L'0') { g *= 10; } return g; } -static void getNumberFormat(NUMBERFMTW *fmt, int32_t lcid) +static void getNumberFormat(NUMBERFMTW *fmt, const wchar_t *windowsLocaleName) { - char buf[10]; + wchar_t buf[10]; - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_IDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_IDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); - GetLocaleInfoA(lcid, LOCALE_SGROUPING, buf, 10); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SGROUPING, (LPWSTR)buf, 10); fmt->Grouping = getGrouping(buf); fmt->lpDecimalSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_SDECIMAL, fmt->lpDecimalSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SDECIMAL, fmt->lpDecimalSep, 6); fmt->lpThousandSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_STHOUSAND, fmt->lpThousandSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_STHOUSAND, fmt->lpThousandSep, 6); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_INEGNUMBER, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_INEGNUMBER, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); } static void freeNumberFormat(NUMBERFMTW *fmt) @@ -105,27 +107,27 @@ static void freeNumberFormat(NUMBERFMTW *fmt) } } -static void getCurrencyFormat(CURRENCYFMTW *fmt, int32_t lcid) +static void getCurrencyFormat(CURRENCYFMTW *fmt, const wchar_t *windowsLocaleName) { - char buf[10]; + wchar_t buf[10]; - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ICURRDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ICURRDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); - GetLocaleInfoA(lcid, LOCALE_SMONGROUPING, buf, sizeof(buf)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONGROUPING, (LPWSTR)buf, sizeof(buf)); fmt->Grouping = getGrouping(buf); fmt->lpDecimalSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_SMONDECIMALSEP, fmt->lpDecimalSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONDECIMALSEP, fmt->lpDecimalSep, 6); fmt->lpThousandSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_SMONTHOUSANDSEP, fmt->lpThousandSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONTHOUSANDSEP, fmt->lpThousandSep, 6); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_INEGCURR, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ICURRENCY, (LPWSTR) &fmt->PositiveOrder, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_INEGCURR, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ICURRENCY, (LPWSTR) &fmt->PositiveOrder, sizeof(UINT)); fmt->lpCurrencySymbol = NEW_ARRAY(wchar_t, 8); - GetLocaleInfoW(lcid, LOCALE_SCURRENCY, (LPWSTR) fmt->lpCurrencySymbol, 8); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SCURRENCY, (LPWSTR) fmt->lpCurrencySymbol, 8); } static void freeCurrencyFormat(CURRENCYFMTW *fmt) @@ -137,12 +139,84 @@ static void freeCurrencyFormat(CURRENCYFMTW *fmt) } } +// TODO: This is copied in both winnmfmt.cpp and windtfmt.cpp, but really should +// be factored out into a common helper for both. +static UErrorCode GetEquivalentWindowsLocaleName(const Locale& locale, UnicodeString** buffer) +{ + UErrorCode status = U_ZERO_ERROR; + char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + + // Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk". + (void) uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status); + + if (U_SUCCESS(status)) + { + // Need it to be UTF-16, not 8-bit + // TODO: This seems like a good thing for a helper + wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + int32_t i; + for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++) + { + if (asciiBCP47Tag[i] == '\0') + { + break; + } + else + { + // normally just copy the character + bcp47Tag[i] = static_cast(asciiBCP47Tag[i]); + } + } + + // Ensure it's null terminated + if (i < (UPRV_LENGTHOF(bcp47Tag) - 1)) + { + bcp47Tag[i] = L'\0'; + } + else + { + // Ran out of room. + bcp47Tag[UPRV_LENGTHOF(bcp47Tag) - 1] = L'\0'; + } + + + wchar_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {}; + + // Note: On Windows versions below 10, there is no support for locale name aliases. + // This means that it will fail for locales where ICU has a completely different + // name (like ku vs ckb), and it will also not work for alternate sort locale + // names like "de-DE-u-co-phonebk". + + // TODO: We could add some sort of exception table for cases like ku vs ckb. + + int length = ResolveLocaleName(bcp47Tag, windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName)); + + if (length > 0) + { + *buffer = new UnicodeString(windowsLocaleName); + } + else + { + status = U_UNSUPPORTED_ERROR; + } + } + return status; +} + Win32NumberFormat::Win32NumberFormat(const Locale &locale, UBool currency, UErrorCode &status) - : NumberFormat(), fCurrency(currency), fFormatInfo(NULL), fFractionDigitsSet(FALSE) + : NumberFormat(), fCurrency(currency), fFormatInfo(NULL), fFractionDigitsSet(FALSE), fWindowsLocaleName(nullptr) { if (!U_FAILURE(status)) { fLCID = locale.getLCID(); + GetEquivalentWindowsLocaleName(locale, &fWindowsLocaleName); + // Note: In the previous code, it would look up the LCID for the locale, and if + // the locale was not recognized then it would get an LCID of 0, which is a + // synonym for LOCALE_USER_DEFAULT on Windows. + // If the above method fails, then fWindowsLocaleName will remain as nullptr, and + // then we will pass nullptr to API GetLocaleInfoEx, which is the same as passing + // LOCALE_USER_DEFAULT. + // Resolve actual locale to be used later UErrorCode tmpsts = U_ZERO_ERROR; char tmpLocID[ULOC_FULLNAME_CAPACITY]; @@ -152,12 +226,19 @@ Win32NumberFormat::Win32NumberFormat(const Locale &locale, UBool currency, UErro fLocale = Locale((const char*)tmpLocID); } + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + fFormatInfo = (FormatInfo*)uprv_malloc(sizeof(FormatInfo)); if (fCurrency) { - getCurrencyFormat(&fFormatInfo->currency, fLCID); + getCurrencyFormat(&fFormatInfo->currency, localeName); } else { - getNumberFormat(&fFormatInfo->number, fLCID); + getNumberFormat(&fFormatInfo->number, localeName); } } } @@ -182,6 +263,7 @@ Win32NumberFormat::~Win32NumberFormat() uprv_free(fFormatInfo); } + delete fWindowsLocaleName; } Win32NumberFormat &Win32NumberFormat::operator=(const Win32NumberFormat &other) @@ -192,13 +274,21 @@ Win32NumberFormat &Win32NumberFormat::operator=(const Win32NumberFormat &other) this->fLocale = other.fLocale; this->fLCID = other.fLCID; this->fFractionDigitsSet = other.fFractionDigitsSet; + this->fWindowsLocaleName = other.fWindowsLocaleName == NULL ? NULL : new UnicodeString(*other.fWindowsLocaleName); + + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } if (fCurrency) { freeCurrencyFormat(&fFormatInfo->currency); - getCurrencyFormat(&fFormatInfo->currency, fLCID); + getCurrencyFormat(&fFormatInfo->currency, localeName); } else { freeNumberFormat(&fFormatInfo->number); - getNumberFormat(&fFormatInfo->number, fLCID); + getNumberFormat(&fFormatInfo->number, localeName); } return *this; @@ -209,17 +299,17 @@ Format *Win32NumberFormat::clone(void) const return new Win32NumberFormat(*this); } -UnicodeString& Win32NumberFormat::format(double number, UnicodeString& appendTo, FieldPosition& pos) const +UnicodeString& Win32NumberFormat::format(double number, UnicodeString& appendTo, FieldPosition& /* pos */) const { return format(getMaximumFractionDigits(), appendTo, L"%.16f", number); } -UnicodeString& Win32NumberFormat::format(int32_t number, UnicodeString& appendTo, FieldPosition& pos) const +UnicodeString& Win32NumberFormat::format(int32_t number, UnicodeString& appendTo, FieldPosition& /* pos */) const { return format(getMinimumFractionDigits(), appendTo, L"%I32d", number); } -UnicodeString& Win32NumberFormat::format(int64_t number, UnicodeString& appendTo, FieldPosition& pos) const +UnicodeString& Win32NumberFormat::format(int64_t number, UnicodeString& appendTo, FieldPosition& /* pos */) const { return format(getMinimumFractionDigits(), appendTo, L"%I64d", number); } @@ -299,6 +389,13 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen formatInfo = *fFormatInfo; buffer[0] = 0x0000; + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + if (fCurrency) { if (fFractionDigitsSet) { formatInfo.currency.NumDigits = (UINT) numDigits; @@ -308,17 +405,17 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen formatInfo.currency.Grouping = 0; } - result = GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, buffer, STACK_BUFFER_SIZE); + result = GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, buffer, STACK_BUFFER_SIZE); if (result == 0) { DWORD lastError = GetLastError(); if (lastError == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, NULL, 0); + int newLength = GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, NULL, 0); buffer = NEW_ARRAY(wchar_t, newLength); buffer[0] = 0x0000; - GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, buffer, newLength); + GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, buffer, newLength); } } } else { @@ -330,15 +427,15 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen formatInfo.number.Grouping = 0; } - result = GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, buffer, STACK_BUFFER_SIZE); + result = GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, buffer, STACK_BUFFER_SIZE); if (result == 0) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, NULL, 0); + int newLength = GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, NULL, 0); buffer = NEW_ARRAY(wchar_t, newLength); buffer[0] = 0x0000; - GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, buffer, newLength); + GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, buffer, newLength); } } } diff --git a/deps/icu-small/source/i18n/winnmfmt.h b/deps/icu-small/source/i18n/winnmfmt.h index 3b0df915e1439b..7ea5da91705476 100644 --- a/deps/icu-small/source/i18n/winnmfmt.h +++ b/deps/icu-small/source/i18n/winnmfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -128,7 +128,7 @@ class Win32NumberFormat : public NumberFormat *
          * .   Base* polymorphic_pointer = createPolymorphicObject();
          * .   if (polymorphic_pointer->getDynamicClassID() ==
    -     * .       erived::getStaticClassID()) ...
    +     * .       derived::getStaticClassID()) ...
          * 
    * @return The class ID for all objects of this class. */ @@ -155,6 +155,7 @@ class Win32NumberFormat : public NumberFormat FormatInfo *fFormatInfo; UBool fFractionDigitsSet; + UnicodeString* fWindowsLocaleName; // Stores the equivalent Windows locale name. }; U_NAMESPACE_END diff --git a/deps/icu-small/source/i18n/wintzimpl.cpp b/deps/icu-small/source/i18n/wintzimpl.cpp index 4c042d54213d05..c55ed95fa8aea2 100644 --- a/deps/icu-small/source/i18n/wintzimpl.cpp +++ b/deps/icu-small/source/i18n/wintzimpl.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -13,7 +13,7 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API && !UCONFIG_NO_FORMATTING +#if U_PLATFORM_USES_ONLY_WIN32_API && !UCONFIG_NO_FORMATTING #include "wintzimpl.h" @@ -24,7 +24,9 @@ #include "uassert.h" #include "cmemory.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -63,12 +65,12 @@ static UBool getSystemTimeInformation(TimeZone *tz, SYSTEMTIME &daylightDate, SY // Always use DOW type rule int32_t hour, min, sec, mil; standardDate.wYear = 0; - standardDate.wMonth = std->getRule()->getRuleMonth() + 1; - standardDate.wDay = std->getRule()->getRuleWeekInMonth(); + standardDate.wMonth = static_cast(std->getRule()->getRuleMonth()) + 1; + standardDate.wDay = static_cast(std->getRule()->getRuleWeekInMonth()); if (standardDate.wDay < 0) { standardDate.wDay = 5; } - standardDate.wDayOfWeek = std->getRule()->getRuleDayOfWeek() - 1; + standardDate.wDayOfWeek = static_cast(std->getRule()->getRuleDayOfWeek()) - 1; mil = std->getRule()->getRuleMillisInDay(); hour = mil/3600000; @@ -78,18 +80,18 @@ static UBool getSystemTimeInformation(TimeZone *tz, SYSTEMTIME &daylightDate, SY sec = mil/1000; mil %= 1000; - standardDate.wHour = hour; - standardDate.wMinute = min; - standardDate.wSecond = sec; - standardDate.wMilliseconds = mil; + standardDate.wHour = static_cast(hour); + standardDate.wMinute = static_cast(min); + standardDate.wSecond = static_cast(sec); + standardDate.wMilliseconds = static_cast(mil); daylightDate.wYear = 0; - daylightDate.wMonth = dst->getRule()->getRuleMonth() + 1; - daylightDate.wDay = dst->getRule()->getRuleWeekInMonth(); + daylightDate.wMonth = static_cast(dst->getRule()->getRuleMonth()) + 1; + daylightDate.wDay = static_cast(dst->getRule()->getRuleWeekInMonth()); if (daylightDate.wDay < 0) { daylightDate.wDay = 5; } - daylightDate.wDayOfWeek = dst->getRule()->getRuleDayOfWeek() - 1; + daylightDate.wDayOfWeek = static_cast(dst->getRule()->getRuleDayOfWeek()) - 1; mil = dst->getRule()->getRuleMillisInDay(); hour = mil/3600000; @@ -99,10 +101,10 @@ static UBool getSystemTimeInformation(TimeZone *tz, SYSTEMTIME &daylightDate, SY sec = mil/1000; mil %= 1000; - daylightDate.wHour = hour; - daylightDate.wMinute = min; - daylightDate.wSecond = sec; - daylightDate.wMilliseconds = mil; + daylightDate.wHour = static_cast(hour); + daylightDate.wMinute = static_cast(min); + daylightDate.wSecond = static_cast(sec); + daylightDate.wMilliseconds = static_cast(mil); } } else { result = FALSE; diff --git a/deps/icu-small/source/i18n/wintzimpl.h b/deps/icu-small/source/i18n/wintzimpl.h index 8149fc14173814..c36f2ad5f5f057 100644 --- a/deps/icu-small/source/i18n/wintzimpl.h +++ b/deps/icu-small/source/i18n/wintzimpl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -16,7 +16,7 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API /** * \file * \brief C API: Utilities for dealing w/ Windows time zones. @@ -34,6 +34,6 @@ U_CAPI UBool U_EXPORT2 uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length); -#endif /* U_PLATFORM_HAS_WIN32_API */ +#endif /* U_PLATFORM_USES_ONLY_WIN32_API */ #endif /* __WINTZIMPL */ diff --git a/deps/icu-small/source/i18n/zonemeta.cpp b/deps/icu-small/source/i18n/zonemeta.cpp index fdf333c3712aef..c386b0cae5e2ca 100644 --- a/deps/icu-small/source/i18n/zonemeta.cpp +++ b/deps/icu-small/source/i18n/zonemeta.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -17,7 +17,7 @@ #include "unicode/ustring.h" #include "unicode/putil.h" #include "unicode/simpletz.h" - +#include "unicode/strenum.h" #include "umutex.h" #include "uvector.h" #include "cmemory.h" @@ -28,6 +28,7 @@ #include "uresimp.h" #include "uhash.h" #include "olsontz.h" +#include "uinvchar.h" static UMutex gZoneMetaLock = U_MUTEX_INITIALIZER; @@ -255,6 +256,12 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) { tzid.extract(utzid, ZID_KEY_MAX + 1, tmpStatus); U_ASSERT(tmpStatus == U_ZERO_ERROR); // we checked the length of tzid already + if (!uprv_isInvariantUString(utzid, -1)) { + // All of known tz IDs are only containing ASCII invariant characters. + status = U_ILLEGAL_ARGUMENT_ERROR; + return NULL; + } + // Check if it was already cached umtx_lock(&gZoneMetaLock); { @@ -683,7 +690,6 @@ ZoneMeta::createMetazoneMappings(const UnicodeString &tzid) { mzMappings = new UVector(deleteOlsonToMetaMappingEntry, NULL, status); if (U_FAILURE(status)) { delete mzMappings; - deleteOlsonToMetaMappingEntry(entry); uprv_free(entry); break; } @@ -785,7 +791,7 @@ static void U_CALLCONV initAvailableMetaZoneIDs () { break; } const char *mzID = ures_getKey(&res); - int32_t len = uprv_strlen(mzID); + int32_t len = static_cast(uprv_strlen(mzID)); UChar *uMzID = (UChar*)uprv_malloc(sizeof(UChar) * (len + 1)); if (uMzID == NULL) { status = U_MEMORY_ALLOCATION_ERROR; diff --git a/deps/icu-small/source/i18n/zonemeta.h b/deps/icu-small/source/i18n/zonemeta.h index 84be5553ea797e..9dbcc878a22dc8 100644 --- a/deps/icu-small/source/i18n/zonemeta.h +++ b/deps/icu-small/source/i18n/zonemeta.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -41,7 +41,11 @@ class U_I18N_API ZoneMeta { /** * Return the canonical id for this tzid defined by CLDR, which might be the id itself. * This overload method returns a persistent const UChar*, which is guranteed to persist - * (a pointer to a resource). + * (a pointer to a resource). If the given system tzid is not known, U_ILLEGAL_ARGUMENT_ERROR + * is set in the status. + * @param tzid Zone ID + * @param status Receives the status + * @return The canonical ID for the input time zone ID */ static const UChar* U_EXPORT2 getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status); diff --git a/deps/icu-small/source/i18n/zrule.cpp b/deps/icu-small/source/i18n/zrule.cpp index ad64ab6e161ed5..c13411fc8e3f49 100644 --- a/deps/icu-small/source/i18n/zrule.cpp +++ b/deps/icu-small/source/i18n/zrule.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/zrule.h b/deps/icu-small/source/i18n/zrule.h index b9827bf5201a66..272f954f06905b 100644 --- a/deps/icu-small/source/i18n/zrule.h +++ b/deps/icu-small/source/i18n/zrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/ztrans.cpp b/deps/icu-small/source/i18n/ztrans.cpp index 956b563a2a0310..d2d93da1334b3e 100644 --- a/deps/icu-small/source/i18n/ztrans.cpp +++ b/deps/icu-small/source/i18n/ztrans.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/ztrans.h b/deps/icu-small/source/i18n/ztrans.h index 0101dc06e36bae..8b63eb47e88bbb 100644 --- a/deps/icu-small/source/i18n/ztrans.h +++ b/deps/icu-small/source/i18n/ztrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/io/locbund.cpp b/deps/icu-small/source/io/locbund.cpp index 4dc50d50df1e4c..f15788ee195599 100644 --- a/deps/icu-small/source/io/locbund.cpp +++ b/deps/icu-small/source/io/locbund.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/io/locbund.h b/deps/icu-small/source/io/locbund.h index b9e19484b654d2..5879e28f0154dc 100644 --- a/deps/icu-small/source/io/locbund.h +++ b/deps/icu-small/source/io/locbund.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/io/sprintf.c b/deps/icu-small/source/io/sprintf.cpp similarity index 99% rename from deps/icu-small/source/io/sprintf.c rename to deps/icu-small/source/io/sprintf.cpp index 17cdb2dcdd3f5e..20b9e52a217fe7 100644 --- a/deps/icu-small/source/io/sprintf.c +++ b/deps/icu-small/source/io/sprintf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/sscanf.c b/deps/icu-small/source/io/sscanf.cpp similarity index 98% rename from deps/icu-small/source/io/sscanf.c rename to deps/icu-small/source/io/sscanf.cpp index 2e14cdbcb65968..5409ebb7162ca6 100644 --- a/deps/icu-small/source/io/sscanf.c +++ b/deps/icu-small/source/io/sscanf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/ucln_io.cpp b/deps/icu-small/source/io/ucln_io.cpp index 5822d22be15981..388abbb4e955be 100644 --- a/deps/icu-small/source/io/ucln_io.cpp +++ b/deps/icu-small/source/io/ucln_io.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * * ****************************************************************************** * file name: ucln_io.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/io/ucln_io.h b/deps/icu-small/source/io/ucln_io.h index 97d06a12ffd18c..20dcb88ac74e1c 100644 --- a/deps/icu-small/source/io/ucln_io.h +++ b/deps/icu-small/source/io/ucln_io.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * * ****************************************************************************** * file name: ucln_io.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/io/ufile.c b/deps/icu-small/source/io/ufile.cpp similarity index 87% rename from deps/icu-small/source/io/ufile.c rename to deps/icu-small/source/io/ufile.cpp index 71d27a5e2596dd..6cbb897555d3c7 100644 --- a/deps/icu-small/source/io/ufile.c +++ b/deps/icu-small/source/io/ufile.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * ****************************************************************************** * -* File ufile.c +* File ufile.cpp * * Modification History: * @@ -20,10 +20,11 @@ ****************************************************************************** */ -/* - * fileno is not declared when building with GCC in strict mode. - */ -#if defined(__GNUC__) && defined(__STRICT_ANSI__) +#include "unicode/platform.h" +#if defined(__GNUC__) && !defined(__clang__) && defined(__STRICT_ANSI__) +// g++, fileno isn't defined if __STRICT_ANSI__ is defined. +// clang fails to compile the header unless __STRICT_ANSI__ is defined. +// __GNUC__ is set by both gcc and clang. #undef __STRICT_ANSI__ #endif @@ -32,6 +33,8 @@ #if !UCONFIG_NO_CONVERSION +#include + #include "ufile.h" #include "unicode/uloc.h" #include "unicode/ures.h" @@ -64,33 +67,7 @@ finit_owner(FILE *f, uprv_memset(result, 0, sizeof(UFILE)); result->fFileno = fileno(f); - -#if U_PLATFORM_USES_ONLY_WIN32_API && _MSC_VER < 1900 - /* - * Below is a very old workaround (ICU ticket:231). - * - * Previously, 'FILE*' from inside and outside ICU's DLL - * were different, because they pointed into local copies - * of the io block. At least by VS 2015 the implementation - * is something like: - * stdio = _acrt_iob_func(0) - * .. which is a function call, so should return the same pointer - * regardless of call site. - * As of _MSC_VER 1900 this patch is retired, at 16 years old. - */ - if (0 <= result->fFileno && result->fFileno <= 2) { - /* stdin, stdout and stderr need to be special cased for Windows 98 */ -#if _MSC_VER >= 1400 - result->fFile = &__iob_func()[_fileno(f)]; -#else - result->fFile = &_iob[_fileno(f)]; -#endif - } - else -#endif - { - result->fFile = f; - } + result->fFile = f; result->str.fBuffer = result->fUCBuffer; result->str.fPos = result->fUCBuffer; @@ -180,7 +157,11 @@ u_fopen_u(const UChar *filename, #if U_PLATFORM_USES_ONLY_WIN32_API /* Try Windows API _wfopen if the above fails. */ if (!result) { - FILE *systemFile = _wfopen(filename, (UChar*)perm); + // TODO: test this code path, including wperm. + wchar_t wperm[40] = {}; + size_t retVal; + mbstowcs_s(&retVal, wperm, perm, _TRUNCATE); + FILE *systemFile = _wfopen((const wchar_t *)filename, wperm); if (systemFile) { result = finit_owner(systemFile, locale, codepage, TRUE); } @@ -208,7 +189,7 @@ u_fstropen(UChar *stringBuf, result = (UFILE*) uprv_malloc(sizeof(UFILE)); /* Null pointer test */ if (result == NULL) { - return NULL; /* Just get out. */ + return NULL; /* Just get out. */ } uprv_memset(result, 0, sizeof(UFILE)); result->str.fBuffer = stringBuf; diff --git a/deps/icu-small/source/io/ufile.h b/deps/icu-small/source/io/ufile.h index b2562747e6e1ac..ed897275437fb0 100644 --- a/deps/icu-small/source/io/ufile.h +++ b/deps/icu-small/source/io/ufile.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -25,6 +25,8 @@ #if !UCONFIG_NO_CONVERSION +#include + #include "unicode/ucnv.h" #include "unicode/utrans.h" #include "locbund.h" diff --git a/deps/icu-small/source/io/ufmt_cmn.c b/deps/icu-small/source/io/ufmt_cmn.cpp similarity index 99% rename from deps/icu-small/source/io/ufmt_cmn.c rename to deps/icu-small/source/io/ufmt_cmn.cpp index e896bc560d44bc..760d2711bd624c 100644 --- a/deps/icu-small/source/io/ufmt_cmn.c +++ b/deps/icu-small/source/io/ufmt_cmn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/ufmt_cmn.h b/deps/icu-small/source/io/ufmt_cmn.h index 7daeee881363b2..d9cfd6a5f332b6 100644 --- a/deps/icu-small/source/io/ufmt_cmn.h +++ b/deps/icu-small/source/io/ufmt_cmn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -26,7 +26,7 @@ #include "unicode/utf16.h" #define UFMT_DEFAULT_BUFFER_SIZE 128 -#define MAX_UCHAR_BUFFER_SIZE(buffer) (sizeof(buffer)/(U16_MAX_LENGTH*sizeof(UChar))) +#define MAX_UCHAR_BUFFER_SIZE(buffer) ((int32_t)(sizeof(buffer)/(U16_MAX_LENGTH*sizeof(UChar)))) #define MAX_UCHAR_BUFFER_NEEDED(strLen) ((strLen+1)*U16_MAX_LENGTH*sizeof(UChar)) /** diff --git a/deps/icu-small/source/io/unicode/ustdio.h b/deps/icu-small/source/io/unicode/ustdio.h index 5e11bb67666c45..565b5b3fc57f49 100644 --- a/deps/icu-small/source/io/unicode/ustdio.h +++ b/deps/icu-small/source/io/unicode/ustdio.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/unicode/ustream.h b/deps/icu-small/source/io/unicode/ustream.h index ab52f6a28a0728..df1506ebfb2552 100644 --- a/deps/icu-small/source/io/unicode/ustream.h +++ b/deps/icu-small/source/io/unicode/ustream.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -30,7 +30,7 @@ * C++ I/O stream API. */ -#if !defined(_MSC_VER) +#if defined(__GLIBCXX__) namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364 #endif diff --git a/deps/icu-small/source/io/uprintf.cpp b/deps/icu-small/source/io/uprintf.cpp index e6062ade297862..316c794498fba6 100644 --- a/deps/icu-small/source/io/uprintf.cpp +++ b/deps/icu-small/source/io/uprintf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/uprintf.h b/deps/icu-small/source/io/uprintf.h index 0a07e6b7d6a0c3..0fd6066e5623af 100644 --- a/deps/icu-small/source/io/uprintf.h +++ b/deps/icu-small/source/io/uprintf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/uprntf_p.c b/deps/icu-small/source/io/uprntf_p.cpp similarity index 99% rename from deps/icu-small/source/io/uprntf_p.c rename to deps/icu-small/source/io/uprntf_p.cpp index 81f52696581960..ecf2e67235b1cc 100644 --- a/deps/icu-small/source/io/uprntf_p.c +++ b/deps/icu-small/source/io/uprntf_p.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -184,6 +184,9 @@ u_printf_simple_percent_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; + (void)info; + (void)args; static const UChar PERCENT[] = { UP_PERCENT }; /* put a single '%' onto the output */ @@ -198,6 +201,7 @@ u_printf_string_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; UChar *s; UChar buffer[UFMT_DEFAULT_BUFFER_SIZE]; int32_t len, written; @@ -248,6 +252,7 @@ u_printf_char_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; UChar s[U16_MAX_LENGTH+1]; int32_t len = 1, written; unsigned char arg = (unsigned char)(args[0].int64Value); @@ -418,6 +423,7 @@ u_printf_hex_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; int64_t num = args[0].int64Value; UChar result[UPRINTF_BUFFER_SIZE]; int32_t len = UPRINTF_BUFFER_SIZE; @@ -453,6 +459,7 @@ u_printf_octal_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; int64_t num = args[0].int64Value; UChar result[UPRINTF_BUFFER_SIZE]; int32_t len = UPRINTF_BUFFER_SIZE; @@ -540,6 +547,7 @@ u_printf_pointer_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; UChar result[UPRINTF_BUFFER_SIZE]; int32_t len = UPRINTF_BUFFER_SIZE; @@ -751,6 +759,7 @@ u_printf_ustring_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; int32_t len, written; const UChar *arg = (const UChar*)(args[0].ptrValue); @@ -779,6 +788,7 @@ u_printf_uchar_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)formatBundle; int32_t written = 0; UChar arg = (UChar)(args[0].int64Value); @@ -858,6 +868,9 @@ u_printf_count_handler(const u_printf_stream_handler *handler, const u_printf_spec_info *info, const ufmt_args *args) { + (void)handler; + (void)context; + (void)formatBundle; int32_t *count = (int32_t*)(args[0].ptrValue); /* in the special case of count, the u_printf_spec_info's width */ diff --git a/deps/icu-small/source/io/uscanf.c b/deps/icu-small/source/io/uscanf.cpp similarity index 97% rename from deps/icu-small/source/io/uscanf.c rename to deps/icu-small/source/io/uscanf.cpp index 9866963201ea53..0febd213985bda 100644 --- a/deps/icu-small/source/io/uscanf.c +++ b/deps/icu-small/source/io/uscanf.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/uscanf.h b/deps/icu-small/source/io/uscanf.h index bbe84d9e2bbf2a..760691cb0a20aa 100644 --- a/deps/icu-small/source/io/uscanf.h +++ b/deps/icu-small/source/io/uscanf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/uscanf_p.c b/deps/icu-small/source/io/uscanf_p.cpp similarity index 98% rename from deps/icu-small/source/io/uscanf_p.c rename to deps/icu-small/source/io/uscanf_p.cpp index f17502038ae45b..c08949d7299934 100644 --- a/deps/icu-small/source/io/uscanf_p.c +++ b/deps/icu-small/source/io/uscanf_p.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -380,6 +380,11 @@ u_scanf_simple_percent_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)info; + (void)args; + (void)fmt; + (void)fmtConsumed; + /* make sure the next character in the input is a percent */ *argConverted = 0; if(u_fgetc(input) != 0x0025) { @@ -396,6 +401,10 @@ u_scanf_count_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)input; + (void)fmt; + (void)fmtConsumed; + /* in the special case of count, the u_scanf_spec_info's width */ /* will contain the # of items converted thus far */ if (!info->fSkipArg) { @@ -420,6 +429,9 @@ u_scanf_double_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; double num; UNumberFormat *format; @@ -485,6 +497,9 @@ u_scanf_scientific_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; double num; UNumberFormat *format; @@ -582,6 +597,9 @@ u_scanf_scidbl_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; double num; UNumberFormat *scientificFormat, *genericFormat; @@ -672,6 +690,9 @@ u_scanf_integer_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; void *num = (void*) (args[0].ptrValue); UNumberFormat *format; @@ -745,6 +766,9 @@ u_scanf_percent_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; double num; UNumberFormat *format; @@ -802,6 +826,9 @@ u_scanf_string_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + const UChar *source; UConverter *conv; char *arg = (char*)(args[0].ptrValue); @@ -900,6 +927,9 @@ u_scanf_ustring_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + UChar *arg = (UChar*)(args[0].ptrValue); UChar *alias = arg; int32_t count; @@ -969,6 +999,9 @@ u_scanf_spellout_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; double num; UNumberFormat *format; @@ -1028,6 +1061,9 @@ u_scanf_hex_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; int32_t skipped; void *num = (void*) (args[0].ptrValue); @@ -1084,6 +1120,9 @@ u_scanf_octal_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; int32_t skipped; void *num = (void*) (args[0].ptrValue); @@ -1131,6 +1170,9 @@ u_scanf_pointer_handler(UFILE *input, int32_t *fmtConsumed, int32_t *argConverted) { + (void)fmt; + (void)fmtConsumed; + int32_t len; int32_t skipped; void *result; diff --git a/deps/icu-small/source/io/ustdio.c b/deps/icu-small/source/io/ustdio.cpp similarity index 99% rename from deps/icu-small/source/io/ustdio.c rename to deps/icu-small/source/io/ustdio.cpp index 4b156595bb18f5..790a097980b1af 100644 --- a/deps/icu-small/source/io/ustdio.c +++ b/deps/icu-small/source/io/ustdio.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/io/ustream.cpp b/deps/icu-small/source/io/ustream.cpp index 8e0087edbe6b21..a537d14383fc4f 100644 --- a/deps/icu-small/source/io/ustream.cpp +++ b/deps/icu-small/source/io/ustream.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/stubdata/stubdata.c b/deps/icu-small/source/stubdata/stubdata.cpp similarity index 95% rename from deps/icu-small/source/stubdata/stubdata.c rename to deps/icu-small/source/stubdata/stubdata.cpp index a1a16545605de1..de49b9a733a66e 100644 --- a/deps/icu-small/source/stubdata/stubdata.c +++ b/deps/icu-small/source/stubdata/stubdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * @@ -40,7 +40,7 @@ typedef struct { /* pointerTOC to OffsetTOC. */ } ICU_Data_Header; -U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = { +extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = { 32, /* headerSize */ 0xda, /* magic1, (see struct MappedData in udata.c) */ 0x27, /* magic2 */ diff --git a/deps/icu-small/source/tools/escapesrc/cptbl.h b/deps/icu-small/source/tools/escapesrc/cptbl.h new file mode 100644 index 00000000000000..efaa9642e10e75 --- /dev/null +++ b/deps/icu-small/source/tools/escapesrc/cptbl.h @@ -0,0 +1,520 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html +// generated by tblgen. You weren't going to edit it by hand, were you? + +static const char cp1047_8859_1[256] = { + (char)0x00, /* 00 */ + (char)0x01, /* 01 */ + (char)0x02, /* 02 */ + (char)0x03, /* 03 */ + (char)0x9C, /* 04 */ + (char)0x09, /* 05 */ + (char)0x86, /* 06 */ + (char)0x7F, /* 07 */ + (char)0x97, /* 08 */ + (char)0x8D, /* 09 */ + (char)0x8E, /* 0A */ + (char)0x0B, /* 0B */ + (char)0x0C, /* 0C */ + (char)0x0D, /* 0D */ + (char)0x0E, /* 0E */ + (char)0x0F, /* 0F */ + (char)0x10, /* 10 */ + (char)0x11, /* 11 */ + (char)0x12, /* 12 */ + (char)0x13, /* 13 */ + (char)0x9D, /* 14 */ + (char)0x85, /* 15 */ + (char)0x08, /* 16 */ + (char)0x87, /* 17 */ + (char)0x18, /* 18 */ + (char)0x19, /* 19 */ + (char)0x92, /* 1A */ + (char)0x8F, /* 1B */ + (char)0x1C, /* 1C */ + (char)0x1D, /* 1D */ + (char)0x1E, /* 1E */ + (char)0x1F, /* 1F */ + (char)0x80, /* 20 */ + (char)0x81, /* 21 */ + (char)0x82, /* 22 */ + (char)0x83, /* 23 */ + (char)0x84, /* 24 */ + (char)0x0A, /* 25 */ + (char)0x17, /* 26 */ + (char)0x1B, /* 27 */ + (char)0x88, /* 28 */ + (char)0x89, /* 29 */ + (char)0x8A, /* 2A */ + (char)0x8B, /* 2B */ + (char)0x8C, /* 2C */ + (char)0x05, /* 2D */ + (char)0x06, /* 2E */ + (char)0x07, /* 2F */ + (char)0x90, /* 30 */ + (char)0x91, /* 31 */ + (char)0x16, /* 32 */ + (char)0x93, /* 33 */ + (char)0x94, /* 34 */ + (char)0x95, /* 35 */ + (char)0x96, /* 36 */ + (char)0x04, /* 37 */ + (char)0x98, /* 38 */ + (char)0x99, /* 39 */ + (char)0x9A, /* 3A */ + (char)0x9B, /* 3B */ + (char)0x14, /* 3C */ + (char)0x15, /* 3D */ + (char)0x9E, /* 3E */ + (char)0x1A, /* 3F */ + (char)0x20, /* 40 */ + (char)0xA0, /* 41 */ + (char)0xE2, /* 42 */ + (char)0xE4, /* 43 */ + (char)0xE0, /* 44 */ + (char)0xE1, /* 45 */ + (char)0xE3, /* 46 */ + (char)0xE5, /* 47 */ + (char)0xE7, /* 48 */ + (char)0xF1, /* 49 */ + (char)0xA2, /* 4A */ + (char)0x2E, /* 4B */ + (char)0x3C, /* 4C */ + (char)0x28, /* 4D */ + (char)0x2B, /* 4E */ + (char)0x7C, /* 4F */ + (char)0x26, /* 50 */ + (char)0xE9, /* 51 */ + (char)0xEA, /* 52 */ + (char)0xEB, /* 53 */ + (char)0xE8, /* 54 */ + (char)0xED, /* 55 */ + (char)0xEE, /* 56 */ + (char)0xEF, /* 57 */ + (char)0xEC, /* 58 */ + (char)0xDF, /* 59 */ + (char)0x21, /* 5A */ + (char)0x24, /* 5B */ + (char)0x2A, /* 5C */ + (char)0x29, /* 5D */ + (char)0x3B, /* 5E */ + (char)0x5E, /* 5F */ + (char)0x2D, /* 60 */ + (char)0x2F, /* 61 */ + (char)0xC2, /* 62 */ + (char)0xC4, /* 63 */ + (char)0xC0, /* 64 */ + (char)0xC1, /* 65 */ + (char)0xC3, /* 66 */ + (char)0xC5, /* 67 */ + (char)0xC7, /* 68 */ + (char)0xD1, /* 69 */ + (char)0xA6, /* 6A */ + (char)0x2C, /* 6B */ + (char)0x25, /* 6C */ + (char)0x5F, /* 6D */ + (char)0x3E, /* 6E */ + (char)0x3F, /* 6F */ + (char)0xF8, /* 70 */ + (char)0xC9, /* 71 */ + (char)0xCA, /* 72 */ + (char)0xCB, /* 73 */ + (char)0xC8, /* 74 */ + (char)0xCD, /* 75 */ + (char)0xCE, /* 76 */ + (char)0xCF, /* 77 */ + (char)0xCC, /* 78 */ + (char)0x60, /* 79 */ + (char)0x3A, /* 7A */ + (char)0x23, /* 7B */ + (char)0x40, /* 7C */ + (char)0x27, /* 7D */ + (char)0x3D, /* 7E */ + (char)0x22, /* 7F */ + (char)0xD8, /* 80 */ + (char)0x61, /* 81 */ + (char)0x62, /* 82 */ + (char)0x63, /* 83 */ + (char)0x64, /* 84 */ + (char)0x65, /* 85 */ + (char)0x66, /* 86 */ + (char)0x67, /* 87 */ + (char)0x68, /* 88 */ + (char)0x69, /* 89 */ + (char)0xAB, /* 8A */ + (char)0xBB, /* 8B */ + (char)0xF0, /* 8C */ + (char)0xFD, /* 8D */ + (char)0xFE, /* 8E */ + (char)0xB1, /* 8F */ + (char)0xB0, /* 90 */ + (char)0x6A, /* 91 */ + (char)0x6B, /* 92 */ + (char)0x6C, /* 93 */ + (char)0x6D, /* 94 */ + (char)0x6E, /* 95 */ + (char)0x6F, /* 96 */ + (char)0x70, /* 97 */ + (char)0x71, /* 98 */ + (char)0x72, /* 99 */ + (char)0xAA, /* 9A */ + (char)0xBA, /* 9B */ + (char)0xE6, /* 9C */ + (char)0xB8, /* 9D */ + (char)0xC6, /* 9E */ + (char)0xA4, /* 9F */ + (char)0xB5, /* A0 */ + (char)0x7E, /* A1 */ + (char)0x73, /* A2 */ + (char)0x74, /* A3 */ + (char)0x75, /* A4 */ + (char)0x76, /* A5 */ + (char)0x77, /* A6 */ + (char)0x78, /* A7 */ + (char)0x79, /* A8 */ + (char)0x7A, /* A9 */ + (char)0xA1, /* AA */ + (char)0xBF, /* AB */ + (char)0xD0, /* AC */ + (char)0x5B, /* AD */ + (char)0xDE, /* AE */ + (char)0xAE, /* AF */ + (char)0xAC, /* B0 */ + (char)0xA3, /* B1 */ + (char)0xA5, /* B2 */ + (char)0xB7, /* B3 */ + (char)0xA9, /* B4 */ + (char)0xA7, /* B5 */ + (char)0xB6, /* B6 */ + (char)0xBC, /* B7 */ + (char)0xBD, /* B8 */ + (char)0xBE, /* B9 */ + (char)0xDD, /* BA */ + (char)0xA8, /* BB */ + (char)0xAF, /* BC */ + (char)0x5D, /* BD */ + (char)0xB4, /* BE */ + (char)0xD7, /* BF */ + (char)0x7B, /* C0 */ + (char)0x41, /* C1 */ + (char)0x42, /* C2 */ + (char)0x43, /* C3 */ + (char)0x44, /* C4 */ + (char)0x45, /* C5 */ + (char)0x46, /* C6 */ + (char)0x47, /* C7 */ + (char)0x48, /* C8 */ + (char)0x49, /* C9 */ + (char)0xAD, /* CA */ + (char)0xF4, /* CB */ + (char)0xF6, /* CC */ + (char)0xF2, /* CD */ + (char)0xF3, /* CE */ + (char)0xF5, /* CF */ + (char)0x7D, /* D0 */ + (char)0x4A, /* D1 */ + (char)0x4B, /* D2 */ + (char)0x4C, /* D3 */ + (char)0x4D, /* D4 */ + (char)0x4E, /* D5 */ + (char)0x4F, /* D6 */ + (char)0x50, /* D7 */ + (char)0x51, /* D8 */ + (char)0x52, /* D9 */ + (char)0xB9, /* DA */ + (char)0xFB, /* DB */ + (char)0xFC, /* DC */ + (char)0xF9, /* DD */ + (char)0xFA, /* DE */ + (char)0xFF, /* DF */ + (char)0x5C, /* E0 */ + (char)0xF7, /* E1 */ + (char)0x53, /* E2 */ + (char)0x54, /* E3 */ + (char)0x55, /* E4 */ + (char)0x56, /* E5 */ + (char)0x57, /* E6 */ + (char)0x58, /* E7 */ + (char)0x59, /* E8 */ + (char)0x5A, /* E9 */ + (char)0xB2, /* EA */ + (char)0xD4, /* EB */ + (char)0xD6, /* EC */ + (char)0xD2, /* ED */ + (char)0xD3, /* EE */ + (char)0xD5, /* EF */ + (char)0x30, /* F0 */ + (char)0x31, /* F1 */ + (char)0x32, /* F2 */ + (char)0x33, /* F3 */ + (char)0x34, /* F4 */ + (char)0x35, /* F5 */ + (char)0x36, /* F6 */ + (char)0x37, /* F7 */ + (char)0x38, /* F8 */ + (char)0x39, /* F9 */ + (char)0xB3, /* FA */ + (char)0xDB, /* FB */ + (char)0xDC, /* FC */ + (char)0xD9, /* FD */ + (char)0xDA, /* FE */ + (char)0x9F, /* FF */ +}; + +static const bool oldIllegal[256] = { + false, /* U+0000 */ + false, /* U+0001 */ + false, /* U+0002 */ + false, /* U+0003 */ + false, /* U+0004 */ + false, /* U+0005 */ + false, /* U+0006 */ + false, /* U+0007 */ + false, /* U+0008 */ + false, /* U+0009 */ + false, /* U+000A */ + false, /* U+000B */ + false, /* U+000C */ + false, /* U+000D */ + false, /* U+000E */ + false, /* U+000F */ + false, /* U+0010 */ + false, /* U+0011 */ + false, /* U+0012 */ + false, /* U+0013 */ + false, /* U+0014 */ + false, /* U+0015 */ + false, /* U+0016 */ + false, /* U+0017 */ + false, /* U+0018 */ + false, /* U+0019 */ + false, /* U+001A */ + false, /* U+001B */ + false, /* U+001C */ + false, /* U+001D */ + false, /* U+001E */ + false, /* U+001F */ + true, /* U+0020 */ + true, /* U+0021 */ + true, /* U+0022 */ + true, /* U+0023 */ + false, /* U+0024 */ + true, /* U+0025 */ + true, /* U+0026 */ + true, /* U+0027 */ + true, /* U+0028 */ + true, /* U+0029 */ + true, /* U+002A */ + true, /* U+002B */ + true, /* U+002C */ + true, /* U+002D */ + true, /* U+002E */ + true, /* U+002F */ + true, /* U+0030 */ + true, /* U+0031 */ + true, /* U+0032 */ + true, /* U+0033 */ + true, /* U+0034 */ + true, /* U+0035 */ + true, /* U+0036 */ + true, /* U+0037 */ + true, /* U+0038 */ + true, /* U+0039 */ + true, /* U+003A */ + true, /* U+003B */ + true, /* U+003C */ + true, /* U+003D */ + true, /* U+003E */ + true, /* U+003F */ + false, /* U+0040 */ + true, /* U+0041 */ + true, /* U+0042 */ + true, /* U+0043 */ + true, /* U+0044 */ + true, /* U+0045 */ + true, /* U+0046 */ + true, /* U+0047 */ + true, /* U+0048 */ + true, /* U+0049 */ + true, /* U+004A */ + true, /* U+004B */ + true, /* U+004C */ + true, /* U+004D */ + true, /* U+004E */ + true, /* U+004F */ + true, /* U+0050 */ + true, /* U+0051 */ + true, /* U+0052 */ + true, /* U+0053 */ + true, /* U+0054 */ + true, /* U+0055 */ + true, /* U+0056 */ + true, /* U+0057 */ + true, /* U+0058 */ + true, /* U+0059 */ + true, /* U+005A */ + true, /* U+005B */ + false, /* U+005C */ + true, /* U+005D */ + true, /* U+005E */ + true, /* U+005F */ + false, /* U+0060 */ + true, /* U+0061 */ + true, /* U+0062 */ + true, /* U+0063 */ + true, /* U+0064 */ + true, /* U+0065 */ + true, /* U+0066 */ + true, /* U+0067 */ + true, /* U+0068 */ + true, /* U+0069 */ + true, /* U+006A */ + true, /* U+006B */ + true, /* U+006C */ + true, /* U+006D */ + true, /* U+006E */ + true, /* U+006F */ + true, /* U+0070 */ + true, /* U+0071 */ + true, /* U+0072 */ + true, /* U+0073 */ + true, /* U+0074 */ + true, /* U+0075 */ + true, /* U+0076 */ + true, /* U+0077 */ + true, /* U+0078 */ + true, /* U+0079 */ + true, /* U+007A */ + true, /* U+007B */ + true, /* U+007C */ + true, /* U+007D */ + true, /* U+007E */ + false, /* U+007F */ + false, /* U+0080 */ + false, /* U+0081 */ + false, /* U+0082 */ + false, /* U+0083 */ + false, /* U+0084 */ + false, /* U+0085 */ + false, /* U+0086 */ + false, /* U+0087 */ + false, /* U+0088 */ + false, /* U+0089 */ + false, /* U+008A */ + false, /* U+008B */ + false, /* U+008C */ + false, /* U+008D */ + false, /* U+008E */ + false, /* U+008F */ + false, /* U+0090 */ + false, /* U+0091 */ + false, /* U+0092 */ + false, /* U+0093 */ + false, /* U+0094 */ + false, /* U+0095 */ + false, /* U+0096 */ + false, /* U+0097 */ + false, /* U+0098 */ + false, /* U+0099 */ + false, /* U+009A */ + false, /* U+009B */ + false, /* U+009C */ + false, /* U+009D */ + false, /* U+009E */ + false, /* U+009F */ + false, /* U+00A0 */ + false, /* U+00A1 */ + false, /* U+00A2 */ + false, /* U+00A3 */ + false, /* U+00A4 */ + false, /* U+00A5 */ + false, /* U+00A6 */ + false, /* U+00A7 */ + false, /* U+00A8 */ + false, /* U+00A9 */ + false, /* U+00AA */ + false, /* U+00AB */ + false, /* U+00AC */ + false, /* U+00AD */ + false, /* U+00AE */ + false, /* U+00AF */ + false, /* U+00B0 */ + false, /* U+00B1 */ + false, /* U+00B2 */ + false, /* U+00B3 */ + false, /* U+00B4 */ + false, /* U+00B5 */ + false, /* U+00B6 */ + false, /* U+00B7 */ + false, /* U+00B8 */ + false, /* U+00B9 */ + false, /* U+00BA */ + false, /* U+00BB */ + false, /* U+00BC */ + false, /* U+00BD */ + false, /* U+00BE */ + false, /* U+00BF */ + false, /* U+00C0 */ + false, /* U+00C1 */ + false, /* U+00C2 */ + false, /* U+00C3 */ + false, /* U+00C4 */ + false, /* U+00C5 */ + false, /* U+00C6 */ + false, /* U+00C7 */ + false, /* U+00C8 */ + false, /* U+00C9 */ + false, /* U+00CA */ + false, /* U+00CB */ + false, /* U+00CC */ + false, /* U+00CD */ + false, /* U+00CE */ + false, /* U+00CF */ + false, /* U+00D0 */ + false, /* U+00D1 */ + false, /* U+00D2 */ + false, /* U+00D3 */ + false, /* U+00D4 */ + false, /* U+00D5 */ + false, /* U+00D6 */ + false, /* U+00D7 */ + false, /* U+00D8 */ + false, /* U+00D9 */ + false, /* U+00DA */ + false, /* U+00DB */ + false, /* U+00DC */ + false, /* U+00DD */ + false, /* U+00DE */ + false, /* U+00DF */ + false, /* U+00E0 */ + false, /* U+00E1 */ + false, /* U+00E2 */ + false, /* U+00E3 */ + false, /* U+00E4 */ + false, /* U+00E5 */ + false, /* U+00E6 */ + false, /* U+00E7 */ + false, /* U+00E8 */ + false, /* U+00E9 */ + false, /* U+00EA */ + false, /* U+00EB */ + false, /* U+00EC */ + false, /* U+00ED */ + false, /* U+00EE */ + false, /* U+00EF */ + false, /* U+00F0 */ + false, /* U+00F1 */ + false, /* U+00F2 */ + false, /* U+00F3 */ + false, /* U+00F4 */ + false, /* U+00F5 */ + false, /* U+00F6 */ + false, /* U+00F7 */ + false, /* U+00F8 */ + false, /* U+00F9 */ + false, /* U+00FA */ + false, /* U+00FB */ + false, /* U+00FC */ + false, /* U+00FD */ + false, /* U+00FE */ + false, /* U+00FF */ +}; diff --git a/deps/icu-small/source/tools/escapesrc/escapesrc.cpp b/deps/icu-small/source/tools/escapesrc/escapesrc.cpp new file mode 100644 index 00000000000000..13bfbd3789fda7 --- /dev/null +++ b/deps/icu-small/source/tools/escapesrc/escapesrc.cpp @@ -0,0 +1,404 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include +#include +#include +#include +#include +#include +#include +#include + +// with caution: +#include "unicode/utf8.h" + +static const char + kSPACE = 0x20, + kTAB = 0x09, + kLF = 0x0A, + kCR = 0x0D; + // kHASH = 0x23, + // kSLASH = 0x2f, + // kSTAR = 0x2A, + +# include "cptbl.h" + +# define cp1047_to_8859(c) cp1047_8859_1[c] + +std::string prog; + +void usage() { + fprintf(stderr, "%s: usage: %s infile.cpp outfile.cpp\n", prog.c_str(), prog.c_str()); +} + + +int cleanup(const std::string &outfile) { + const char *outstr = outfile.c_str(); + if(outstr && *outstr) { + int rc = unlink(outstr); + if(rc == 0) { + fprintf(stderr, "%s: deleted %s\n", prog.c_str(), outstr); + return 0; + } else { + if( errno == ENOENT ) { + return 0; // File did not exist - no error. + } else { + perror("unlink"); + return 1; + } + } + } + return 0; +} + +// inline bool hasNonAscii(const char *line, size_t len) { +// const unsigned char *uline = reinterpret_cast(line); +// for(size_t i=0;i 0x7F) { +// return true; +// } +// } +// return false; +// } + +inline const char *skipws(const char *p, const char *e) { + for(;p0; pos2++,trail--) { + linestr[pos2] = cp1047_to_8859(linestr[pos2]); + if(linestr[pos2] == 0x0A) { + linestr[pos2] = 0x85; // NL is ambiguous here + } + } +#endif + + // Proceed to decode utf-8 + const uint8_t *s = (const uint8_t*) (linestr.c_str()); + int32_t length = linestr.size(); + UChar32 c; + if(U8_IS_SINGLE((uint8_t)s[i]) && oldIllegal[s[i]]) { +#if (U_CHARSET_FAMILY == U_EBCDIC_FAMILY) + linestr[pos] = old_byte; // put it back +#endif + continue; // single code point not previously legal for \u escaping + } + + // otherwise, convert it to \u / \U + { + U8_NEXT(s, i, length, c); + } + if(c<0) { + fprintf(stderr, "Illegal utf-8 sequence at Column: %d\n", (int)old_pos); + fprintf(stderr, "Line: >>%s<<\n", linestr.c_str()); + return true; + } + + size_t seqLen = (i-pos); + + //printf("U+%04X pos %d [len %d]\n", c, pos, seqLen);fflush(stdout); + + char newSeq[20]; + if( c <= 0xFFFF) { + sprintf(newSeq, "\\u%04X", c); + } else { + sprintf(newSeq, "\\U%08X", c); + } + linestr.replace(pos, seqLen, newSeq); + pos += strlen(newSeq) - 1; + } + } + + return false; +} + +/** + * false = no err + * true = had err + */ +bool fixLine(int /*no*/, std::string &linestr) { + const char *line = linestr.c_str(); + size_t len = linestr.size(); + + // no u' in the line? + if(!strstr(line, "u'") && !strstr(line, "u\"") && !strstr(line, "u8\"")) { + return false; // Nothing to do. No u' or u" detected + } + + // lines such as u8"\u0308" are all ASCII. + // // Quick Check: all ascii? + // if(!hasNonAscii(line, len)) { + // return false; // ASCII + // } + + // // comment or empty line? + // if(isCommentOrEmpty(line, len)) { + // return false; // Comment or just empty + // } + + // start from the end and find all u" cases + size_t pos = len = linestr.size(); + while((pos>0) && (pos = linestr.rfind("u\"", pos)) != std::string::npos) { + //printf("found doublequote at %d\n", pos); + if(fixAt(linestr, pos)) return true; + if(pos == 0) break; + pos--; + } + + // reset and find all u' cases + pos = len = linestr.size(); + while((pos>0) && (pos = linestr.rfind("u'", pos)) != std::string::npos) { + //printf("found singlequote at %d\n", pos); + if(fixAt(linestr, pos)) return true; + if(pos == 0) break; + pos--; + } + + // reset and find all u8" cases + pos = len = linestr.size(); + while((pos>0) && (pos = linestr.rfind("u8\"", pos)) != std::string::npos) { + if(fixAt(linestr, pos)) return true; + if(pos == 0) break; + pos--; + } + + //fprintf(stderr, "%d - fixed\n", no); + return false; +} + +int convert(const std::string &infile, const std::string &outfile) { + fprintf(stderr, "escapesrc: %s -> %s\n", infile.c_str(), outfile.c_str()); + + std::ifstream inf; + + inf.open(infile.c_str(), std::ios::in); + + if(!inf.is_open()) { + fprintf(stderr, "%s: could not open input file %s\n", prog.c_str(), infile.c_str()); + cleanup(outfile); + return 1; + } + + std::ofstream outf; + + outf.open(outfile.c_str(), std::ios::out); + + if(!outf.is_open()) { + fprintf(stderr, "%s: could not open output file %s\n", prog.c_str(), outfile.c_str()); + return 1; + } + + // TODO: any platform variations of #line? + outf << "#line 1 \"" << infile << "\"" << '\n'; + + int no = 0; + std::string linestr; + while( getline( inf, linestr)) { + no++; + if(fixLine(no, linestr)) { + outf.close(); + fprintf(stderr, "%s:%d: Fixup failed by %s\n", infile.c_str(), no, prog.c_str()); + cleanup(outfile); + return 1; + } + outf << linestr << '\n'; + } + + return 0; +} + +int main(int argc, const char *argv[]) { + prog = argv[0]; + + if(argc != 3) { + usage(); + return 1; + } + + std::string infile = argv[1]; + std::string outfile = argv[2]; + + return convert(infile, outfile); +} + + +#include "utf_impl.cpp" diff --git a/deps/icu-small/source/tools/escapesrc/expect-simple.cpp b/deps/icu-small/source/tools/escapesrc/expect-simple.cpp new file mode 100644 index 00000000000000..a6019a8d403f76 --- /dev/null +++ b/deps/icu-small/source/tools/escapesrc/expect-simple.cpp @@ -0,0 +1,17 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +u"sa\u0127\u0127a"; +u'\u6587'; +u"\U000219F2"; +u"\u039C\u03C5\u03C3\u03C4\u03AE\u03C1\u03B9\u03BF"; + + u"sa\u0127\u0127a"; + u'\u6587'; u"\U000219F2"; + +"\x20\xCC\x81"; +"\xCC\x88\x20"; +"\x73\x61\xC4\xA7\xC4\xA7\x61"; +"\xE6\x96\x87"; +"\xF0\xA1\xA7\xB2"; +"\x73\x61\xC4\xA7\xC4\xA7\x61"; diff --git a/deps/icu-small/source/tools/escapesrc/tblgen.cpp b/deps/icu-small/source/tools/escapesrc/tblgen.cpp new file mode 100644 index 00000000000000..9bf59a9db9a5df --- /dev/null +++ b/deps/icu-small/source/tools/escapesrc/tblgen.cpp @@ -0,0 +1,80 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include "unicode/utypes.h" +#include "unicode/ucnv.h" +#include "unicode/uniset.h" +#include + +static const char *kConverter = "ibm-1047"; + +int main(int argc, const char *argv[]) { + printf("// %s\n", U_COPYRIGHT_STRING); + printf("// generated by tblgen. You weren't going to edit it by hand, were you?\n"); + printf("\n"); + + UErrorCode status = U_ZERO_ERROR; + LocalUConverterPointer cnv(ucnv_open(kConverter, &status)); + + if(U_FAILURE(status)) { + fprintf(stderr, "Failed to open %s: %s\n", kConverter, u_errorName(status)); + return 1; + } + + printf("static const char cp1047_8859_1[256] = { \n"); + for(int i=0x00; i<0x100; i++) { + char cp1047[1]; + cp1047[0] = i; + UChar u[1]; + UChar *target = u; + const char *source = cp1047; + ucnv_toUnicode(cnv.getAlias(), &target, u+1, &source, cp1047+1, nullptr, true, &status); + if(U_FAILURE(status)) { + fprintf(stderr, "Conversion failure at #%X: %s\n", i, u_errorName(status)); + return 2; + } + printf(" (char)0x%02X, /* %02X */\n", u[0], i); + } + printf("};\n\n"); + + // + // UnicodeSet oldIllegal("[:print:]", status); // [a-zA-Z0-9_}{#)(><%:;.?*+-/^&|~!=,\\u005b\\u005d\\u005c]", status); + UnicodeSet oldIllegal("[0-9 a-z A-Z " + "_ \\{ \\} \\[ \\] # \\( \\) < > % \\: ; . " + "? * + \\- / \\^ \\& | ~ ! = , \\ \" ' ]", status); + + /* + +http://www.lirmm.fr/~ducour/Doc-objets/ISO+IEC+14882-1998.pdf ( note: 1998 ) page 10, section 2.2 says: + +1 The basic source character set consists of 96 characters: the space character, the control characters repre- 15) +senting horizontal tab, vertical tab, form feed, and new-line, plus the following 91 graphical characters: +a b c d e f g h i j k l m n opqrstuvwxyz +A B C D E F G H I J K L M N OPQRSTUVWXYZ +0 12 3 4 5 6 7 8 9 + _ { } [ ] # ( ) < > % : ; . ?*+-/^&|~!=,\" +2 The universal-character-name construct provides a way to name other characters. hex-quad: +hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit +universal-character-name: \u hex-quad +\U hex-quad hex-quad +The character designated by the universal-character-name \UNNNNNNNN is that character whose character short name in ISO/IEC 10646 is NNNNNNNN; the character designated by the universal-character-name \uNNNN is that character whose character short name in ISO/IEC 10646 is 0000NNNN. If the hexadecimal value for a universal character name is less than 0x20 or in the range 0x7F-0x9F (inclusive), or if the uni- versal character name designates a character in the basic source character set, then the program is ill- formed. + + +So basically: printable ASCII plus 0x00-0x1F, 0x7F-0x9F, was all illegal. + +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++) { + printf(" %s, /* U+%04X */\n", + (oldIllegal.contains(i))?" true":"false", + i); + } + printf("};\n\n"); + + return 0; +} diff --git a/deps/icu-small/source/tools/escapesrc/test-nochange.cpp b/deps/icu-small/source/tools/escapesrc/test-nochange.cpp new file mode 100644 index 00000000000000..8c0d04b8099201 --- /dev/null +++ b/deps/icu-small/source/tools/escapesrc/test-nochange.cpp @@ -0,0 +1,5 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +// This is a source file with no changes needed in it. +// In fact, the only non-ASCII character is the comment line at top. diff --git a/deps/icu-small/source/tools/escapesrc/test-simple.cpp b/deps/icu-small/source/tools/escapesrc/test-simple.cpp new file mode 100644 index 00000000000000..b03f28f7067295 --- /dev/null +++ b/deps/icu-small/source/tools/escapesrc/test-simple.cpp @@ -0,0 +1,17 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +u"saħħa"; +u'文'; +u"𡧲"; +u"Μυστήριο"; + + u"saħħa"; + u'文'; u"𡧲"; + +u8" \u0301"; +u8"\u0308 "; +u8"saħħa"; +u8"文"; +u8"𡧲"; +u8"saħ\u0127a"; diff --git a/deps/icu-small/source/tools/genccode/genccode.c b/deps/icu-small/source/tools/genccode/genccode.c index 2534820bac33b6..d35b5890105d9c 100644 --- a/deps/icu-small/source/tools/genccode/genccode.c +++ b/deps/icu-small/source/tools/genccode/genccode.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: gennames.c - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/gencmn/gencmn.c b/deps/icu-small/source/tools/gencmn/gencmn.c index d328a305215159..77f0c20c6131a4 100644 --- a/deps/icu-small/source/tools/gencmn/gencmn.c +++ b/deps/icu-small/source/tools/gencmn/gencmn.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: gencmn.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/genrb/derb.cpp b/deps/icu-small/source/tools/genrb/derb.cpp index 22e275ef353700..ac26d95be4ca01 100644 --- a/deps/icu-small/source/tools/genrb/derb.cpp +++ b/deps/icu-small/source/tools/genrb/derb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: derb.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/genrb/errmsg.c b/deps/icu-small/source/tools/genrb/errmsg.c index 7340f01af2a7d8..603f26a174c4e9 100644 --- a/deps/icu-small/source/tools/genrb/errmsg.c +++ b/deps/icu-small/source/tools/genrb/errmsg.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/errmsg.h b/deps/icu-small/source/tools/genrb/errmsg.h index 5026ecf7be54bb..e01b9558f03813 100644 --- a/deps/icu-small/source/tools/genrb/errmsg.h +++ b/deps/icu-small/source/tools/genrb/errmsg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/genrb.cpp b/deps/icu-small/source/tools/genrb/genrb.cpp index 685fb5884e405c..c4fc462066a099 100644 --- a/deps/icu-small/source/tools/genrb/genrb.cpp +++ b/deps/icu-small/source/tools/genrb/genrb.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -652,7 +652,7 @@ processFile(const char *filename, const char *cp, goto finish; } if (ucbuf == NULL || U_FAILURE(status)) { - fprintf(stderr, "An error occured processing file %s. Error: %s\n", + fprintf(stderr, "An error occurred processing file %s. Error: %s\n", openFileName == NULL ? filename : openFileName, u_errorName(status)); goto finish; } diff --git a/deps/icu-small/source/tools/genrb/genrb.h b/deps/icu-small/source/tools/genrb/genrb.h index 99c604f7809454..019020a34a9821 100644 --- a/deps/icu-small/source/tools/genrb/genrb.h +++ b/deps/icu-small/source/tools/genrb/genrb.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/parse.cpp b/deps/icu-small/source/tools/genrb/parse.cpp index f448daab6cc460..ddfb082afe63f4 100644 --- a/deps/icu-small/source/tools/genrb/parse.cpp +++ b/deps/icu-small/source/tools/genrb/parse.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -362,7 +362,7 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt ucbuf = ucbuf_open(filename, &cp, getShowWarning(),FALSE, status); if (U_FAILURE(*status)) { - error(line, "An error occured while opening the input file %s\n", filename); + error(line, "An error occurred while opening the input file %s\n", filename); return NULL; } @@ -500,7 +500,7 @@ parseTransliterator(ParseState* state, char *tag, uint32_t startline, const stru ucbuf = ucbuf_open(filename, &cp, getShowWarning(),FALSE, status); if (U_FAILURE(*status)) { - error(line, "An error occured while opening the input file %s\n", filename); + error(line, "An error occurred while opening the input file %s\n", filename); return NULL; } @@ -758,13 +758,13 @@ GenrbImporter::getRules( return; } if (ucbuf.isNull() || U_FAILURE(errorCode)) { - fprintf(stderr, "An error occured processing file %s. Error: %s\n", openFileName.data(), u_errorName(errorCode)); + fprintf(stderr, "An error occurred processing file %s. Error: %s\n", openFileName.data(), u_errorName(errorCode)); return; } /* Parse the data into an SRBRoot */ - struct SRBRoot *data = - parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), FALSE, FALSE, &errorCode); + LocalPointer data( + parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), FALSE, FALSE, &errorCode)); if (U_FAILURE(errorCode)) { return; } diff --git a/deps/icu-small/source/tools/genrb/parse.h b/deps/icu-small/source/tools/genrb/parse.h index d7341be6dd9fc4..dfe3b8dda06e55 100644 --- a/deps/icu-small/source/tools/genrb/parse.h +++ b/deps/icu-small/source/tools/genrb/parse.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/prscmnts.cpp b/deps/icu-small/source/tools/genrb/prscmnts.cpp index edae16c5c5f99b..5d494cd9ad3f2b 100644 --- a/deps/icu-small/source/tools/genrb/prscmnts.cpp +++ b/deps/icu-small/source/tools/genrb/prscmnts.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/prscmnts.h b/deps/icu-small/source/tools/genrb/prscmnts.h index c9958cd0713119..82cf0deaa13f96 100644 --- a/deps/icu-small/source/tools/genrb/prscmnts.h +++ b/deps/icu-small/source/tools/genrb/prscmnts.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/rbutil.c b/deps/icu-small/source/tools/genrb/rbutil.c index 174b4d7b44c4c6..808d35bb1b3d7c 100644 --- a/deps/icu-small/source/tools/genrb/rbutil.c +++ b/deps/icu-small/source/tools/genrb/rbutil.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/rbutil.h b/deps/icu-small/source/tools/genrb/rbutil.h index d2a303516ab820..9a12c509596e46 100644 --- a/deps/icu-small/source/tools/genrb/rbutil.h +++ b/deps/icu-small/source/tools/genrb/rbutil.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/read.c b/deps/icu-small/source/tools/genrb/read.c index 313fb61677f01f..c20b4510a28ac4 100644 --- a/deps/icu-small/source/tools/genrb/read.c +++ b/deps/icu-small/source/tools/genrb/read.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/read.h b/deps/icu-small/source/tools/genrb/read.h index 74b8c823a2e970..e5b8d155dad2e5 100644 --- a/deps/icu-small/source/tools/genrb/read.h +++ b/deps/icu-small/source/tools/genrb/read.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/reslist.cpp b/deps/icu-small/source/tools/genrb/reslist.cpp index 9420184a9df806..2e04bbce21ef74 100644 --- a/deps/icu-small/source/tools/genrb/reslist.cpp +++ b/deps/icu-small/source/tools/genrb/reslist.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -271,7 +271,7 @@ StringBaseResource::StringBaseResource(SRBRoot *bundle, const char *tag, int8_t return; } - fString.setTo(value, len); + fString.setTo(ConstChar16Ptr(value), len); fString.getTerminatedBuffer(); // Some code relies on NUL-termination. if (U_SUCCESS(errorCode) && fString.isBogus()) { errorCode = U_MEMORY_ALLOCATION_ERROR; @@ -1031,7 +1031,7 @@ void SRBRoot::write(const char *outputDir, const char *outputPkg, if (f16BitUnits.length() <= 1) { // no pool strings to checksum } else if (U_IS_BIG_ENDIAN) { - checksum = computeCRC((const char *)f16BitUnits.getBuffer(), + checksum = computeCRC(reinterpret_cast(f16BitUnits.getBuffer()), (uint32_t)f16BitUnits.length() * 2, checksum); } else { // Swap to big-endian so we get the same checksum on all platforms @@ -1039,7 +1039,7 @@ void SRBRoot::write(const char *outputDir, const char *outputPkg, UnicodeString s(f16BitUnits); s.append((UChar)1); // Ensure that we own this buffer. assert(!s.isBogus()); - uint16_t *p = (uint16_t *)s.getBuffer(); + uint16_t *p = const_cast(reinterpret_cast(s.getBuffer())); for (int32_t count = f16BitUnits.length(); count > 0; --count) { uint16_t x = *p; *p++ = (uint16_t)((x << 8) | (x >> 8)); diff --git a/deps/icu-small/source/tools/genrb/reslist.h b/deps/icu-small/source/tools/genrb/reslist.h index 614be2d10f9c56..53ade5b82c07e8 100644 --- a/deps/icu-small/source/tools/genrb/reslist.h +++ b/deps/icu-small/source/tools/genrb/reslist.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -304,7 +304,7 @@ class StringBaseResource : public SResource { StringBaseResource(int8_t type, const UChar *value, int32_t len, UErrorCode &errorCode); virtual ~StringBaseResource(); - const UChar *getBuffer() const { return fString.getBuffer(); } + const UChar *getBuffer() const { return icu::toUCharPtr(fString.getBuffer()); } int32_t length() const { return fString.length(); } virtual void handlePreWrite(uint32_t *byteOffset); diff --git a/deps/icu-small/source/tools/genrb/rle.c b/deps/icu-small/source/tools/genrb/rle.c index 4a69cd52985ad7..08495c2b4f4666 100644 --- a/deps/icu-small/source/tools/genrb/rle.c +++ b/deps/icu-small/source/tools/genrb/rle.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/rle.h b/deps/icu-small/source/tools/genrb/rle.h index 93d51a3750e8b2..9f580733d5846b 100644 --- a/deps/icu-small/source/tools/genrb/rle.h +++ b/deps/icu-small/source/tools/genrb/rle.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/ustr.c b/deps/icu-small/source/tools/genrb/ustr.c index 1631a205ff9fe0..f1436ae8aec172 100644 --- a/deps/icu-small/source/tools/genrb/ustr.c +++ b/deps/icu-small/source/tools/genrb/ustr.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/ustr.h b/deps/icu-small/source/tools/genrb/ustr.h index c27a78104fbdb1..91483d1f0fc0a5 100644 --- a/deps/icu-small/source/tools/genrb/ustr.h +++ b/deps/icu-small/source/tools/genrb/ustr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/genrb/wrtjava.cpp b/deps/icu-small/source/tools/genrb/wrtjava.cpp index 329753717b1f64..f1eb229760f12f 100644 --- a/deps/icu-small/source/tools/genrb/wrtjava.cpp +++ b/deps/icu-small/source/tools/genrb/wrtjava.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -33,6 +33,7 @@ #include "uhash.h" #include "uresimp.h" #include "unicode/ustring.h" +#include "unicode/utf8.h" void res_write_java(struct SResource *res,UErrorCode *status); @@ -244,7 +245,8 @@ str_write_java(const UChar *src, int32_t srcLen, UBool printEndLine, UErrorCode memset(buf,0,length); bufLen = uCharsToChars(buf,length,src,srcLen,status); - + // buflen accounts for extra bytes added due to multi byte encoding of + // non ASCII characters if(printEndLine) write_tabs(out); @@ -284,10 +286,22 @@ str_write_java(const UChar *src, int32_t srcLen, UBool printEndLine, UErrorCode } } T_FileStream_write(out,"\"",1); + uint32_t byteIndex = 0; + uint32_t trailBytes = 0; if(len+addfLength; - if(srcLen>0 ) { byteArray = res->fData; diff --git a/deps/icu-small/source/tools/genrb/wrtxml.cpp b/deps/icu-small/source/tools/genrb/wrtxml.cpp index 62fdd2427cd249..58e055d5718c03 100644 --- a/deps/icu-small/source/tools/genrb/wrtxml.cpp +++ b/deps/icu-small/source/tools/genrb/wrtxml.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -73,7 +73,7 @@ static int32_t write_utf8_file(FileStream* fileStream, UnicodeString outString) u_strToUTF8(NULL, 0, &len, - outString.getBuffer(), + toUCharPtr(outString.getBuffer()), outString.length(), &status); @@ -85,7 +85,7 @@ static int32_t write_utf8_file(FileStream* fileStream, UnicodeString outString) u_strToUTF8(dest, len, &len, - outString.getBuffer(), + toUCharPtr(outString.getBuffer()), outString.length(), &status); @@ -368,6 +368,7 @@ static char* convertAndEscape(char** pDest, int32_t destCap, int32_t* destLength #define LF 0x000D #define AT_SIGN 0x0040 +#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 static void trim(char **src, int32_t *len){ @@ -420,6 +421,8 @@ print(UChar* src, int32_t srcLen,const char *tagStart,const char *tagEnd, UErro } } +#endif + static void printNoteElements(const UString *src, UErrorCode *status){ @@ -471,6 +474,7 @@ static void printAttribute(const char *name, const char *value, int32_t /*len*/) write_utf8_file(out, UnicodeString("\"")); } +#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */ static void printAttribute(const char *name, const UnicodeString value, int32_t /*len*/) { write_utf8_file(out, UnicodeString(" ")); @@ -479,6 +483,7 @@ static void printAttribute(const char *name, const UnicodeString value, int32_t write_utf8_file(out, value); write_utf8_file(out, UnicodeString("\"")); } +#endif static void printComments(struct UString *src, const char *resName, UBool printTranslate, UErrorCode *status){ diff --git a/deps/icu-small/source/tools/icupkg/icupkg.cpp b/deps/icu-small/source/tools/icupkg/icupkg.cpp index 20239304410e7a..ea7be4a90923fd 100644 --- a/deps/icu-small/source/tools/icupkg/icupkg.cpp +++ b/deps/icu-small/source/tools/icupkg/icupkg.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: icupkg.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp index bf933186025baf..d4dc271732d80f 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp +++ b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2000-2016, International Business Machines @@ -26,7 +26,7 @@ #include "putilimp.h" #if U_HAVE_POPEN -#if (U_PF_MINGW <= U_PLATFORM || U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__) +#if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__) /* popen/pclose aren't defined in strict ANSI on Cygwin and MinGW */ #undef __STRICT_ANSI__ #endif @@ -121,7 +121,9 @@ enum { LIBNAME, QUIET, WITHOUT_ASSEMBLY, - PDS_BUILD + PDS_BUILD, + UWP_BUILD, + UWP_ARM_BUILD }; /* This sets the modes that are available */ @@ -163,7 +165,9 @@ static UOption options[]={ /*18*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG), /*19*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG), /*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG), - /*21*/ UOPTION_DEF( "zos-pds-build", 'z', UOPT_NO_ARG) + /*21*/ UOPTION_DEF("zos-pds-build", 'z', UOPT_NO_ARG), + /*22*/ UOPTION_DEF("windows-uwp-build", 'u', UOPT_NO_ARG), + /*23*/ UOPTION_DEF("windows-uwp-arm-build", 'a', UOPT_NO_ARG) }; /* This enum and the following char array should be kept in sync. */ @@ -250,9 +254,11 @@ const char options_help[][320]={ "Specify a version when packaging in dll or static mode", "Add package to all file names if not present", "Library name to build (if different than package name)", - "Quite mode. (e.g. Do not output a readme file for static libraries)", + "Quiet mode. (e.g. Do not output a readme file for static libraries)", "Build the data without assembly code", - "Build PDS dataset (zOS build only)" + "Build PDS dataset (zOS build only)", + "Build for Universal Windows Platform (Windows build only)", + "Set DLL machine type for UWP to target windows ARM (Windows UWP build only)" }; const char *progname = "PKGDATA"; @@ -1751,7 +1757,14 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD #ifdef WINDOWS_WITH_MSVC #define LINK_CMD "link.exe /nologo /release /out:" -#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /base:0x4ad00000 /implib:" +#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /implib:" +#ifdef _WIN64 +#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /DYNAMICBASE /APPCONTAINER " +#else +#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /SAFESEH /DYNAMICBASE /APPCONTAINER /MACHINE:X86" +#endif +#define LINK_EXTRA_UWP_FLAGS_ARM "/NXCOMPAT /DYNAMICBASE /APPCONTAINER /MACHINE:ARM" +#define LINK_EXTRA_NO_UWP_FLAGS "/base:0x4ad00000 " #define LIB_CMD "LIB.exe /nologo /out:" #define LIB_FILE "icudt.lib" #define LIB_EXT UDATA_LIB_SUFFIX @@ -1831,14 +1844,33 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U return 0; } - sprintf(cmd, "%s\"%s\" %s\"%s\" \"%s\" %s", - LINK_CMD, - dllFilePath, - LINK_FLAGS, - libFilePath, - gencFilePath, - resFilePath - ); + char *extraFlags = ""; +#ifdef WINDOWS_WITH_MSVC + if (options[UWP_BUILD].doesOccur) + { + if (options[UWP_ARM_BUILD].doesOccur) + { + extraFlags = LINK_EXTRA_UWP_FLAGS_ARM; + } + else + { + extraFlags = LINK_EXTRA_UWP_FLAGS; + } + } + else + { + extraFlags = LINK_EXTRA_NO_UWP_FLAGS; + } +#endif + sprintf(cmd, "%s\"%s\" %s %s\"%s\" \"%s\" %s", + LINK_CMD, + dllFilePath, + extraFlags, + LINK_FLAGS, + libFilePath, + gencFilePath, + resFilePath + ); } result = runCommand(cmd, TRUE); diff --git a/deps/icu-small/source/tools/pkgdata/pkgtypes.c b/deps/icu-small/source/tools/pkgdata/pkgtypes.c index eadf634db385e8..43ee3dfb5e2c33 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgtypes.c +++ b/deps/icu-small/source/tools/pkgdata/pkgtypes.c @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /************************************************************************** * diff --git a/deps/icu-small/source/tools/pkgdata/pkgtypes.h b/deps/icu-small/source/tools/pkgdata/pkgtypes.h index c7eeba42cb218e..3297d0a2daf4d5 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgtypes.h +++ b/deps/icu-small/source/tools/pkgdata/pkgtypes.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /************************************************************************** * diff --git a/deps/icu-small/source/tools/toolutil/collationinfo.cpp b/deps/icu-small/source/tools/toolutil/collationinfo.cpp index bbb1839ef1a5a4..6bad90e13331c7 100644 --- a/deps/icu-small/source/tools/toolutil/collationinfo.cpp +++ b/deps/icu-small/source/tools/toolutil/collationinfo.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/toolutil/collationinfo.h b/deps/icu-small/source/tools/toolutil/collationinfo.h index 48cd5561844cb8..815b89d40d68e6 100644 --- a/deps/icu-small/source/tools/toolutil/collationinfo.h +++ b/deps/icu-small/source/tools/toolutil/collationinfo.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/tools/toolutil/dbgutil.cpp b/deps/icu-small/source/tools/toolutil/dbgutil.cpp index 345715163baacd..29bab927535e78 100644 --- a/deps/icu-small/source/tools/toolutil/dbgutil.cpp +++ b/deps/icu-small/source/tools/toolutil/dbgutil.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: @@ -117,7 +117,7 @@ U_CAPI int32_t udbg_stoi(const UnicodeString &s) { char ch[256]; - const UChar *u = s.getBuffer(); + const UChar *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 = s.getBuffer(); + const UChar *u = toUCharPtr(s.getBuffer()); int32_t len = s.length(); u_UCharsToChars(u, ch, len); ch[len] = 0; /* include terminating \0 */ diff --git a/deps/icu-small/source/tools/toolutil/dbgutil.h b/deps/icu-small/source/tools/toolutil/dbgutil.h index 704090cc21d6c1..314a9ae885d5fa 100644 --- a/deps/icu-small/source/tools/toolutil/dbgutil.h +++ b/deps/icu-small/source/tools/toolutil/dbgutil.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* diff --git a/deps/icu-small/source/tools/toolutil/denseranges.cpp b/deps/icu-small/source/tools/toolutil/denseranges.cpp index 3b83715f28cfce..f5e52b1bbb53bb 100644 --- a/deps/icu-small/source/tools/toolutil/denseranges.cpp +++ b/deps/icu-small/source/tools/toolutil/denseranges.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: denseranges.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/denseranges.h b/deps/icu-small/source/tools/toolutil/denseranges.h index 7b072f4654ce59..c489ca47d8915f 100644 --- a/deps/icu-small/source/tools/toolutil/denseranges.h +++ b/deps/icu-small/source/tools/toolutil/denseranges.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: denseranges.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/filestrm.c b/deps/icu-small/source/tools/toolutil/filestrm.cpp similarity index 98% rename from deps/icu-small/source/tools/toolutil/filestrm.c rename to deps/icu-small/source/tools/toolutil/filestrm.cpp index 446125de6b1a83..cfffa1b75d7724 100644 --- a/deps/icu-small/source/tools/toolutil/filestrm.c +++ b/deps/icu-small/source/tools/toolutil/filestrm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/tools/toolutil/filestrm.h b/deps/icu-small/source/tools/toolutil/filestrm.h index b42345140681c6..86fac3063f35e3 100644 --- a/deps/icu-small/source/tools/toolutil/filestrm.h +++ b/deps/icu-small/source/tools/toolutil/filestrm.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** diff --git a/deps/icu-small/source/tools/toolutil/filetools.cpp b/deps/icu-small/source/tools/toolutil/filetools.cpp index b0d4ed81a560dd..176a791b0df853 100644 --- a/deps/icu-small/source/tools/toolutil/filetools.cpp +++ b/deps/icu-small/source/tools/toolutil/filetools.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2009-2013, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/filetools.h b/deps/icu-small/source/tools/toolutil/filetools.h index 5ede02761ac46a..6a25c3601c0178 100644 --- a/deps/icu-small/source/tools/toolutil/filetools.h +++ b/deps/icu-small/source/tools/toolutil/filetools.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: filetools.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/flagparser.c b/deps/icu-small/source/tools/toolutil/flagparser.cpp similarity index 95% rename from deps/icu-small/source/tools/toolutil/flagparser.c rename to deps/icu-small/source/tools/toolutil/flagparser.cpp index c87beb147cf44b..c8d791c636d14a 100644 --- a/deps/icu-small/source/tools/toolutil/flagparser.c +++ b/deps/icu-small/source/tools/toolutil/flagparser.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2009-2015, International Business Machines @@ -35,8 +35,8 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, goto parseFlagsFile_cleanup; } - buffer = uprv_malloc(sizeof(char) * currentBufferSize); - tmpFlagBuffer = uprv_malloc(sizeof(char) * flagBufferSize); + buffer = (char *)uprv_malloc(sizeof(char) * currentBufferSize); + tmpFlagBuffer = (char *)uprv_malloc(sizeof(char) * flagBufferSize); if (buffer == NULL || tmpFlagBuffer == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; @@ -48,7 +48,7 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, allocateMoreSpace = FALSE; currentBufferSize *= 2; uprv_free(buffer); - buffer = uprv_malloc(sizeof(char) * currentBufferSize); + buffer = (char *)uprv_malloc(sizeof(char) * currentBufferSize); if (buffer == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; goto parseFlagsFile_cleanup; diff --git a/deps/icu-small/source/tools/toolutil/flagparser.h b/deps/icu-small/source/tools/toolutil/flagparser.h index 4aa03c8a5fdca4..aa425471642ba5 100644 --- a/deps/icu-small/source/tools/toolutil/flagparser.h +++ b/deps/icu-small/source/tools/toolutil/flagparser.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: flagparser.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/package.cpp b/deps/icu-small/source/tools/toolutil/package.cpp index d069147708ed3d..d96c6dd36ddb41 100644 --- a/deps/icu-small/source/tools/toolutil/package.cpp +++ b/deps/icu-small/source/tools/toolutil/package.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: package.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -663,7 +663,7 @@ Package::readPackage(const char *filename) { // set the last item's platform type typeEnum=getTypeEnumForInputData(items[itemCount-1].data, items[itemCount-1].length, &errorCode); if(typeEnum<0 || U_FAILURE(errorCode)) { - fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename); + fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[itemCount-1].name, filename); exit(U_INVALID_FORMAT_ERROR); } items[itemCount-1].type=makeTypeLetter(typeEnum); @@ -1290,7 +1290,7 @@ void Package::setItemCapacity(int32_t max) Item *oldItems = items; if(newItems == NULL) { fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n", - (unsigned long)max*sizeof(items[0]), max); + (unsigned long)(max*sizeof(items[0])), max); exit(U_MEMORY_ALLOCATION_ERROR); } if(items && itemCount>0) { diff --git a/deps/icu-small/source/tools/toolutil/package.h b/deps/icu-small/source/tools/toolutil/package.h index 4d60202999243b..3263c84feb4c37 100644 --- a/deps/icu-small/source/tools/toolutil/package.h +++ b/deps/icu-small/source/tools/toolutil/package.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: package.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/pkg_genc.c b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp similarity index 96% rename from deps/icu-small/source/tools/toolutil/pkg_genc.c rename to deps/icu-small/source/tools/toolutil/pkg_genc.cpp index c85a12322b9381..5ab0d846302179 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_genc.c +++ b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2009-2016, International Business Machines @@ -47,6 +47,7 @@ #include "unicode/uclean.h" #include "uoptions.h" #include "pkg_genc.h" +#include "filetools.h" #define MAX_COLUMN ((uint32_t)(0xFFFFFFFFU)) @@ -283,8 +284,8 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr uprv_strcpy(outFilePath, bufferStr); } -#ifdef WINDOWS_WITH_GNUC - /* Need to fix the file seperator character when using MinGW. */ +#if defined (WINDOWS_WITH_GNUC) && U_PLATFORM != U_PF_CYGWIN + /* Need to fix the file separator character when using MinGW. */ swapFileSepChar(outFilePath, U_FILE_SEP_CHAR, '/'); #endif @@ -687,12 +688,19 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char /* _M_IA64 should be defined in windows.h */ # if defined(_M_IA64) *pCPU=IMAGE_FILE_MACHINE_IA64; + *pBits = 64; # elif defined(_M_AMD64) - *pCPU=IMAGE_FILE_MACHINE_AMD64; +// link.exe does not really care about the .obj machine type and this will +// allow us to build a dll for both ARM & x64 with an amd64 built tool +// ARM is same as x64 except for first 2 bytes of object file + *pCPU = IMAGE_FILE_MACHINE_UNKNOWN; + // *pCPU = IMAGE_FILE_MACHINE_ARMNT; // If we wanted to be explicit + // *pCPU = IMAGE_FILE_MACHINE_AMD64; // We would use one of these names + *pBits = 64; // Doesn't seem to be used for anything interesting? # else - *pCPU=IMAGE_FILE_MACHINE_I386; + *pCPU=IMAGE_FILE_MACHINE_I386; // We would use one of these names + *pBits = 32; # endif - *pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64; *pIsBigEndian=FALSE; #else # error "Unknown platform for CAN_GENERATE_OBJECTS." @@ -708,7 +716,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char length=T_FileStream_read(in, buffer.bytes, sizeof(buffer.bytes)); #ifdef U_ELF - if(lengthbasename, ((File *)file2)->basename); } +U_CDECL_END static void fixDirToTreePath(char *s) { + (void)s; #if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR) || ((U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)) char *t; #endif diff --git a/deps/icu-small/source/tools/toolutil/pkg_gencmn.h b/deps/icu-small/source/tools/toolutil/pkg_gencmn.h index 62f8327cdfdf91..238239960ae682 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_gencmn.h +++ b/deps/icu-small/source/tools/toolutil/pkg_gencmn.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2008, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/pkg_icu.cpp b/deps/icu-small/source/tools/toolutil/pkg_icu.cpp index e679c23be84f99..ce0bfc215b7199 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_icu.cpp +++ b/deps/icu-small/source/tools/toolutil/pkg_icu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2008-2015, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/pkg_icu.h b/deps/icu-small/source/tools/toolutil/pkg_icu.h index 3d620f78dfb6cc..638056e60b8c2b 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_icu.h +++ b/deps/icu-small/source/tools/toolutil/pkg_icu.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2008-2016, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/pkg_imp.h b/deps/icu-small/source/tools/toolutil/pkg_imp.h index c9fe81bd73a20a..29abd8d83c0a18 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_imp.h +++ b/deps/icu-small/source/tools/toolutil/pkg_imp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: pkg_imp.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/pkgitems.cpp b/deps/icu-small/source/tools/toolutil/pkgitems.cpp index 91c85201101c01..dd414c2f873e22 100644 --- a/deps/icu-small/source/tools/toolutil/pkgitems.cpp +++ b/deps/icu-small/source/tools/toolutil/pkgitems.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: pkgitems.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/ppucd.cpp b/deps/icu-small/source/tools/toolutil/ppucd.cpp index 18d317e3e330f2..b11efa7f7c4601 100644 --- a/deps/icu-small/source/tools/toolutil/ppucd.cpp +++ b/deps/icu-small/source/tools/toolutil/ppucd.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ppucd.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -98,6 +98,7 @@ static const char *lineTypeStrings[]={ "defaults", "block", "cp", + "unassigned", "algnamesrange" }; @@ -203,8 +204,17 @@ PreparsedUCD::getProps(UnicodeSet &newValues, UErrorCode &errorCode) { UChar32 start, end; if(!parseCodePointRange(field, start, end, errorCode)) { return NULL; } UniProps *props; + UBool insideBlock=FALSE; // TRUE if cp or unassigned range inside the block range. switch(lineType) { case DEFAULTS_LINE: + // Should occur before any block/cp/unassigned line. + if(blockLineIndex>=0) { + fprintf(stderr, + "error in preparsed UCD: default line %ld after one or more block lines\n", + (long)lineNumber); + errorCode=U_PARSE_ERROR; + return NULL; + } if(defaultLineIndex>=0) { fprintf(stderr, "error in preparsed UCD: second line with default properties on line %ld\n", @@ -228,9 +238,22 @@ PreparsedUCD::getProps(UnicodeSet &newValues, UErrorCode &errorCode) { blockLineIndex=lineIndex; break; case CP_LINE: + case UNASSIGNED_LINE: if(blockProps.start<=start && end<=blockProps.end) { - // Code point range fully inside the last block inherits the block properties. - cpProps=blockProps; + insideBlock=TRUE; + if(lineType==CP_LINE) { + // Code point range fully inside the last block inherits the block properties. + cpProps=blockProps; + } else { + // Unassigned line inside the block is based on default properties + // which override block properties. + cpProps=defaultProps; + newValues=blockValues; + // Except, it inherits the one blk=Block property. + int32_t blkIndex=UCHAR_BLOCK-UCHAR_INT_START; + cpProps.intProps[blkIndex]=blockProps.intProps[blkIndex]; + newValues.remove((UChar32)UCHAR_BLOCK); + } } else if(start>blockProps.end || endf-r->f; } - +U_CDECL_BEGIN /* sorting by Unicode first sorts mappings directly */ -static int32_t +static int32_t U_CALLCONV compareMappingsUnicodeFirst(const void *context, const void *left, const void *right) { return compareMappings( (UCMTable *)context, (const UCMapping *)left, @@ -209,7 +209,7 @@ compareMappingsUnicodeFirst(const void *context, const void *left, const void *r } /* sorting by bytes first sorts the reverseMap; use indirection to mappings */ -static int32_t +static int32_t U_CALLCONV compareMappingsBytesFirst(const void *context, const void *left, const void *right) { UCMTable *table=(UCMTable *)context; int32_t l=*(const int32_t *)left, r=*(const int32_t *)right; @@ -217,6 +217,7 @@ compareMappingsBytesFirst(const void *context, const void *left, const void *rig table, table->mappings+l, table, table->mappings+r, FALSE); } +U_CDECL_END U_CAPI void U_EXPORT2 ucm_sortTable(UCMTable *t) { @@ -310,6 +311,8 @@ enum { static uint8_t checkBaseExtUnicode(UCMStates *baseStates, UCMTable *base, UCMTable *ext, UBool moveToExt, UBool intersectBase) { + (void)baseStates; + UCMapping *mb, *me, *mbLimit, *meLimit; int32_t cmp; uint8_t result; @@ -1043,6 +1046,7 @@ ucm_mappingType(UCMStates *baseStates, UCMapping *m, UChar32 codePoints[UCNV_EXT_MAX_UCHARS], uint8_t bytes[UCNV_EXT_MAX_BYTES]) { + (void)codePoints; /* check validity of the bytes and count the characters in them */ int32_t count=ucm_countChars(baseStates, bytes, m->bLen); if(count<1) { diff --git a/deps/icu-small/source/tools/toolutil/ucm.h b/deps/icu-small/source/tools/toolutil/ucm.h index 0058adab5da1d1..3af939758552d7 100644 --- a/deps/icu-small/source/tools/toolutil/ucm.h +++ b/deps/icu-small/source/tools/toolutil/ucm.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucm.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/ucmstate.c b/deps/icu-small/source/tools/toolutil/ucmstate.cpp similarity index 99% rename from deps/icu-small/source/tools/toolutil/ucmstate.c rename to deps/icu-small/source/tools/toolutil/ucmstate.cpp index 7c8559090b2a9b..277657522963fa 100644 --- a/deps/icu-small/source/tools/toolutil/ucmstate.c +++ b/deps/icu-small/source/tools/toolutil/ucmstate.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: ucmstate.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -916,10 +916,13 @@ compactToUnicodeHelper(UCMStates *states, } } -static int32_t +U_CDECL_BEGIN +static int32_t U_CALLCONV compareFallbacks(const void *context, const void *fb1, const void *fb2) { + (void)context; return ((const _MBCSToUFallback *)fb1)->offset-((const _MBCSToUFallback *)fb2)->offset; } +U_CDECL_END U_CAPI void U_EXPORT2 ucm_optimizeStates(UCMStates *states, diff --git a/deps/icu-small/source/tools/toolutil/udbgutil.cpp b/deps/icu-small/source/tools/toolutil/udbgutil.cpp index bbb814ba901c41..446e11aaf9084f 100644 --- a/deps/icu-small/source/tools/toolutil/udbgutil.cpp +++ b/deps/icu-small/source/tools/toolutil/udbgutil.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: @@ -351,8 +351,10 @@ int32_t udbg_enumByName(UDebugEnumType type, const char *value) { */ U_CAPI const char *udbg_getPlatform(void) { -#if U_PLATFORM_HAS_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API return "Windows"; +#elif U_PLATFORM == U_PF_CYGWIN + return "Cygwin"; #elif U_PLATFORM == U_PF_UNKNOWN return "unknown"; #elif U_PLATFORM == U_PF_DARWIN @@ -613,40 +615,6 @@ U_CAPI char *udbg_knownIssueURLFrom(const char *ticket, char *buf) { } -#if !U_HAVE_STD_STRING -const char *warning = "WARNING: Don't have std::string (STL) - known issue logs will be deficient."; - -U_CAPI void *udbg_knownIssue_openU(void *ptr, const char *ticket, char *where, const UChar *msg, UBool *firstForTicket, - UBool *firstForWhere) { - if(ptr==NULL) { - puts(warning); - } - printf("%s\tKnown Issue #%s\n", where, ticket); - - return (void*)warning; -} - -U_CAPI void *udbg_knownIssue_open(void *ptr, const char *ticket, char *where, const char *msg, UBool *firstForTicket, - UBool *firstForWhere) { - if(ptr==NULL) { - puts(warning); - } - if(msg==NULL) msg = ""; - printf("%s\tKnown Issue #%s \"%s\n", where, ticket, msg); - - return (void*)warning; -} - -U_CAPI UBool udbg_knownIssue_print(void *ptr) { - puts(warning); - return FALSE; -} - -U_CAPI void udbg_knownIssue_close(void *ptr) { - // nothing to do -} -#else - #include #include #include @@ -785,5 +753,3 @@ U_CAPI void udbg_knownIssue_close(void *ptr) { KnownIssues *t = static_cast(ptr); delete t; } - -#endif diff --git a/deps/icu-small/source/tools/toolutil/udbgutil.h b/deps/icu-small/source/tools/toolutil/udbgutil.h index 4bfb4cf86720a9..2f186e6ed87f26 100644 --- a/deps/icu-small/source/tools/toolutil/udbgutil.h +++ b/deps/icu-small/source/tools/toolutil/udbgutil.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ************************************************************************ diff --git a/deps/icu-small/source/tools/toolutil/unewdata.c b/deps/icu-small/source/tools/toolutil/unewdata.cpp similarity index 98% rename from deps/icu-small/source/tools/toolutil/unewdata.c rename to deps/icu-small/source/tools/toolutil/unewdata.cpp index f3b152c0796ce0..5c28e992c9a98b 100644 --- a/deps/icu-small/source/tools/toolutil/unewdata.c +++ b/deps/icu-small/source/tools/toolutil/unewdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unewdata.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/unewdata.h b/deps/icu-small/source/tools/toolutil/unewdata.h index 9cc39942258700..137fb49584a5ba 100644 --- a/deps/icu-small/source/tools/toolutil/unewdata.h +++ b/deps/icu-small/source/tools/toolutil/unewdata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: unewdata.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/uoptions.c b/deps/icu-small/source/tools/toolutil/uoptions.cpp similarity index 98% rename from deps/icu-small/source/tools/toolutil/uoptions.c rename to deps/icu-small/source/tools/toolutil/uoptions.cpp index e5ce64a3728e99..53a77bcc4cc762 100644 --- a/deps/icu-small/source/tools/toolutil/uoptions.c +++ b/deps/icu-small/source/tools/toolutil/uoptions.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uoptions.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/uoptions.h b/deps/icu-small/source/tools/toolutil/uoptions.h index 72652feadba560..a7a2e96c61b19f 100644 --- a/deps/icu-small/source/tools/toolutil/uoptions.h +++ b/deps/icu-small/source/tools/toolutil/uoptions.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uoptions.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/uparse.c b/deps/icu-small/source/tools/toolutil/uparse.cpp similarity index 98% rename from deps/icu-small/source/tools/toolutil/uparse.c rename to deps/icu-small/source/tools/toolutil/uparse.cpp index a7142c3cba6cde..a932c171246435 100644 --- a/deps/icu-small/source/tools/toolutil/uparse.c +++ b/deps/icu-small/source/tools/toolutil/uparse.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uparse.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -77,7 +77,7 @@ u_parseDelimitedFile(const char *filename, char delimiter, UParseLineFn *lineFn, void *context, UErrorCode *pErrorCode) { FileStream *file; - char line[300]; + char line[10000]; char *start, *limit; int32_t i, length; @@ -163,7 +163,7 @@ u_parseDelimitedFile(const char *filename, char delimiter, } } - /* error in a field function? */ + /* too few fields? */ if(U_FAILURE(*pErrorCode)) { break; } diff --git a/deps/icu-small/source/tools/toolutil/uparse.h b/deps/icu-small/source/tools/toolutil/uparse.h index 5ad766cf104c85..df0e79a21fa644 100644 --- a/deps/icu-small/source/tools/toolutil/uparse.h +++ b/deps/icu-small/source/tools/toolutil/uparse.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: uparse.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/writesrc.c b/deps/icu-small/source/tools/toolutil/writesrc.cpp similarity index 98% rename from deps/icu-small/source/tools/toolutil/writesrc.c rename to deps/icu-small/source/tools/toolutil/writesrc.cpp index e3f14f2c46e377..c05a07acd3aa34 100644 --- a/deps/icu-small/source/tools/toolutil/writesrc.c +++ b/deps/icu-small/source/tools/toolutil/writesrc.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: writesrc.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -74,7 +74,7 @@ U_CAPI FILE * U_EXPORT2 usrc_create(const char *path, const char *filename, const char *generator) { // TODO: Add parameter for the first year this file was generated, not before 2016. static const char *header= - "// Copyright (C) 2016 and later: Unicode, Inc. and others.\n" + "// © 2016 and later: Unicode, Inc. and others.\n" "// License & terms of use: http://www.unicode.org/copyright.html\n" "//\n" "// Copyright (C) 1999-2016, International Business Machines\n" diff --git a/deps/icu-small/source/tools/toolutil/writesrc.h b/deps/icu-small/source/tools/toolutil/writesrc.h index c82bf3c3345edd..fdcf1f9a6b40f3 100644 --- a/deps/icu-small/source/tools/toolutil/writesrc.h +++ b/deps/icu-small/source/tools/toolutil/writesrc.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: writesrc.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/tools/toolutil/xmlparser.cpp b/deps/icu-small/source/tools/toolutil/xmlparser.cpp index 2fc6e1f78c21b1..ae7ef170207cf5 100644 --- a/deps/icu-small/source/tools/toolutil/xmlparser.cpp +++ b/deps/icu-small/source/tools/toolutil/xmlparser.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: xmlparser.cpp -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -209,7 +209,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) { goto exit; } - buffer=src.getBuffer(bytesLength); + buffer=toUCharPtr(src.getBuffer(bytesLength)); if(buffer==NULL) { // unexpected failure to reserve some string capacity errorCode=U_MEMORY_ALLOCATION_ERROR; @@ -278,7 +278,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) { pb=bytes; for(;;) { length=src.length(); - buffer=src.getBuffer(capacity); + buffer=toUCharPtr(src.getBuffer(capacity)); if(buffer==NULL) { // unexpected failure to reserve some string capacity errorCode=U_MEMORY_ALLOCATION_ERROR; diff --git a/deps/icu-small/source/tools/toolutil/xmlparser.h b/deps/icu-small/source/tools/toolutil/xmlparser.h index 5c08903f86ac1a..72f7ec8fa84645 100644 --- a/deps/icu-small/source/tools/toolutil/xmlparser.h +++ b/deps/icu-small/source/tools/toolutil/xmlparser.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: xmlparser.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/uv/.mailmap b/deps/uv/.mailmap index 500c2b5185c5e8..da4214365c4155 100644 --- a/deps/uv/.mailmap +++ b/deps/uv/.mailmap @@ -26,6 +26,7 @@ Marc Schlaich Michael Michael Neumann Nicholas Vavilov +Nick Logan Rasmus Christian Pedersen Rasmus Christian Pedersen Robert Mustacchi diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index 4747c06b30600f..03255534fa1de3 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -315,3 +315,6 @@ darobs Zheng, Lei Carlo Marcelo Arenas Belón Scott Parker +Wade Brainerd +rayrase +Pekka Nikander diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index 64b18695e16847..595b3871278898 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,55 @@ +2017.11.11, Version 1.16.1 (Stable), 4056fbe46493ef87237e307e0025e551db875e13 + +Changes since version 1.16.0: + +* unix: move net/if.h include (cjihrig) + +* win: fix undeclared NDIS_IF_MAX_STRING_SIZE (Nick Logan) + + +2017.11.07, Version 1.16.0 (Stable), d68779f0ea742918f653b9c20237460271c39aeb + +Changes since version 1.15.0: + +* win: change st_blksize from `2048` to `4096` (Joran Dirk Greef) + +* unix,win: add fs open flags, map O_DIRECT|O_DSYNC (Joran Dirk Greef) + +* win, fs: fix non-symlink reparse points (Wade Brainerd) + +* test: fix -Wstrict-prototypes warnings (Ben Noordhuis) + +* unix, windows: map ENOTTY errno (Ben Noordhuis) + +* unix: fall back to fsync() if F_FULLFSYNC fails (Joran Dirk Greef) + +* unix: do not close invalid kqueue fd after fork (jBarz) + +* zos: reset epoll data after fork (jBarz) + +* zos: skip fork_threadpool_queue_work_simple (jBarz) + +* test: keep platform_output as first test (Bartosz Sosnowski) + +* win: fix non-English dlopen error message (Bartosz Sosnowski) + +* unix,win: add uv_os_getppid() (cjihrig) + +* test: fix const qualification compiler warning (Ben Noordhuis) + +* doc: mark uv_default_loop() as not thread safe (rayrase) + +* win, pipe: null-initialize stream->shutdown_req (Jameson Nash) + +* tty, win: get SetWinEventHook pointer at startup (Bartosz Sosnowski) + +* test: no extra new line in skipped test output (Bartosz Sosnowski) + +* pipe: allow access from other users (Bartosz Sosnowski) + +* unix,win: add uv_if_{indextoname,indextoiid} (Pekka Nikander) + + 2017.10.03, Version 1.15.0 (Stable), 8b69ce1419d2958011d415a636810705c36c2cc2 Changes since version 1.14.1: diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am index b94fdd63b58eea..6e548a69c374e6 100644 --- a/deps/uv/Makefile.am +++ b/deps/uv/Makefile.am @@ -212,6 +212,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-pipe-server-close.c \ test/test-pipe-close-stdout-read-stdin.c \ test/test-pipe-set-non-blocking.c \ + test/test-pipe-set-fchmod.c \ test/test-platform-output.c \ test/test-poll.c \ test/test-poll-close.c \ diff --git a/deps/uv/appveyor.yml b/deps/uv/appveyor.yml index f519bc099b6220..8ad69718b6e619 100644 --- a/deps/uv/appveyor.yml +++ b/deps/uv/appveyor.yml @@ -1,4 +1,4 @@ -version: v1.15.0.build{build} +version: v1.16.1.build{build} init: - git config --global core.autocrlf true diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index ebf5bc3d8ef9e5..5fc0f72434d92e 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.15.0], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.16.1], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst index 2db915bc9e6706..f46c4e761a5d2f 100644 --- a/deps/uv/docs/src/fs.rst +++ b/deps/uv/docs/src/fs.rst @@ -353,3 +353,154 @@ Helper functions any attempts to close it or to use it after closing the fd may lead to malfunction. .. versionadded:: 1.12.0 + +File open constants +------------------- + +.. c:macro:: UV_FS_O_APPEND + + The file is opened in append mode. Before each write, the file offset is + positioned at the end of the file. + +.. c:macro:: UV_FS_O_CREAT + + The file is created if it does not already exist. + +.. c:macro:: UV_FS_O_DIRECT + + File I/O is done directly to and from user-space buffers, which must be + aligned. Buffer size and address should be a multiple of the physical sector + size of the block device. + + .. note:: + `UV_FS_O_DIRECT` is supported on Linux, and on Windows via + `FILE_FLAG_NO_BUFFERING `_. + `UV_FS_O_DIRECT` is not supported on macOS. + +.. c:macro:: UV_FS_O_DIRECTORY + + If the path is not a directory, fail the open. + + .. note:: + `UV_FS_O_DIRECTORY` is not supported on Windows. + +.. c:macro:: UV_FS_O_DSYNC + + The file is opened for synchronous I/O. Write operations will complete once + all data and a minimum of metadata are flushed to disk. + + .. note:: + `UV_FS_O_DSYNC` is supported on Windows via + `FILE_FLAG_WRITE_THROUGH `_. + +.. c:macro:: UV_FS_O_EXCL + + If the `O_CREAT` flag is set and the file already exists, fail the open. + + .. note:: + In general, the behavior of `O_EXCL` is undefined if it is used without + `O_CREAT`. There is one exception: on Linux 2.6 and later, `O_EXCL` can + be used without `O_CREAT` if pathname refers to a block device. If the + block device is in use by the system (e.g., mounted), the open will fail + with the error `EBUSY`. + +.. c:macro:: UV_FS_O_EXLOCK + + Atomically obtain an exclusive lock. + + .. note:: + `UV_FS_O_EXLOCK` is only supported on macOS. + +.. c:macro:: UV_FS_O_NOATIME + + Do not update the file access time when the file is read. + + .. note:: + `UV_FS_O_NOATIME` is not supported on Windows. + +.. c:macro:: UV_FS_O_NOCTTY + + If the path identifies a terminal device, opening the path will not cause + that terminal to become the controlling terminal for the process (if the + process does not already have one). + + .. note:: + `UV_FS_O_NOCTTY` is not supported on Windows. + +.. c:macro:: UV_FS_O_NOFOLLOW + + If the path is a symbolic link, fail the open. + + .. note:: + `UV_FS_O_NOFOLLOW` is not supported on Windows. + +.. c:macro:: UV_FS_O_NONBLOCK + + Open the file in nonblocking mode if possible. + + .. note:: + `UV_FS_O_NONBLOCK` is not supported on Windows. + +.. c:macro:: UV_FS_O_RANDOM + + Access is intended to be random. The system can use this as a hint to + optimize file caching. + + .. note:: + `UV_FS_O_RANDOM` is only supported on Windows via + `FILE_FLAG_RANDOM_ACCESS `_. + +.. c:macro:: UV_FS_O_RDONLY + + Open the file for read-only access. + +.. c:macro:: UV_FS_O_RDWR + + Open the file for read-write access. + +.. c:macro:: UV_FS_O_SEQUENTIAL + + Access is intended to be sequential from beginning to end. The system can + use this as a hint to optimize file caching. + + .. note:: + `UV_FS_O_SEQUENTIAL` is only supported on Windows via + `FILE_FLAG_SEQUENTIAL_SCAN `_. + +.. c:macro:: UV_FS_O_SHORT_LIVED + + The file is temporary and should not be flushed to disk if possible. + + .. note:: + `UV_FS_O_SHORT_LIVED` is only supported on Windows via + `FILE_ATTRIBUTE_TEMPORARY `_. + +.. c:macro:: UV_FS_O_SYMLINK + + Open the symbolic link itself rather than the resource it points to. + +.. c:macro:: UV_FS_O_SYNC + + The file is opened for synchronous I/O. Write operations will complete once + all data and all metadata are flushed to disk. + + .. note:: + `UV_FS_O_SYNC` is supported on Windows via + `FILE_FLAG_WRITE_THROUGH `_. + +.. c:macro:: UV_FS_O_TEMPORARY + + The file is temporary and should not be flushed to disk if possible. + + .. note:: + `UV_FS_O_TEMPORARY` is only supported on Windows via + `FILE_ATTRIBUTE_TEMPORARY `_. + +.. c:macro:: UV_FS_O_TRUNC + + If the file exists and is a regular file, and the file is opened + successfully for write access, its length shall be truncated to zero. + +.. c:macro:: UV_FS_O_WRONLY + + Open the file for write-only access. diff --git a/deps/uv/docs/src/loop.rst b/deps/uv/docs/src/loop.rst index 02543171de488b..c63f813993ff4b 100644 --- a/deps/uv/docs/src/loop.rst +++ b/deps/uv/docs/src/loop.rst @@ -86,6 +86,9 @@ API should) be closed with :c:func:`uv_loop_close` so the resources associated with it are freed. + .. warning:: + This function is not thread safe. + .. c:function:: int uv_run(uv_loop_t* loop, uv_run_mode mode) This function runs the event loop. It will act differently depending on the diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index 3fea708a8d38e2..2968d1cea1cc2b 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -59,6 +59,12 @@ Data types Abstract representation of a file descriptor. On Unix systems this is a `typedef` of `int` and on Windows a `HANDLE`. +.. c:type:: uv_pid_t + + Cross platform representation of a `pid_t`. + + .. versionadded:: 1.16.0 + .. c:type:: uv_rusage_t Data type for resource usage results. @@ -221,6 +227,12 @@ API On Windows not all fields are set, the unsupported fields are filled with zeroes. See :c:type:`uv_rusage_t` for more details. +.. c:function:: uv_pid_t uv_os_getppid(void) + + Returns the parent process ID. + + .. versionadded:: 1.16.0 + .. c:function:: int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) Gets information about the CPUs on the system. The `cpu_infos` array will @@ -271,6 +283,60 @@ API and :man:`inet_pton(3)`. On success they return 0. In case of error the target `dst` pointer is unmodified. +.. c:macro:: UV_IF_NAMESIZE + + Maximum IPv6 interface identifier name length. Defined as + `IFNAMSIZ` on Unix and `IF_NAMESIZE` on Linux and Windows. + + .. versionadded:: 1.16.0 + +.. c:function:: int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) + + IPv6-capable implementation of :man:`if_indextoname(3)`. When called, + `*size` indicates the length of the `buffer`, which is used to store the + result. + On success, zero is returned, `buffer` contains the interface name, and + `*size` represents the string length of the `buffer`, excluding the NUL + terminator byte from `*size`. On error, a negative result is + returned. If `buffer` is not large enough to hold the result, + `UV_ENOBUFS` is returned, and `*size` represents the necessary size in + bytes, including the NUL terminator byte into the `*size`. + + On Unix, the returned interface name can be used directly as an + interface identifier in scoped IPv6 addresses, e.g. + `fe80::abc:def1:2345%en0`. + + On Windows, the returned interface cannot be used as an interface + identifier, as Windows uses numerical interface identifiers, e.g. + `fe80::abc:def1:2345%5`. + + To get an interface identifier in a cross-platform compatible way, + use `uv_if_indextoiid()`. + + Example: + + :: + + char ifname[UV_IF_NAMESIZE]; + size_t size = sizeof(ifname); + uv_if_indextoname(sin6->sin6_scope_id, ifname, &size); + + .. versionadded:: 1.16.0 + +.. c:function:: int uv_if_indextoiid(unsigned int ifindex, char* buffer, size_t* size) + + Retrieves a network interface identifier suitable for use in an IPv6 scoped + address. On Windows, returns the numeric `ifindex` as a string. On all other + platforms, `uv_if_indextoname()` is called. The result is written to + `buffer`, with `*size` indicating the length of `buffer`. If `buffer` is not + large enough to hold the result, then `UV_ENOBUFS` is returned, and `*size` + represents the size, including the NUL byte, required to hold the + result. + + See `uv_if_indextoname` for further details. + + .. versionadded:: 1.16.0 + .. c:function:: int uv_exepath(char* buffer, size_t* size) Gets the executable path. diff --git a/deps/uv/docs/src/pipe.rst b/deps/uv/docs/src/pipe.rst index d33b0f2b977b5b..bdaeeba9d435d5 100644 --- a/deps/uv/docs/src/pipe.rst +++ b/deps/uv/docs/src/pipe.rst @@ -102,3 +102,12 @@ API and call ``uv_accept(pipe, handle)``. .. seealso:: The :c:type:`uv_stream_t` API functions also apply. + +.. c:function:: int uv_pipe_chmod(uv_pipe_t* handle, int flags) + + Alters pipe permissions, allowing it to be accessed from processes run by + different users. Makes the pipe writable or readable by all users. Mode can + be ``UV_WRITABLE``, ``UV_READABLE`` or ``UV_WRITABLE | UV_READABLE``. This + function is blocking. + + .. versionadded:: 1.16.0 diff --git a/deps/uv/include/uv-errno.h b/deps/uv/include/uv-errno.h index 32bbc5177e4b2d..8a415331479873 100644 --- a/deps/uv/include/uv-errno.h +++ b/deps/uv/include/uv-errno.h @@ -422,4 +422,10 @@ # define UV__EREMOTEIO (-4030) #endif +#if defined(ENOTTY) && !defined(_WIN32) +# define UV__ENOTTY (-ENOTTY) +#else +# define UV__ENOTTY (-4029) +#endif + #endif /* UV_ERRNO_H_ */ diff --git a/deps/uv/include/uv-unix.h b/deps/uv/include/uv-unix.h index d7754509b1e27b..6565ff441ef292 100644 --- a/deps/uv/include/uv-unix.h +++ b/deps/uv/include/uv-unix.h @@ -123,6 +123,7 @@ typedef struct uv_buf_t { typedef int uv_file; typedef int uv_os_sock_t; typedef int uv_os_fd_t; +typedef pid_t uv_pid_t; #define UV_ONCE_INIT PTHREAD_ONCE_INIT @@ -365,4 +366,97 @@ typedef struct { uv_fs_event_cb cb; \ UV_PLATFORM_FS_EVENT_FIELDS \ +/* fs open() flags supported on this platform: */ +#if defined(O_APPEND) +# define UV_FS_O_APPEND O_APPEND +#else +# define UV_FS_O_APPEND 0 +#endif +#if defined(O_CREAT) +# define UV_FS_O_CREAT O_CREAT +#else +# define UV_FS_O_CREAT 0 +#endif +#if defined(O_DIRECT) +# define UV_FS_O_DIRECT O_DIRECT +#else +# define UV_FS_O_DIRECT 0 +#endif +#if defined(O_DIRECTORY) +# define UV_FS_O_DIRECTORY O_DIRECTORY +#else +# define UV_FS_O_DIRECTORY 0 +#endif +#if defined(O_DSYNC) +# define UV_FS_O_DSYNC O_DSYNC +#else +# define UV_FS_O_DSYNC 0 +#endif +#if defined(O_EXCL) +# define UV_FS_O_EXCL O_EXCL +#else +# define UV_FS_O_EXCL 0 +#endif +#if defined(O_EXLOCK) +# define UV_FS_O_EXLOCK O_EXLOCK +#else +# define UV_FS_O_EXLOCK 0 +#endif +#if defined(O_NOATIME) +# define UV_FS_O_NOATIME O_NOATIME +#else +# define UV_FS_O_NOATIME 0 +#endif +#if defined(O_NOCTTY) +# define UV_FS_O_NOCTTY O_NOCTTY +#else +# define UV_FS_O_NOCTTY 0 +#endif +#if defined(O_NOFOLLOW) +# define UV_FS_O_NOFOLLOW O_NOFOLLOW +#else +# define UV_FS_O_NOFOLLOW 0 +#endif +#if defined(O_NONBLOCK) +# define UV_FS_O_NONBLOCK O_NONBLOCK +#else +# define UV_FS_O_NONBLOCK 0 +#endif +#if defined(O_RDONLY) +# define UV_FS_O_RDONLY O_RDONLY +#else +# define UV_FS_O_RDONLY 0 +#endif +#if defined(O_RDWR) +# define UV_FS_O_RDWR O_RDWR +#else +# define UV_FS_O_RDWR 0 +#endif +#if defined(O_SYMLINK) +# define UV_FS_O_SYMLINK O_SYMLINK +#else +# define UV_FS_O_SYMLINK 0 +#endif +#if defined(O_SYNC) +# define UV_FS_O_SYNC O_SYNC +#else +# define UV_FS_O_SYNC 0 +#endif +#if defined(O_TRUNC) +# define UV_FS_O_TRUNC O_TRUNC +#else +# define UV_FS_O_TRUNC 0 +#endif +#if defined(O_WRONLY) +# define UV_FS_O_WRONLY O_WRONLY +#else +# define UV_FS_O_WRONLY 0 +#endif + +/* fs open() flags supported on other platforms: */ +#define UV_FS_O_RANDOM 0 +#define UV_FS_O_SHORT_LIVED 0 +#define UV_FS_O_SEQUENTIAL 0 +#define UV_FS_O_TEMPORARY 0 + #endif /* UV_UNIX_H */ diff --git a/deps/uv/include/uv-version.h b/deps/uv/include/uv-version.h index 55d7c91055c3ea..1c9113cdc9f7ee 100644 --- a/deps/uv/include/uv-version.h +++ b/deps/uv/include/uv-version.h @@ -31,8 +31,8 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 15 -#define UV_VERSION_PATCH 0 +#define UV_VERSION_MINOR 16 +#define UV_VERSION_PATCH 1 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/include/uv-win.h b/deps/uv/include/uv-win.h index 9677ff164b71e0..be150fc482f92e 100644 --- a/deps/uv/include/uv-win.h +++ b/deps/uv/include/uv-win.h @@ -222,6 +222,7 @@ typedef struct uv_buf_t { typedef int uv_file; typedef SOCKET uv_os_sock_t; typedef HANDLE uv_os_fd_t; +typedef int uv_pid_t; typedef HANDLE uv_thread_t; @@ -648,3 +649,28 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s); #ifndef X_OK #define X_OK 1 #endif + +/* fs open() flags supported on this platform: */ +#define UV_FS_O_APPEND _O_APPEND +#define UV_FS_O_CREAT _O_CREAT +#define UV_FS_O_EXCL _O_EXCL +#define UV_FS_O_RANDOM _O_RANDOM +#define UV_FS_O_RDONLY _O_RDONLY +#define UV_FS_O_RDWR _O_RDWR +#define UV_FS_O_SEQUENTIAL _O_SEQUENTIAL +#define UV_FS_O_SHORT_LIVED _O_SHORT_LIVED +#define UV_FS_O_TEMPORARY _O_TEMPORARY +#define UV_FS_O_TRUNC _O_TRUNC +#define UV_FS_O_WRONLY _O_WRONLY + +/* fs open() flags supported on other platforms (or mapped on this platform): */ +#define UV_FS_O_DIRECT 0x2000000 /* FILE_FLAG_NO_BUFFERING */ +#define UV_FS_O_DIRECTORY 0 +#define UV_FS_O_DSYNC 0x4000000 /* FILE_FLAG_WRITE_THROUGH */ +#define UV_FS_O_EXLOCK 0 +#define UV_FS_O_NOATIME 0 +#define UV_FS_O_NOCTTY 0 +#define UV_FS_O_NOFOLLOW 0 +#define UV_FS_O_NONBLOCK 0 +#define UV_FS_O_SYMLINK 0 +#define UV_FS_O_SYNC 0x8000000 /* FILE_FLAG_WRITE_THROUGH */ diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index 0e4151d1389582..3f61812081da5e 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -141,6 +141,7 @@ extern "C" { XX(EMLINK, "too many links") \ XX(EHOSTDOWN, "host is down") \ XX(EREMOTEIO, "remote I/O error") \ + XX(ENOTTY, "inappropriate ioctl for device") \ #define UV_HANDLE_TYPE_MAP(XX) \ XX(ASYNC, async) \ @@ -709,6 +710,7 @@ UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle, UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count); UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle); UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle); +UV_EXTERN int uv_pipe_chmod(uv_pipe_t* handle, int flags); struct uv_poll_s { @@ -1068,6 +1070,7 @@ UV_EXTERN int uv_os_homedir(char* buffer, size_t* size); UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size); UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd); UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd); +UV_EXTERN uv_pid_t uv_os_getppid(void); UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count); UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count); @@ -1405,6 +1408,21 @@ UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size); UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst); +#if defined(IF_NAMESIZE) +# define UV_IF_NAMESIZE (IF_NAMESIZE + 1) +#elif defined(IFNAMSIZ) +# define UV_IF_NAMESIZE (IFNAMSIZ + 1) +#else +# define UV_IF_NAMESIZE (16 + 1) +#endif + +UV_EXTERN int uv_if_indextoname(unsigned int ifindex, + char* buffer, + size_t* size); +UV_EXTERN int uv_if_indextoiid(unsigned int ifindex, + char* buffer, + size_t* size); + UV_EXTERN int uv_exepath(char* buffer, size_t* size); UV_EXTERN int uv_cwd(char* buffer, size_t* size); diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index ef82ee27b8568f..d64593a3134729 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -1343,3 +1343,8 @@ int uv_os_gethostname(char* buffer, size_t* size) { uv_os_fd_t uv_get_osfhandle(int fd) { return fd; } + + +uv_pid_t uv_os_getppid(void) { + return getppid(); +} diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index 2684c814a2b1d8..e0969a4c2f3d91 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -132,26 +132,33 @@ while (0) -static ssize_t uv__fs_fdatasync(uv_fs_t* req) { -#if defined(__linux__) || defined(__sun) || defined(__NetBSD__) - return fdatasync(req->file); -#elif defined(__APPLE__) +static ssize_t uv__fs_fsync(uv_fs_t* req) { +#if defined(__APPLE__) /* Apple's fdatasync and fsync explicitly do NOT flush the drive write cache * to the drive platters. This is in contrast to Linux's fdatasync and fsync * which do, according to recent man pages. F_FULLFSYNC is Apple's equivalent - * for flushing buffered data to permanent storage. + * for flushing buffered data to permanent storage. If F_FULLFSYNC is not + * supported by the file system we should fall back to fsync(). This is the + * same approach taken by sqlite. */ - return fcntl(req->file, F_FULLFSYNC); + int r; + + r = fcntl(req->file, F_FULLFSYNC); + if (r != 0 && errno == ENOTTY) + r = fsync(req->file); + return r; #else return fsync(req->file); #endif } -static ssize_t uv__fs_fsync(uv_fs_t* req) { -#if defined(__APPLE__) - /* See the comment in uv__fs_fdatasync. */ - return fcntl(req->file, F_FULLFSYNC); +static ssize_t uv__fs_fdatasync(uv_fs_t* req) { +#if defined(__linux__) || defined(__sun) || defined(__NetBSD__) + return fdatasync(req->file); +#elif defined(__APPLE__) + /* See the comment in uv__fs_fsync. */ + return uv__fs_fsync(req); #else return fsync(req->file); #endif diff --git a/deps/uv/src/unix/getaddrinfo.c b/deps/uv/src/unix/getaddrinfo.c index 2049aea2f38fd8..0185971697a95d 100644 --- a/deps/uv/src/unix/getaddrinfo.c +++ b/deps/uv/src/unix/getaddrinfo.c @@ -32,6 +32,7 @@ #include /* NULL */ #include #include +#include /* if_indextoname() */ /* EAI_* constants. */ #include @@ -200,3 +201,32 @@ void uv_freeaddrinfo(struct addrinfo* ai) { if (ai) freeaddrinfo(ai); } + + +int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) { + char ifname_buf[UV_IF_NAMESIZE]; + size_t len; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + if (if_indextoname(ifindex, ifname_buf) == NULL) + return -errno; + + len = strnlen(ifname_buf, sizeof(ifname_buf)); + + if (*size <= len) { + *size = len + 1; + return UV_ENOBUFS; + } + + memcpy(buffer, ifname_buf, len); + buffer[len] = '\0'; + *size = len; + + return 0; +} + +int uv_if_indextoiid(unsigned int ifindex, char* buffer, size_t* size) { + return uv_if_indextoname(ifindex, buffer, size); +} diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c index c9adddbdb8722a..5e89bdced4e5f3 100644 --- a/deps/uv/src/unix/kqueue.c +++ b/deps/uv/src/unix/kqueue.c @@ -65,7 +65,6 @@ static int uv__has_forked_with_cfrunloop; int uv__io_fork(uv_loop_t* loop) { int err; - uv__close(loop->backend_fd); loop->backend_fd = -1; err = uv__kqueue_init(loop); if (err) diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c index bcd49242cea2bc..5b5b0e095bbc2f 100644 --- a/deps/uv/src/unix/loop.c +++ b/deps/uv/src/unix/loop.c @@ -31,7 +31,6 @@ int uv_loop_init(uv_loop_t* loop) { void* saved_data; int err; - uv__signal_global_once_init(); saved_data = loop->data; memset(loop, 0, sizeof(*loop)); @@ -68,6 +67,7 @@ int uv_loop_init(uv_loop_t* loop) { if (err) return err; + uv__signal_global_once_init(); err = uv_signal_init(loop, &loop->child_watcher); if (err) goto fail_signal_init; diff --git a/deps/uv/src/unix/os390-syscalls.c b/deps/uv/src/unix/os390-syscalls.c index ca539c26f7b447..86c6852b4b608c 100644 --- a/deps/uv/src/unix/os390-syscalls.c +++ b/deps/uv/src/unix/os390-syscalls.c @@ -120,10 +120,41 @@ static void maybe_resize(uv__os390_epoll* lst, unsigned int len) { } +static void before_fork(void) { + uv_mutex_lock(&global_epoll_lock); +} + + +static void after_fork(void) { + uv_mutex_unlock(&global_epoll_lock); +} + + +static void child_fork(void) { + QUEUE* q; + uv_once_t child_once = UV_ONCE_INIT; + + /* reset once */ + memcpy(&once, &child_once, sizeof(child_once)); + + /* reset epoll list */ + while (!QUEUE_EMPTY(&global_epoll_queue)) { + q = QUEUE_HEAD(&global_epoll_queue); + QUEUE_REMOVE(q); + } + + uv_mutex_unlock(&global_epoll_lock); + uv_mutex_destroy(&global_epoll_lock); +} + + static void epoll_init(void) { QUEUE_INIT(&global_epoll_queue); if (uv_mutex_init(&global_epoll_lock)) abort(); + + if (pthread_atfork(&before_fork, &after_fork, &child_fork)) + abort(); } diff --git a/deps/uv/src/unix/pipe.c b/deps/uv/src/unix/pipe.c index 4a812955b0d1de..ac7cfb46a927fa 100644 --- a/deps/uv/src/unix/pipe.c +++ b/deps/uv/src/unix/pipe.c @@ -302,3 +302,56 @@ uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle) { else return uv__handle_type(handle->accepted_fd); } + + +int uv_pipe_chmod(uv_pipe_t* handle, int mode) { + unsigned desired_mode; + struct stat pipe_stat; + char* name_buffer; + size_t name_len; + int r; + + if (handle == NULL || uv__stream_fd(handle) == -1) + return -EBADF; + + if (mode != UV_READABLE && + mode != UV_WRITABLE && + mode != (UV_WRITABLE | UV_READABLE)) + return -EINVAL; + + if (fstat(uv__stream_fd(handle), &pipe_stat) == -1) + return -errno; + + desired_mode = 0; + if (mode & UV_READABLE) + desired_mode |= S_IRUSR | S_IRGRP | S_IROTH; + if (mode & UV_WRITABLE) + desired_mode |= S_IWUSR | S_IWGRP | S_IWOTH; + + /* Exit early if pipe already has desired mode. */ + if ((pipe_stat.st_mode & desired_mode) == desired_mode) + return 0; + + pipe_stat.st_mode |= desired_mode; + + /* Unfortunately fchmod does not work on all platforms, we will use chmod. */ + name_len = 0; + r = uv_pipe_getsockname(handle, NULL, &name_len); + if (r != UV_ENOBUFS) + return r; + + name_buffer = uv__malloc(name_len); + if (name_buffer == NULL) + return UV_ENOMEM; + + r = uv_pipe_getsockname(handle, name_buffer, &name_len); + if (r != 0) { + uv__free(name_buffer); + return r; + } + + r = chmod(name_buffer, pipe_stat.st_mode); + uv__free(name_buffer); + + return r != -1 ? 0 : -errno; +} diff --git a/deps/uv/src/win/dl.c b/deps/uv/src/win/dl.c index d454014d8adf6e..97ac1c1ad10012 100644 --- a/deps/uv/src/win/dl.c +++ b/deps/uv/src/win/dl.c @@ -89,9 +89,9 @@ static void uv__format_fallback_error(uv_lib_t* lib, int errorno){ static int uv__dlerror(uv_lib_t* lib, const char* filename, DWORD errorno) { - static const char not_win32_app_msg[] = "%1 is not a valid Win32 application"; DWORD_PTR arg; DWORD res; + char* msg; if (lib->errmsg) { LocalFree(lib->errmsg); @@ -114,16 +114,16 @@ static int uv__dlerror(uv_lib_t* lib, const char* filename, DWORD errorno) { 0, (LPSTR) &lib->errmsg, 0, NULL); } - /* Inexpert hack to get the filename into the error message. */ - if (res && strstr(lib->errmsg, not_win32_app_msg)) { - LocalFree(lib->errmsg); + if (res && errorno == ERROR_BAD_EXE_FORMAT && strstr(lib->errmsg, "%1")) { + msg = lib->errmsg; lib->errmsg = NULL; arg = (DWORD_PTR) filename; res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_FROM_STRING, - not_win32_app_msg, + msg, 0, 0, (LPSTR) &lib->errmsg, 0, (va_list*) &arg); + LocalFree(msg); } if (!res) diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c index c374a82ca01f75..b90eaa7548969a 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -415,21 +415,21 @@ void fs__open(uv_fs_t* req) { umask(current_umask); /* convert flags and mode to CreateFile parameters */ - switch (flags & (_O_RDONLY | _O_WRONLY | _O_RDWR)) { - case _O_RDONLY: + switch (flags & (UV_FS_O_RDONLY | UV_FS_O_WRONLY | UV_FS_O_RDWR)) { + case UV_FS_O_RDONLY: access = FILE_GENERIC_READ; break; - case _O_WRONLY: + case UV_FS_O_WRONLY: access = FILE_GENERIC_WRITE; break; - case _O_RDWR: + case UV_FS_O_RDWR: access = FILE_GENERIC_READ | FILE_GENERIC_WRITE; break; default: goto einval; } - if (flags & _O_APPEND) { + if (flags & UV_FS_O_APPEND) { access &= ~FILE_WRITE_DATA; access |= FILE_APPEND_DATA; } @@ -442,23 +442,23 @@ void fs__open(uv_fs_t* req) { */ share = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; - switch (flags & (_O_CREAT | _O_EXCL | _O_TRUNC)) { + switch (flags & (UV_FS_O_CREAT | UV_FS_O_EXCL | UV_FS_O_TRUNC)) { case 0: - case _O_EXCL: + case UV_FS_O_EXCL: disposition = OPEN_EXISTING; break; - case _O_CREAT: + case UV_FS_O_CREAT: disposition = OPEN_ALWAYS; break; - case _O_CREAT | _O_EXCL: - case _O_CREAT | _O_TRUNC | _O_EXCL: + case UV_FS_O_CREAT | UV_FS_O_EXCL: + case UV_FS_O_CREAT | UV_FS_O_TRUNC | UV_FS_O_EXCL: disposition = CREATE_NEW; break; - case _O_TRUNC: - case _O_TRUNC | _O_EXCL: + case UV_FS_O_TRUNC: + case UV_FS_O_TRUNC | UV_FS_O_EXCL: disposition = TRUNCATE_EXISTING; break; - case _O_CREAT | _O_TRUNC: + case UV_FS_O_CREAT | UV_FS_O_TRUNC: disposition = CREATE_ALWAYS; break; default: @@ -466,34 +466,49 @@ void fs__open(uv_fs_t* req) { } attributes |= FILE_ATTRIBUTE_NORMAL; - if (flags & _O_CREAT) { + if (flags & UV_FS_O_CREAT) { if (!((req->fs.info.mode & ~current_umask) & _S_IWRITE)) { attributes |= FILE_ATTRIBUTE_READONLY; } } - if (flags & _O_TEMPORARY ) { + if (flags & UV_FS_O_TEMPORARY ) { attributes |= FILE_FLAG_DELETE_ON_CLOSE | FILE_ATTRIBUTE_TEMPORARY; access |= DELETE; } - if (flags & _O_SHORT_LIVED) { + if (flags & UV_FS_O_SHORT_LIVED) { attributes |= FILE_ATTRIBUTE_TEMPORARY; } - switch (flags & (_O_SEQUENTIAL | _O_RANDOM)) { + switch (flags & (UV_FS_O_SEQUENTIAL | UV_FS_O_RANDOM)) { case 0: break; - case _O_SEQUENTIAL: + case UV_FS_O_SEQUENTIAL: attributes |= FILE_FLAG_SEQUENTIAL_SCAN; break; - case _O_RANDOM: + case UV_FS_O_RANDOM: attributes |= FILE_FLAG_RANDOM_ACCESS; break; default: goto einval; } + if (flags & UV_FS_O_DIRECT) { + attributes |= FILE_FLAG_NO_BUFFERING; + } + + switch (flags & (UV_FS_O_DSYNC | UV_FS_O_SYNC)) { + case 0: + break; + case UV_FS_O_DSYNC: + case UV_FS_O_SYNC: + attributes |= FILE_FLAG_WRITE_THROUGH; + break; + default: + goto einval; + } + /* Setting this flag makes it possible to open a directory. */ attributes |= FILE_FLAG_BACKUP_SEMANTICS; @@ -506,9 +521,9 @@ void fs__open(uv_fs_t* req) { NULL); if (file == INVALID_HANDLE_VALUE) { DWORD error = GetLastError(); - if (error == ERROR_FILE_EXISTS && (flags & _O_CREAT) && - !(flags & _O_EXCL)) { - /* Special case: when ERROR_FILE_EXISTS happens and O_CREAT was */ + if (error == ERROR_FILE_EXISTS && (flags & UV_FS_O_CREAT) && + !(flags & UV_FS_O_EXCL)) { + /* Special case: when ERROR_FILE_EXISTS happens and UV_FS_O_CREAT was */ /* specified, it means the path referred to a directory. */ SET_REQ_UV_ERROR(req, UV_EISDIR, error); } else { @@ -1070,7 +1085,8 @@ void fs__scandir(uv_fs_t* req) { } -INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { +INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf, + int do_lstat) { FILE_ALL_INFORMATION file_info; FILE_FS_VOLUME_INFORMATION volume_info; NTSTATUS nt_status; @@ -1125,17 +1141,25 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { */ statbuf->st_mode = 0; - if (file_info.BasicInformation.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + /* + * On Windows, FILE_ATTRIBUTE_REPARSE_POINT is a general purpose mechanism + * by which filesystem drivers can intercept and alter file system requests. + * + * The only reparse points we care about are symlinks and mount points, both + * of which are treated as POSIX symlinks. Further, we only care when + * invoked via lstat, which seeks information about the link instead of its + * target. Otherwise, reparse points must be treated as regular files. + */ + if (do_lstat && + (file_info.BasicInformation.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) { /* - * It is possible for a file to have FILE_ATTRIBUTE_REPARSE_POINT but not have - * any link data. In that case DeviceIoControl() in fs__readlink_handle() sets - * the last error to ERROR_NOT_A_REPARSE_POINT. Then the stat result mode - * calculated below will indicate a normal directory or file, as if - * FILE_ATTRIBUTE_REPARSE_POINT was not present. + * If reading the link fails, the reparse point is not a symlink and needs + * to be treated as a regular file. The higher level lstat function will + * detect this failure and retry without do_lstat if appropriate. */ - if (fs__readlink_handle(handle, NULL, &statbuf->st_size) == 0) { - statbuf->st_mode |= S_IFLNK; - } + if (fs__readlink_handle(handle, NULL, &statbuf->st_size) != 0) + return -1; + statbuf->st_mode |= S_IFLNK; } if (statbuf->st_mode == 0) { @@ -1178,8 +1202,12 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { * * Therefore we'll just report a sensible value that's quite commonly okay * on modern hardware. + * + * 4096 is the minimum required to be compatible with newer Advanced Format + * drives (which have 4096 bytes per physical sector), and to be backwards + * compatible with older drives (which have 512 bytes per physical sector). */ - statbuf->st_blksize = 2048; + statbuf->st_blksize = 4096; /* Todo: set st_flags to something meaningful. Also provide a wrapper for * chattr(2). @@ -1230,9 +1258,11 @@ INLINE static void fs__stat_impl(uv_fs_t* req, int do_lstat) { return; } - if (fs__stat_handle(handle, &req->statbuf) != 0) { + if (fs__stat_handle(handle, &req->statbuf, do_lstat) != 0) { DWORD error = GetLastError(); - if (do_lstat && error == ERROR_SYMLINK_NOT_SUPPORTED) { + if (do_lstat && + (error == ERROR_SYMLINK_NOT_SUPPORTED || + error == ERROR_NOT_A_REPARSE_POINT)) { /* We opened a reparse point but it was not a symlink. Try again. */ fs__stat_impl(req, 0); @@ -1276,7 +1306,7 @@ static void fs__fstat(uv_fs_t* req) { return; } - if (fs__stat_handle(handle, &req->statbuf) != 0) { + if (fs__stat_handle(handle, &req->statbuf, 0) != 0) { SET_REQ_WIN32_ERROR(req, GetLastError()); return; } diff --git a/deps/uv/src/win/getaddrinfo.c b/deps/uv/src/win/getaddrinfo.c index baab838898a62e..282d919cf75513 100644 --- a/deps/uv/src/win/getaddrinfo.c +++ b/deps/uv/src/win/getaddrinfo.c @@ -28,6 +28,8 @@ /* EAI_* constants. */ #include +/* Needed for ConvertInterfaceIndexToLuid and ConvertInterfaceLuidToNameA */ +#include int uv__getaddrinfo_translate_error(int sys_err) { switch (sys_err) { @@ -73,6 +75,9 @@ int uv__getaddrinfo_translate_error(int sys_err) { /* Do we need different versions of this for different architectures? */ #define ALIGNED_SIZE(X) ((((X) + 3) >> 2) << 2) +#ifndef NDIS_IF_MAX_STRING_SIZE +#define NDIS_IF_MAX_STRING_SIZE IF_MAX_STRING_SIZE +#endif static void uv__getaddrinfo_work(struct uv__work* w) { uv_getaddrinfo_t* req; @@ -380,3 +385,69 @@ int uv_getaddrinfo(uv_loop_t* loop, } return uv_translate_sys_error(err); } + +int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) { + NET_LUID luid; + wchar_t wname[NDIS_IF_MAX_STRING_SIZE + 1]; /* Add one for the NUL. */ + DWORD bufsize; + int r; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + r = ConvertInterfaceIndexToLuid(ifindex, &luid); + + if (r != 0) + return uv_translate_sys_error(r); + + r = ConvertInterfaceLuidToNameW(&luid, wname, ARRAY_SIZE(wname)); + + if (r != 0) + return uv_translate_sys_error(r); + + /* Check how much space we need */ + bufsize = WideCharToMultiByte(CP_UTF8, 0, wname, -1, NULL, 0, NULL, NULL); + + if (bufsize == 0) { + return uv_translate_sys_error(GetLastError()); + } else if (bufsize > *size) { + *size = bufsize; + return UV_ENOBUFS; + } + + /* Convert to UTF-8 */ + bufsize = WideCharToMultiByte(CP_UTF8, + 0, + wname, + -1, + buffer, + *size, + NULL, + NULL); + + if (bufsize == 0) + return uv_translate_sys_error(GetLastError()); + + *size = bufsize - 1; + return 0; +} + +int uv_if_indextoiid(unsigned int ifindex, char* buffer, size_t* size) { + int r; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + r = snprintf(buffer, *size, "%d", ifindex); + + if (r < 0) + return uv_translate_sys_error(r); + + if (r >= (int) *size) { + *size = r + 1; + return UV_ENOBUFS; + } + + *size = r; + return 0; +} diff --git a/deps/uv/src/win/internal.h b/deps/uv/src/win/internal.h index 444327d647f284..217fcdb5d7678e 100644 --- a/deps/uv/src/win/internal.h +++ b/deps/uv/src/win/internal.h @@ -326,7 +326,6 @@ void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle); void uv__util_init(void); uint64_t uv__hrtime(double scale); -int uv_parent_pid(void); int uv_current_pid(void); __declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall); int uv__getpwuid_r(uv_passwd_t* pwd); diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c index 5c666788fd67f5..642213bc8886c2 100644 --- a/deps/uv/src/win/pipe.c +++ b/deps/uv/src/win/pipe.c @@ -31,6 +31,9 @@ #include "stream-inl.h" #include "req-inl.h" +#include +#include + typedef struct uv__ipc_queue_item_s uv__ipc_queue_item_t; struct uv__ipc_queue_item_s { @@ -202,7 +205,7 @@ int uv_stdio_pipe_server(uv_loop_t* loop, uv_pipe_t* handle, DWORD access, uv_unique_pipe_name(ptr, name, nameSize); pipeHandle = CreateNamedPipeA(name, - access | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE, + access | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 65536, 65536, 0, NULL); @@ -534,7 +537,7 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) { */ handle->pipe.serv.accept_reqs[0].pipeHandle = CreateNamedPipeW(handle->name, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | - FILE_FLAG_FIRST_PIPE_INSTANCE, + FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 65536, 65536, 0, NULL); @@ -803,7 +806,7 @@ static void uv_pipe_queue_accept(uv_loop_t* loop, uv_pipe_t* handle, assert(req->pipeHandle == INVALID_HANDLE_VALUE); req->pipeHandle = CreateNamedPipeW(handle->name, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | WRITE_DAC, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 65536, 65536, 0, NULL); @@ -1969,7 +1972,7 @@ int uv_pipe_open(uv_pipe_t* pipe, uv_file file) { if (pipe->ipc) { assert(!(pipe->flags & UV_HANDLE_NON_OVERLAPPED_PIPE)); - pipe->pipe.conn.ipc_pid = uv_parent_pid(); + pipe->pipe.conn.ipc_pid = uv_os_getppid(); assert(pipe->pipe.conn.ipc_pid != -1); } return 0; @@ -2132,3 +2135,80 @@ uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle) { else return UV_TCP; } + +int uv_pipe_chmod(uv_pipe_t* handle, int mode) { + SID_IDENTIFIER_AUTHORITY sid_world = SECURITY_WORLD_SID_AUTHORITY; + PACL old_dacl, new_dacl; + PSECURITY_DESCRIPTOR sd; + EXPLICIT_ACCESS ea; + PSID everyone; + int error; + + if (handle == NULL || handle->handle == INVALID_HANDLE_VALUE) + return UV_EBADF; + + if (mode != UV_READABLE && + mode != UV_WRITABLE && + mode != (UV_WRITABLE | UV_READABLE)) + return UV_EINVAL; + + if (!AllocateAndInitializeSid(&sid_world, + 1, + SECURITY_WORLD_RID, + 0, 0, 0, 0, 0, 0, 0, + &everyone)) { + error = GetLastError(); + goto done; + } + + if (GetSecurityInfo(handle->handle, + SE_KERNEL_OBJECT, + DACL_SECURITY_INFORMATION, + NULL, + NULL, + &old_dacl, + NULL, + &sd)) { + error = GetLastError(); + goto clean_sid; + } + + memset(&ea, 0, sizeof(EXPLICIT_ACCESS)); + if (mode & UV_READABLE) + ea.grfAccessPermissions |= GENERIC_READ | FILE_WRITE_ATTRIBUTES; + if (mode & UV_WRITABLE) + ea.grfAccessPermissions |= GENERIC_WRITE | FILE_READ_ATTRIBUTES; + ea.grfAccessPermissions |= SYNCHRONIZE; + ea.grfAccessMode = SET_ACCESS; + ea.grfInheritance = NO_INHERITANCE; + ea.Trustee.TrusteeForm = TRUSTEE_IS_SID; + ea.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; + ea.Trustee.ptstrName = (LPTSTR)everyone; + + if (SetEntriesInAcl(1, &ea, old_dacl, &new_dacl)) { + error = GetLastError(); + goto clean_sd; + } + + if (SetSecurityInfo(handle->handle, + SE_KERNEL_OBJECT, + DACL_SECURITY_INFORMATION, + NULL, + NULL, + new_dacl, + NULL)) { + error = GetLastError(); + goto clean_dacl; + } + + error = 0; + +clean_dacl: + LocalFree((HLOCAL) new_dacl); +clean_sd: + LocalFree((HLOCAL) sd); +clean_sid: + FreeSid(everyone); +done: + return uv_translate_sys_error(error); +} diff --git a/deps/uv/src/win/stream-inl.h b/deps/uv/src/win/stream-inl.h index bf12148afe1605..dba03747043be7 100644 --- a/deps/uv/src/win/stream-inl.h +++ b/deps/uv/src/win/stream-inl.h @@ -36,6 +36,7 @@ INLINE static void uv_stream_init(uv_loop_t* loop, uv__handle_init(loop, (uv_handle_t*) handle, type); handle->write_queue_size = 0; handle->activecnt = 0; + handle->stream.conn.shutdown_req = NULL; } @@ -47,8 +48,6 @@ INLINE static void uv_connection_init(uv_stream_t* handle) { handle->read_req.event_handle = NULL; handle->read_req.wait_handle = INVALID_HANDLE_VALUE; handle->read_req.data = handle; - - handle->stream.conn.shutdown_req = NULL; } diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index a2acda1152f663..2aec9f8dfe3e2b 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -331,7 +331,7 @@ uint64_t uv_get_total_memory(void) { } -int uv_parent_pid(void) { +uv_pid_t uv_os_getppid(void) { int parent_pid = -1; HANDLE handle; PROCESSENTRY32 pe; diff --git a/deps/uv/test/benchmark-pump.c b/deps/uv/test/benchmark-pump.c index 88f2dc5c658e27..8685258e052793 100644 --- a/deps/uv/test/benchmark-pump.c +++ b/deps/uv/test/benchmark-pump.c @@ -36,9 +36,9 @@ static int TARGET_CONNECTIONS; static void do_write(uv_stream_t*); -static void maybe_connect_some(); +static void maybe_connect_some(void); -static uv_req_t* req_alloc(); +static uv_req_t* req_alloc(void); static void req_free(uv_req_t* uv_req); static void buf_alloc(uv_handle_t* handle, size_t size, uv_buf_t* buf); diff --git a/deps/uv/test/runner.c b/deps/uv/test/runner.c index 5e44118775edbc..f017902a04f7c8 100644 --- a/deps/uv/test/runner.c +++ b/deps/uv/test/runner.c @@ -81,6 +81,7 @@ int run_tests(int benchmark_output) { int skipped; int current; int test_result; + int skip; task_entry_t* task; /* Count the number of tests. */ @@ -92,7 +93,9 @@ int run_tests(int benchmark_output) { } } - qsort(TASKS, actual, sizeof(TASKS[0]), compare_task); + /* Keep platform_output first. */ + skip = (actual > 0 && 0 == strcmp(TASKS[0].task_name, "platform_output")); + qsort(TASKS + skip, actual - skip, sizeof(TASKS[0]), compare_task); fprintf(stderr, "1..%d\n", total); fflush(stderr); @@ -127,6 +130,7 @@ void log_tap_result(int test_count, const char* result; const char* directive; char reason[1024]; + int reason_length; switch (status) { case TEST_OK: @@ -144,6 +148,9 @@ void log_tap_result(int test_count, if (status == TEST_SKIP && process_output_size(process) > 0) { process_read_last_line(process, reason, sizeof reason); + reason_length = strlen(reason); + if (reason_length > 0 && reason[reason_length - 1] == '\n') + reason[reason_length - 1] = '\0'; } else { reason[0] = '\0'; } diff --git a/deps/uv/test/test-fork.c b/deps/uv/test/test-fork.c index 3716a3ad975c17..ba85b531064ae5 100644 --- a/deps/uv/test/test-fork.c +++ b/deps/uv/test/test-fork.c @@ -636,6 +636,7 @@ static void assert_run_work(uv_loop_t* const loop) { } +#ifndef __MVS__ TEST_IMPL(fork_threadpool_queue_work_simple) { /* The threadpool works in a child process. */ @@ -672,6 +673,7 @@ TEST_IMPL(fork_threadpool_queue_work_simple) { MAKE_VALGRIND_HAPPY(); return 0; } +#endif /* !__MVS__ */ #endif /* !_WIN32 */ diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index 0000e563a73ffc..6afa650793e670 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -115,6 +115,17 @@ static char test_buf[] = "test-buffer\n"; static char test_buf2[] = "second-buffer\n"; static uv_buf_t iov; +#ifdef _WIN32 +/* + * This tag and guid have no special meaning, and don't conflict with + * reserved ids. +*/ +static unsigned REPARSE_TAG = 0x9913; +static GUID REPARSE_GUID = { + 0x1bf6205f, 0x46ae, 0x4527, + 0xb1, 0x0c, 0xc5, 0x09, 0xb7, 0x55, 0x22, 0x80 }; +#endif + static void check_permission(const char* filename, unsigned int mode) { int r; uv_fs_t req; @@ -1991,6 +2002,109 @@ TEST_IMPL(fs_symlink_dir) { } +#ifdef _WIN32 +TEST_IMPL(fs_non_symlink_reparse_point) { + uv_fs_t req; + int r; + HANDLE file_handle; + REPARSE_GUID_DATA_BUFFER reparse_buffer; + DWORD bytes_returned; + uv_dirent_t dent; + + /* set-up */ + unlink("test_dir/test_file"); + rmdir("test_dir"); + + loop = uv_default_loop(); + + uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); + uv_fs_req_cleanup(&req); + + file_handle = CreateFile("test_dir/test_file", + GENERIC_WRITE | FILE_WRITE_ATTRIBUTES, + 0, + NULL, + CREATE_ALWAYS, + FILE_FLAG_OPEN_REPARSE_POINT | + FILE_FLAG_BACKUP_SEMANTICS, + NULL); + ASSERT(file_handle != INVALID_HANDLE_VALUE); + + memset(&reparse_buffer, 0, REPARSE_GUID_DATA_BUFFER_HEADER_SIZE); + reparse_buffer.ReparseTag = REPARSE_TAG; + reparse_buffer.ReparseDataLength = 0; + reparse_buffer.ReparseGuid = REPARSE_GUID; + + r = DeviceIoControl(file_handle, + FSCTL_SET_REPARSE_POINT, + &reparse_buffer, + REPARSE_GUID_DATA_BUFFER_HEADER_SIZE, + NULL, + 0, + &bytes_returned, + NULL); + ASSERT(r != 0); + + CloseHandle(file_handle); + + r = uv_fs_readlink(NULL, &req, "test_dir/test_file", NULL); + ASSERT(r == UV_EINVAL && GetLastError() == ERROR_SYMLINK_NOT_SUPPORTED); + uv_fs_req_cleanup(&req); + +/* + Placeholder tests for exercising the behavior fixed in issue #995. + To run, update the path with the IP address of a Mac with the hard drive + shared via SMB as "Macintosh HD". + + r = uv_fs_stat(NULL, &req, "\\\\\\Macintosh HD\\.DS_Store", NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&req); + + r = uv_fs_lstat(NULL, &req, "\\\\\\Macintosh HD\\.DS_Store", NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&req); +*/ + +/* + uv_fs_stat and uv_fs_lstat can only work on non-symlink reparse + points when a minifilter driver is registered which intercepts + associated filesystem requests. Installing a driver is beyond + the scope of this test. + + r = uv_fs_stat(NULL, &req, "test_dir/test_file", NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&req); + + r = uv_fs_lstat(NULL, &req, "test_dir/test_file", NULL); + ASSERT(r == 0); + uv_fs_req_cleanup(&req); +*/ + + r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); + ASSERT(r == 1); + ASSERT(scandir_req.result == 1); + ASSERT(scandir_req.ptr); + while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { + ASSERT(strcmp(dent.name, "test_file") == 0); + /* uv_fs_scandir incorrectly identifies non-symlink reparse points + as links because it doesn't open the file and verify the reparse + point tag. The PowerShell Get-ChildItem command shares this + behavior, so it's reasonable to leave it as is. */ + ASSERT(dent.type == UV_DIRENT_LINK); + } + uv_fs_req_cleanup(&scandir_req); + ASSERT(!scandir_req.ptr); + + /* clean-up */ + unlink("test_dir/test_file"); + rmdir("test_dir"); + + MAKE_VALGRIND_HAPPY(); + return 0; +} +#endif + + TEST_IMPL(fs_utime) { utime_check_t checkme; const char* path = "test_file"; diff --git a/deps/uv/test/test-ip6-addr.c b/deps/uv/test/test-ip6-addr.c index 156fccde39deb6..25570dcacde1e3 100644 --- a/deps/uv/test/test-ip6-addr.c +++ b/deps/uv/test/test-ip6-addr.c @@ -44,8 +44,12 @@ TEST_IMPL(ip6_addr_link_local) { const char* device_name; /* 40 bytes address, 16 bytes device name, plus reserve. */ char scoped_addr[128]; + size_t scoped_addr_len; + char interface_id[UV_IF_NAMESIZE]; + size_t interface_id_len; int count; int ix; + int r; ASSERT(0 == uv_interface_addresses(&addresses, &count)); @@ -67,19 +71,29 @@ TEST_IMPL(ip6_addr_link_local) { iface_index = address->address.address6.sin6_scope_id; device_name = address->name; + scoped_addr_len = sizeof(scoped_addr); + ASSERT(0 == uv_if_indextoname(iface_index, scoped_addr, &scoped_addr_len)); +#ifndef _WIN32 + /* This assert fails on Windows, as Windows semantics are different. */ + ASSERT(0 == strcmp(device_name, scoped_addr)); +#endif + + interface_id_len = sizeof(interface_id); + r = uv_if_indextoiid(iface_index, interface_id, &interface_id_len); + ASSERT(0 == r); #ifdef _WIN32 - snprintf(scoped_addr, - sizeof(scoped_addr), - "%s%%%d", - string_address, - iface_index); + /* On Windows, the interface identifier is the numeric string of the index. */ + ASSERT(strtol(interface_id, NULL, 10) == iface_index); #else + /* On Unix/Linux, the interface identifier is the interface device name. */ + ASSERT(0 == strcmp(device_name, interface_id)); +#endif + snprintf(scoped_addr, sizeof(scoped_addr), "%s%%%s", string_address, - device_name); -#endif + interface_id); fprintf(stderr, "Testing link-local address %s " "(iface_index: 0x%02x, device_name: %s)\n", @@ -96,6 +110,9 @@ TEST_IMPL(ip6_addr_link_local) { uv_free_interface_addresses(addresses, count); + scoped_addr_len = sizeof(scoped_addr); + ASSERT(0 != uv_if_indextoname((unsigned int)-1, scoped_addr, &scoped_addr_len)); + MAKE_VALGRIND_HAPPY(); return 0; } diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index 0dde57c2ed22ab..3e88e6c928d096 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h @@ -204,6 +204,7 @@ TEST_DECLARE (pipe_ref4) TEST_DECLARE (pipe_close_stdout_read_stdin) #endif TEST_DECLARE (pipe_set_non_blocking) +TEST_DECLARE (pipe_set_chmod) TEST_DECLARE (process_ref) TEST_DECLARE (has_ref) TEST_DECLARE (active) @@ -282,6 +283,9 @@ TEST_DECLARE (fs_readlink) TEST_DECLARE (fs_realpath) TEST_DECLARE (fs_symlink) TEST_DECLARE (fs_symlink_dir) +#ifdef _WIN32 +TEST_DECLARE (fs_non_symlink_reparse_point) +#endif TEST_DECLARE (fs_utime) TEST_DECLARE (fs_futime) TEST_DECLARE (fs_file_open_append) @@ -398,8 +402,10 @@ TEST_DECLARE (fork_signal_to_child_closed) TEST_DECLARE (fork_fs_events_child) TEST_DECLARE (fork_fs_events_child_dir) TEST_DECLARE (fork_fs_events_file_parent_child) +#ifndef __MVS__ TEST_DECLARE (fork_threadpool_queue_work_simple) #endif +#endif TASK_LIST_START TEST_ENTRY_CUSTOM (platform_output, 0, 1, 5000) @@ -438,6 +444,7 @@ TASK_LIST_START TEST_ENTRY (pipe_close_stdout_read_stdin) #endif TEST_ENTRY (pipe_set_non_blocking) + TEST_ENTRY (pipe_set_chmod) TEST_ENTRY (tty) #ifdef _WIN32 TEST_ENTRY (tty_raw) @@ -790,6 +797,9 @@ TASK_LIST_START TEST_ENTRY (fs_realpath) TEST_ENTRY (fs_symlink) TEST_ENTRY (fs_symlink_dir) +#ifdef _WIN32 + TEST_ENTRY (fs_non_symlink_reparse_point) +#endif TEST_ENTRY (fs_stat_missing_path) TEST_ENTRY (fs_read_file_eof) TEST_ENTRY (fs_file_open_append) @@ -861,8 +871,10 @@ TASK_LIST_START TEST_ENTRY (fork_fs_events_child) TEST_ENTRY (fork_fs_events_child_dir) TEST_ENTRY (fork_fs_events_file_parent_child) +#ifndef __MVS__ TEST_ENTRY (fork_threadpool_queue_work_simple) #endif +#endif #if 0 /* These are for testing the test runner. */ diff --git a/deps/uv/test/test-pipe-set-fchmod.c b/deps/uv/test/test-pipe-set-fchmod.c new file mode 100644 index 00000000000000..59f0e6f5454f89 --- /dev/null +++ b/deps/uv/test/test-pipe-set-fchmod.c @@ -0,0 +1,66 @@ +/* Copyright libuv project contributors. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to +* deal in the Software without restriction, including without limitation the +* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +*/ + + +#include "uv.h" +#include "task.h" + +TEST_IMPL(pipe_set_chmod) { + uv_pipe_t pipe_handle; + uv_loop_t* loop; + int r; + + loop = uv_default_loop(); + + r = uv_pipe_init(loop, &pipe_handle, 0); + ASSERT(r == 0); + + r = uv_pipe_bind(&pipe_handle, TEST_PIPENAME); + ASSERT(r == 0); + + /* No easy way to test if this works, we will only make sure that */ + /* the call is successful. */ + r = uv_pipe_chmod(&pipe_handle, UV_READABLE); + if (r == UV_EPERM) { + MAKE_VALGRIND_HAPPY(); + RETURN_SKIP("Insufficient privileges to alter pipe fmode"); + } + ASSERT(r == 0); + + r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE); + ASSERT(r == 0); + + r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE | UV_READABLE); + ASSERT(r == 0); + + r = uv_pipe_chmod(NULL, UV_WRITABLE | UV_READABLE); + ASSERT(r == UV_EBADF); + + r = uv_pipe_chmod(&pipe_handle, 12345678); + ASSERT(r == UV_EINVAL); + + uv_close((uv_handle_t*)&pipe_handle, NULL); + r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE | UV_READABLE); + ASSERT(r == UV_EBADF); + + MAKE_VALGRIND_HAPPY(); + return 0; +} diff --git a/deps/uv/test/test-platform-output.c b/deps/uv/test/test-platform-output.c index 72c176edc459fb..50ed59a6d23a02 100644 --- a/deps/uv/test/test-platform-output.c +++ b/deps/uv/test/test-platform-output.c @@ -29,6 +29,7 @@ TEST_IMPL(platform_output) { size_t rss; size_t size; double uptime; + uv_pid_t ppid; uv_rusage_t rusage; uv_cpu_info_t* cpus; uv_interface_address_t* interfaces; @@ -144,5 +145,9 @@ TEST_IMPL(platform_output) { printf(" shell: %s\n", pwd.shell); printf(" home directory: %s\n", pwd.homedir); + ppid = uv_os_getppid(); + ASSERT(ppid > 0); + printf("uv_os_getppid: %d\n", (int) ppid); + return 0; } diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c index 91d831e19b92fe..d3958fe216f983 100644 --- a/deps/uv/test/test-spawn.c +++ b/deps/uv/test/test-spawn.c @@ -1721,9 +1721,9 @@ TEST_IMPL(spawn_quoted_path) { RETURN_SKIP("Test for Windows"); #else char* quoted_path_env[2]; - options.file = "not_existing"; - args[0] = options.file; + args[0] = "not_existing"; args[1] = NULL; + options.file = args[0]; options.args = args; options.exit_cb = exit_cb; options.flags = 0; diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index 38765eefd129b2..9d9bb4b735a310 100644 --- a/deps/uv/uv.gyp +++ b/deps/uv/uv.gyp @@ -393,6 +393,7 @@ 'test/test-pipe-server-close.c', 'test/test-pipe-close-stdout-read-stdin.c', 'test/test-pipe-set-non-blocking.c', + 'test/test-pipe-set-fchmod.c', 'test/test-platform-output.c', 'test/test-poll.c', 'test/test-poll-close.c', diff --git a/doc/api/console.md b/doc/api/console.md index cc7e8b0022c25b..6d8050ab1152a0 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -155,6 +155,76 @@ console.assert(false, 'this message will print, but no error thrown'); console.log('this will also print'); ``` +### console.clear() + + +When `stdout` is a TTY, calling `console.clear()` will attempt to clear the +TTY. When `stdout` is not a TTY, this method does nothing. + +*Note*: The specific operation of `console.clear()` can vary across operating +systems and terminal types. For most Linux operating systems, `console.clear()` +operates similarly to the `clear` shell command. On Windows, `console.clear()` +will clear only the output in the current terminal viewport for the Node.js +binary. + +### console.count([label]) + + +* `label` {string} The display label for the counter. Defaults to `'default'`. + +Maintains an internal counter specific to `label` and outputs to `stdout` the +number of times `console.count()` has been called with the given `label`. + + +```js +> console.count() +default: 1 +undefined +> console.count('default') +default: 2 +undefined +> console.count('abc') +abc: 1 +undefined +> console.count('xyz') +xyz: 1 +undefined +> console.count('abc') +abc: 2 +undefined +> console.count() +default: 3 +undefined +> +``` + +### console.countReset([label = 'default']) + + +* `label` {string} The display label for the counter. Defaults to `'default'`. + +Resets the internal counter specific to `label`. + + +```js +> console.count('abc'); +abc: 1 +undefined +> console.countReset('abc'); +undefined +> console.count('abc'); +abc: 1 +undefined +> +``` + + ### console.dir(obj[, options]) + +* `buffer` {Buffer|Uint8Array} Must be supplied. +* `offset` {number} Defaults to `0`. +* `size` {number} Defaults to `buffer.length - offset`. + +Synchronous version of [`crypto.randomFill()`][]. + +Returns `buffer` + +```js +const buf = Buffer.alloc(10); +console.log(crypto.randomFillSync(buf).toString('hex')); + +crypto.randomFillSync(buf, 5); +console.log(buf.toString('hex')); + +// The above is equivalent to the following: +crypto.randomFillSync(buf, 5, 5); +console.log(buf.toString('hex')); +``` + +### crypto.randomFill(buffer[, offset][, size], callback) + + +* `buffer` {Buffer|Uint8Array} Must be supplied. +* `offset` {number} Defaults to `0`. +* `size` {number} Defaults to `buffer.length - offset`. +* `callback` {Function} `function(err, buf) {}`. + +This function is similar to [`crypto.randomBytes()`][] but requires the first +argument to be a [`Buffer`][] that will be filled. It also +requires that a callback is passed in. + +If the `callback` function is not provided, an error will be thrown. + +```js +const buf = Buffer.alloc(10); +crypto.randomFill(buf, (err, buf) => { + if (err) throw err; + console.log(buf.toString('hex')); +}); + +crypto.randomFill(buf, 5, (err, buf) => { + if (err) throw err; + console.log(buf.toString('hex')); +}); + +// The above is equivalent to the following: +crypto.randomFill(buf, 5, 5, (err, buf) => { + if (err) throw err; + console.log(buf.toString('hex')); +}); +``` + ### crypto.setEngine(engine[, flags]) + +* `multicastInterface` {String} + +*Note: All references to scope in this section are refering to +[IPv6 Zone Indices][], which are defined by [RFC 4007][]. In string form, an IP +with a scope index is written as `'IP%scope'` where scope is an interface name or +interface number.* + +Sets the default outgoing multicast interface of the socket to a chosen +interface or back to system interface selection. The `multicastInterface` must +be a valid string representation of an IP from the socket's family. + +For IPv4 sockets, this should be the IP configured for the desired physical +interface. All packets sent to multicast on the socket will be sent on the +interface determined by the most recent successful use of this call. + +For IPv6 sockets, `multicastInterface` should include a scope to indicate the +interface as in the examples that follow. In IPv6, individual `send` calls can +also use explicit scope in addresses, so only packets sent to a multicast +address without specifying an explicit scope are affected by the most recent +successful use of this call. + +#### Examples: IPv6 Outgoing Multicast Interface + +On most systems, where scope format uses the interface name: + +```js +const socket = dgram.createSocket('udp6'); + +socket.bind(1234, () => { + socket.setMulticastInterface('::%eth1'); +}); +``` + +On Windows, where scope format uses an interface number: + +```js +const socket = dgram.createSocket('udp6'); + +socket.bind(1234, () => { + socket.setMulticastInterface('::%2'); +}); +``` + +#### Example: IPv4 Outgoing Multicast Interface +All systems use an IP of the host on the desired physical interface: +```js +const socket = dgram.createSocket('udp4'); + +socket.bind(1234, () => { + socket.setMulticastInterface('10.0.0.2'); +}); +``` + +#### Call Results + +A call on a socket that is not ready to send or no longer open may throw a *Not +running* [`Error`][]. + +If `multicastInterface` can not be parsed into an IP then an *EINVAL* +[`System Error`][] is thrown. + +On IPv4, if `multicastInterface` is a valid address but does not match any +interface, or if the address does not match the family then +a [`System Error`][] such as `EADDRNOTAVAIL` or `EPROTONOSUP` is thrown. + +On IPv6, most errors with specifying or omiting scope will result in the socket +continuing to use (or returning to) the system's default interface selection. + +A socket's address family's ANY address (IPv4 `'0.0.0.0'` or IPv6 `'::'`) can be +used to return control of the sockets default outgoing interface to the system +for future multicast packets. + + ### socket.setMulticastLoopback(flag) + +* `socket` {net.Socket} + +Called when `socket` is detached from a request and could be persisted by the +Agent. Default behavior is to: + +```js +socket.unref(); +socket.setKeepAlive(agent.keepAliveMsecs); +``` + +This method can be overridden by a particular `Agent` subclass. If this +method returns a falsy value, the socket will be destroyed instead of persisting +it for use with the next request. + +### agent.reuseSocket(socket, request) + + +* `socket` {net.Socket} +* `request` {http.ClientRequest} + +Called when `socket` is attached to `request` after being persisted because of +the keep-alive options. Default behavior is to: + +```js +socket.ref(); +``` + +This method can be overridden by a particular `Agent` subclass. + ### agent.destroy() + +* {Object} + +Provides general utility methods when interacting with instances of +`Module` -- the `module` variable often seen in file modules. Accessed +via `require('module')`. + +### module.builtinModules + + +* {string[]} + +A list of the names of all modules provided by Node.js. Can be used to verify +if a module is maintained by a third-party module or not. + +[`__dirname`]: #modules_dirname +[`__filename`]: #modules_filename [`Error`]: errors.html#errors_class_error [module resolution]: #modules_all_together diff --git a/doc/api/net.md b/doc/api/net.md index 5c9c3dea6051b4..8e40c2297df77a 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -121,6 +121,8 @@ connections use asynchronous `server.getConnections` instead. added: v0.9.7 --> +* Returns {net.Server} + Asynchronously get the number of concurrent connections on the server. Works when sockets were sent to forks. @@ -575,6 +577,8 @@ server will still send some data. If `data` is specified, it is equivalent to calling `socket.write(data, encoding)` followed by `socket.end()`. +Returns `socket`. + ### socket.localAddress + +* {integer} + +The `process.ppid` property returns the PID of the current parent process. + +```js +console.log(`The parent process is pid ${process.ppid}`); +``` + ## process.release -For example: `'http:'` +### Class: URL -### urlObject.slashes +Browser-compatible `URL` class, implemented by following the WHATWG URL +Standard. [Examples of parsed URLs][] may be found in the Standard itself. -The `slashes` property is a `boolean` with a value of `true` if two ASCII -forward-slash characters (`/`) are required following the colon in the -`protocol`. +*Note*: In accordance with browser conventions, all properties of `URL` objects +are implemented as getters and setters on the class prototype, rather than as +data properties on the object itself. Thus, unlike [legacy urlObject][]s, using +the `delete` keyword on any properties of `URL` objects (e.g. `delete +myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still +return `true`. -### urlObject.host +#### Constructor: new URL(input[, base]) -The `host` property is the full lower-cased host portion of the URL, including -the `port` if specified. +* `input` {string} The input URL to parse +* `base` {string|URL} The base URL to resolve against if the `input` is not + absolute. + +Creates a new `URL` object by parsing the `input` relative to the `base`. If +`base` is passed as a string, it will be parsed equivalent to `new URL(base)`. + +```js +const { URL } = require('url'); +const myURL = new URL('/foo', 'https://example.org/'); +// https://example.org/foo +``` + +A `TypeError` will be thrown if the `input` or `base` are not valid URLs. Note +that an effort will be made to coerce the given values into strings. For +instance: + +```js +const { URL } = require('url'); +const myURL = new URL({ toString: () => 'https://example.org/' }); +// https://example.org/ +``` + +Unicode characters appearing within the hostname of `input` will be +automatically converted to ASCII using the [Punycode][] algorithm. + +```js +const { URL } = require('url'); +const myURL = new URL('https://你好你好'); +// https://xn--6qqa088eba/ +``` + +*Note*: This feature is only available if the `node` executable was compiled +with [ICU][] enabled. If not, the domain names are passed through unchanged. + +#### url.hash + +* {string} + +Gets and sets the fragment portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org/foo#bar'); +console.log(myURL.hash); +// Prints #bar + +myURL.hash = 'baz'; +console.log(myURL.href); +// Prints https://example.org/foo#baz +``` + +Invalid URL characters included in the value assigned to the `hash` property +are [percent-encoded][]. Note that the selection of which characters to +percent-encode may vary somewhat from what the [`url.parse()`][] and +[`url.format()`][] methods would produce. + +#### url.host + +* {string} + +Gets and sets the host portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org:81/foo'); +console.log(myURL.host); +// Prints example.org:81 + +myURL.host = 'example.com:82'; +console.log(myURL.href); +// Prints https://example.com:82/foo +``` + +Invalid host values assigned to the `host` property are ignored. + +#### url.hostname + +* {string} + +Gets and sets the hostname portion of the URL. The key difference between +`url.host` and `url.hostname` is that `url.hostname` does *not* include the +port. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org:81/foo'); +console.log(myURL.hostname); +// Prints example.org + +myURL.hostname = 'example.com:82'; +console.log(myURL.href); +// Prints https://example.com:81/foo +``` + +Invalid hostname values assigned to the `hostname` property are ignored. + +#### url.href + +* {string} + +Gets and sets the serialized URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org/foo'); +console.log(myURL.href); +// Prints https://example.org/foo + +myURL.href = 'https://example.com/bar'; +console.log(myURL.href); +// Prints https://example.com/bar +``` + +Getting the value of the `href` property is equivalent to calling +[`url.toString()`][]. + +Setting the value of this property to a new value is equivalent to creating a +new `URL` object using [`new URL(value)`][`new URL()`]. Each of the `URL` +object's properties will be modified. + +If the value assigned to the `href` property is not a valid URL, a `TypeError` +will be thrown. + +#### url.origin + +* {string} + +Gets the read-only serialization of the URL's origin. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org/foo/bar?baz'); +console.log(myURL.origin); +// Prints https://example.org +``` + +```js +const { URL } = require('url'); +const idnURL = new URL('https://你好你好'); +console.log(idnURL.origin); +// Prints https://xn--6qqa088eba + +console.log(idnURL.hostname); +// Prints xn--6qqa088eba +``` + +#### url.password + +* {string} + +Gets and sets the password portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://abc:xyz@example.com'); +console.log(myURL.password); +// Prints xyz + +myURL.password = '123'; +console.log(myURL.href); +// Prints https://abc:123@example.com +``` + +Invalid URL characters included in the value assigned to the `password` property +are [percent-encoded][]. Note that the selection of which characters to +percent-encode may vary somewhat from what the [`url.parse()`][] and +[`url.format()`][] methods would produce. + +#### url.pathname + +* {string} + +Gets and sets the path portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org/abc/xyz?123'); +console.log(myURL.pathname); +// Prints /abc/xyz + +myURL.pathname = '/abcdef'; +console.log(myURL.href); +// Prints https://example.org/abcdef?123 +``` + +Invalid URL characters included in the value assigned to the `pathname` +property are [percent-encoded][]. Note that the selection of which characters +to percent-encode may vary somewhat from what the [`url.parse()`][] and +[`url.format()`][] methods would produce. + +#### url.port + +* {string} + +Gets and sets the port portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org:8888'); +console.log(myURL.port); +// Prints 8888 + +// Default ports are automatically transformed to the empty string +// (HTTPS protocol's default port is 443) +myURL.port = '443'; +console.log(myURL.port); +// Prints the empty string +console.log(myURL.href); +// Prints https://example.org/ + +myURL.port = 1234; +console.log(myURL.port); +// Prints 1234 +console.log(myURL.href); +// Prints https://example.org:1234/ + +// Completely invalid port strings are ignored +myURL.port = 'abcd'; +console.log(myURL.port); +// Prints 1234 + +// Leading numbers are treated as a port number +myURL.port = '5678abcd'; +console.log(myURL.port); +// Prints 5678 + +// Non-integers are truncated +myURL.port = 1234.5678; +console.log(myURL.port); +// Prints 1234 + +// Out-of-range numbers are ignored +myURL.port = 1e10; +console.log(myURL.port); +// Prints 1234 +``` + +The port value may be set as either a number or as a String containing a number +in the range `0` to `65535` (inclusive). Setting the value to the default port +of the `URL` objects given `protocol` will result in the `port` value becoming +the empty string (`''`). + +If an invalid string is assigned to the `port` property, but it begins with a +number, the leading number is assigned to `port`. Otherwise, or if the number +lies outside the range denoted above, it is ignored. + +#### url.protocol + +* {string} + +Gets and sets the protocol portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org'); +console.log(myURL.protocol); +// Prints https: + +myURL.protocol = 'ftp'; +console.log(myURL.href); +// Prints ftp://example.org/ +``` + +Invalid URL protocol values assigned to the `protocol` property are ignored. + +#### url.search + +* {string} + +Gets and sets the serialized query portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org/abc?123'); +console.log(myURL.search); +// Prints ?123 + +myURL.search = 'abc=xyz'; +console.log(myURL.href); +// Prints https://example.org/abc?abc=xyz +``` + +Any invalid URL characters appearing in the value assigned the `search` +property will be [percent-encoded][]. Note that the selection of which +characters to percent-encode may vary somewhat from what the [`url.parse()`][] +and [`url.format()`][] methods would produce. + +#### url.searchParams + +* {URLSearchParams} + +Gets the [`URLSearchParams`][] object representing the query parameters of the +URL. This property is read-only; to replace the entirety of query parameters of +the URL, use the [`url.search`][] setter. See [`URLSearchParams`][] +documentation for details. + +#### url.username + +* {string} + +Gets and sets the username portion of the URL. + +```js +const { URL } = require('url'); +const myURL = new URL('https://abc:xyz@example.com'); +console.log(myURL.username); +// Prints abc + +myURL.username = '123'; +console.log(myURL.href); +// Prints https://123:xyz@example.com/ +``` + +Any invalid URL characters appearing in the value assigned the `username` +property will be [percent-encoded][]. Note that the selection of which +characters to percent-encode may vary somewhat from what the [`url.parse()`][] +and [`url.format()`][] methods would produce. + +#### url.toString() + +* Returns: {string} + +The `toString()` method on the `URL` object returns the serialized URL. The +value returned is equivalent to that of [`url.href`][] and [`url.toJSON()`][]. + +Because of the need for standard compliance, this method does not allow users +to customize the serialization process of the URL. + +#### url.toJSON() + +* Returns: {string} + +The `toJSON()` method on the `URL` object returns the serialized URL. The +value returned is equivalent to that of [`url.href`][] and +[`url.toString()`][]. + +This method is automatically called when an `URL` object is serialized +with [`JSON.stringify()`][]. + +```js +const { URL } = require('url'); +const myURLs = [ + new URL('https://www.example.com'), + new URL('https://test.example.org') +]; +console.log(JSON.stringify(myURLs)); +// Prints ["https://www.example.com/","https://test.example.org/"] +``` + +### Class: URLSearchParams + + +The `URLSearchParams` API provides read and write access to the query of a +`URL`. The `URLSearchParams` class can also be used standalone with one of the +four following constructors. + +The WHATWG `URLSearchParams` interface and the [`querystring`][] module have +similar purpose, but the purpose of the [`querystring`][] module is more +general, as it allows the customization of delimiter characters (`&` and `=`). +On the other hand, this API is designed purely for URL query strings. + +```js +const { URL, URLSearchParams } = require('url'); + +const myURL = new URL('https://example.org/?abc=123'); +console.log(myURL.searchParams.get('abc')); +// Prints 123 + +myURL.searchParams.append('abc', 'xyz'); +console.log(myURL.href); +// Prints https://example.org/?abc=123&abc=xyz + +myURL.searchParams.delete('abc'); +myURL.searchParams.set('a', 'b'); +console.log(myURL.href); +// Prints https://example.org/?a=b + +const newSearchParams = new URLSearchParams(myURL.searchParams); +// The above is equivalent to +// const newSearchParams = new URLSearchParams(myURL.search); + +newSearchParams.append('a', 'c'); +console.log(myURL.href); +// Prints https://example.org/?a=b +console.log(newSearchParams.toString()); +// Prints a=b&a=c + +// newSearchParams.toString() is implicitly called +myURL.search = newSearchParams; +console.log(myURL.href); +// Prints https://example.org/?a=b&a=c +newSearchParams.delete('a'); +console.log(myURL.href); +// Prints https://example.org/?a=b&a=c +``` + +#### Constructor: new URLSearchParams() + +Instantiate a new empty `URLSearchParams` object. + +#### Constructor: new URLSearchParams(string) + +* `string` {string} A query string + +Parse the `string` as a query string, and use it to instantiate a new +`URLSearchParams` object. A leading `'?'`, if present, is ignored. + +```js +const { URLSearchParams } = require('url'); +let params; + +params = new URLSearchParams('user=abc&query=xyz'); +console.log(params.get('user')); +// Prints 'abc' +console.log(params.toString()); +// Prints 'user=abc&query=xyz' + +params = new URLSearchParams('?user=abc&query=xyz'); +console.log(params.toString()); +// Prints 'user=abc&query=xyz' +``` + +#### Constructor: new URLSearchParams(obj) + + +* `obj` {Object} An object representing a collection of key-value pairs + +Instantiate a new `URLSearchParams` object with a query hash map. The key and +value of each property of `obj` are always coerced to strings. + +*Note*: Unlike [`querystring`][] module, duplicate keys in the form of array +values are not allowed. Arrays are stringified using [`array.toString()`][], +which simply joins all array elements with commas. + +```js +const { URLSearchParams } = require('url'); +const params = new URLSearchParams({ + user: 'abc', + query: ['first', 'second'] +}); +console.log(params.getAll('query')); +// Prints [ 'first,second' ] +console.log(params.toString()); +// Prints 'user=abc&query=first%2Csecond' +``` + +#### Constructor: new URLSearchParams(iterable) + + +* `iterable` {Iterable} An iterable object whose elements are key-value pairs + +Instantiate a new `URLSearchParams` object with an iterable map in a way that +is similar to [`Map`][]'s constructor. `iterable` can be an Array or any +iterable object. That means `iterable` can be another `URLSearchParams`, in +which case the constructor will simply create a clone of the provided +`URLSearchParams`. Elements of `iterable` are key-value pairs, and can +themselves be any iterable object. + +Duplicate keys are allowed. + +```js +const { URLSearchParams } = require('url'); +let params; + +// Using an array +params = new URLSearchParams([ + ['user', 'abc'], + ['query', 'first'], + ['query', 'second'] +]); +console.log(params.toString()); +// Prints 'user=abc&query=first&query=second' + +// Using a Map object +const map = new Map(); +map.set('user', 'abc'); +map.set('query', 'xyz'); +params = new URLSearchParams(map); +console.log(params.toString()); +// Prints 'user=abc&query=xyz' + +// Using a generator function +function* getQueryPairs() { + yield ['user', 'abc']; + yield ['query', 'first']; + yield ['query', 'second']; +} +params = new URLSearchParams(getQueryPairs()); +console.log(params.toString()); +// Prints 'user=abc&query=first&query=second' + +// Each key-value pair must have exactly two elements +new URLSearchParams([ + ['user', 'abc', 'error'] +]); +// Throws TypeError [ERR_INVALID_TUPLE]: +// Each query pair must be an iterable [name, value] tuple +``` + +#### urlSearchParams.append(name, value) + +* `name` {string} +* `value` {string} + +Append a new name-value pair to the query string. + +#### urlSearchParams.delete(name) + +* `name` {string} + +Remove all name-value pairs whose name is `name`. + +#### urlSearchParams.entries() + +* Returns: {Iterator} + +Returns an ES6 Iterator over each of the name-value pairs in the query. +Each item of the iterator is a JavaScript Array. The first item of the Array +is the `name`, the second item of the Array is the `value`. + +Alias for [`urlSearchParams[@@iterator]()`][`urlSearchParams@@iterator()`]. + +#### urlSearchParams.forEach(fn[, thisArg]) + +* `fn` {Function} Function invoked for each name-value pair in the query. +* `thisArg` {Object} Object to be used as `this` value for when `fn` is called + +Iterates over each name-value pair in the query and invokes the given function. + +```js +const { URL } = require('url'); +const myURL = new URL('https://example.org/?a=b&c=d'); +myURL.searchParams.forEach((value, name, searchParams) => { + console.log(name, value, myURL.searchParams === searchParams); +}); +// Prints: +// a b true +// c d true +``` + +#### urlSearchParams.get(name) + +* `name` {string} +* Returns: {string} or `null` if there is no name-value pair with the given + `name`. + +Returns the value of the first name-value pair whose name is `name`. If there +are no such pairs, `null` is returned. + +#### urlSearchParams.getAll(name) + +* `name` {string} +* Returns: {Array} + +Returns the values of all name-value pairs whose name is `name`. If there are +no such pairs, an empty array is returned. + +#### urlSearchParams.has(name) + +* `name` {string} +* Returns: {boolean} + +Returns `true` if there is at least one name-value pair whose name is `name`. + +#### urlSearchParams.keys() + +* Returns: {Iterator} + +Returns an ES6 Iterator over the names of each name-value pair. + +```js +const { URLSearchParams } = require('url'); +const params = new URLSearchParams('foo=bar&foo=baz'); +for (const name of params.keys()) { + console.log(name); +} +// Prints: +// foo +// foo +``` + +#### urlSearchParams.set(name, value) + +* `name` {string} +* `value` {string} + +Sets the value in the `URLSearchParams` object associated with `name` to +`value`. If there are any pre-existing name-value pairs whose names are `name`, +set the first such pair's value to `value` and remove all others. If not, +append the name-value pair to the query string. + +```js +const { URLSearchParams } = require('url'); + +const params = new URLSearchParams(); +params.append('foo', 'bar'); +params.append('foo', 'baz'); +params.append('abc', 'def'); +console.log(params.toString()); +// Prints foo=bar&foo=baz&abc=def + +params.set('foo', 'def'); +params.set('xyz', 'opq'); +console.log(params.toString()); +// Prints foo=def&abc=def&xyz=opq +``` + +#### urlSearchParams.sort() + + +Sort all existing name-value pairs in-place by their names. Sorting is done +with a [stable sorting algorithm][], so relative order between name-value pairs +with the same name is preserved. + +This method can be used, in particular, to increase cache hits. + +```js +const { URLSearchParams } = require('url'); +const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); +params.sort(); +console.log(params.toString()); +// Prints query%5B%5D=abc&query%5B%5D=123&type=search +``` + +#### urlSearchParams.toString() + +* Returns: {string} + +Returns the search parameters serialized as a string, with characters +percent-encoded where necessary. + +#### urlSearchParams.values() + +* Returns: {Iterator} + +Returns an ES6 Iterator over the values of each name-value pair. + +#### urlSearchParams\[@@iterator\]() + +* Returns: {Iterator} -For example: `'host.com:8080'` +Returns an ES6 Iterator over each of the name-value pairs in the query string. +Each item of the iterator is a JavaScript Array. The first item of the Array +is the `name`, the second item of the Array is the `value`. -### urlObject.auth +Alias for [`urlSearchParams.entries()`][]. + +```js +const { URLSearchParams } = require('url'); +const params = new URLSearchParams('foo=bar&xyz=baz'); +for (const [name, value] of params) { + console.log(name, value); +} +// Prints: +// foo bar +// xyz baz +``` + +### url.domainToASCII(domain) + + +* `domain` {string} +* Returns: {string} + +Returns the [Punycode][] ASCII serialization of the `domain`. If `domain` is an +invalid domain, the empty string is returned. + +It performs the inverse operation to [`url.domainToUnicode()`][]. + +```js +const url = require('url'); +console.log(url.domainToASCII('español.com')); +// Prints xn--espaol-zwa.com +console.log(url.domainToASCII('中文.com')); +// Prints xn--fiq228c.com +console.log(url.domainToASCII('xn--iñvalid.com')); +// Prints an empty string +``` + +### url.domainToUnicode(domain) + + +* `domain` {string} +* Returns: {string} + +Returns the Unicode serialization of the `domain`. If `domain` is an invalid +domain, the empty string is returned. + +It performs the inverse operation to [`url.domainToASCII()`][]. + +```js +const url = require('url'); +console.log(url.domainToUnicode('xn--espaol-zwa.com')); +// Prints español.com +console.log(url.domainToUnicode('xn--fiq228c.com')); +// Prints 中文.com +console.log(url.domainToUnicode('xn--iñvalid.com')); +// Prints an empty string +``` + +## Legacy URL API + +### Legacy urlObject + +The legacy urlObject (`require('url').Url`) is created and returned by the +`url.parse()` function. + +#### urlObject.auth The `auth` property is the username and password portion of the URL, also referred to as "userinfo". This string subset follows the `protocol` and @@ -72,12 +823,33 @@ with the `[:{password}]` portion being optional. For example: `'user:pass'` -### urlObject.hostname +#### urlObject.hash + +The `hash` property consists of the "fragment" portion of the URL including +the leading ASCII hash (`#`) character. + +For example: `'#hash'` + +#### urlObject.host + +The `host` property is the full lower-cased host portion of the URL, including +the `port` if specified. + +For example: `'sub.host.com:8080'` + +#### urlObject.hostname The `hostname` property is the lower-cased host name portion of the `host` component *without* the `port` included. -For example: `'host.com'` +For example: `'sub.host.com'` + +#### urlObject.href + +The `href` property is the full URL string that was parsed with both the +`protocol` and `host` components converted to lower-case. + +For example: `'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'` ### urlObject.port @@ -126,14 +898,22 @@ For example: `'query=string'` or `{'query': 'string'}` If returned as a string, no decoding of the query string is performed. If returned as an object, both keys and values are decoded. -### urlObject.hash +#### urlObject.search -The `hash` property consists of the "fragment" portion of the URL including -the leading ASCII hash (`#`) character. +The `search` property consists of the entire "query string" portion of the +URL, including the leading ASCII question mark (`?`) character. -For example: `'#hash'` +For example: `'?query=string'` -## url.format(urlObject) +No decoding of the query string is performed. + +#### urlObject.slashes + +The `slashes` property is a `boolean` with a value of `true` if two ASCII +forward-slash characters (`/`) are required following the colon in the +`protocol`. + +### url.format(urlObject) @@ -201,7 +981,7 @@ The formatting process operates as follows: * `result` is returned. -## url.parse(urlString[, parseQueryString[, slashesDenoteHost]]) +### url.parse(urlString[, parseQueryString[, slashesDenoteHost]]) @@ -220,7 +1000,7 @@ added: v0.1.25 The `url.parse()` method takes a URL string, parses it, and returns a URL object. -## url.resolve(from, to) +### url.resolve(from, to) @@ -239,11 +1019,18 @@ url.resolve('http://example.com/', '/one'); // 'http://example.com/one' url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' ``` -## Escaped Characters + +## Percent-Encoding in URLs + +URLs are permitted to only contain a certain range of characters. Any character +falling outside of that range must be encoded. How such characters are encoded, +and which characters to encode depends entirely on where the character is +located within the structure of the URL. -URLs are only permitted to contain a certain range of characters. Spaces (`' '`) -and the following characters will be automatically escaped in the -properties of URL objects: +### Legacy API + +Within the Legacy API, spaces (`' '`) and the following characters will be +automatically escaped in the properties of URL objects: ```txt < > " ` \r \n \t { } | \ ^ ' @@ -252,6 +1039,68 @@ properties of URL objects: For example, the ASCII space character (`' '`) is encoded as `%20`. The ASCII forward slash (`/`) character is encoded as `%3C`. +### WHATWG API + +The [WHATWG URL Standard][] uses a more selective and fine grained approach to +selecting encoded characters than that used by the Legacy API. + +The WHATWG algorithm defines three "percent-encode sets" that describe ranges +of characters that must be percent-encoded: + +* The *C0 control percent-encode set* includes code points in range U+0000 to + U+001F (inclusive) and all code points greater than U+007E. + +* The *path percent-encode set* includes the *C0 control percent-encode set* + and code points U+0020, U+0022, U+0023, U+003C, U+003E, U+003F, U+0060, + U+007B, and U+007D. + +* The *userinfo encode set* includes the *path percent-encode set* and code + points U+002F, U+003A, U+003B, U+003D, U+0040, U+005B, U+005C, U+005D, + U+005E, and U+007C. + +The *userinfo percent-encode set* is used exclusively for username and +passwords encoded within the URL. The *path percent-encode set* is used for the +path of most URLs. The *C0 control percent-encode set* is used for all +other cases, including URL fragments in particular, but also host and path +under certain specific conditions. + +When non-ASCII characters appear within a hostname, the hostname is encoded +using the [Punycode][] algorithm. Note, however, that a hostname *may* contain +*both* Punycode encoded and percent-encoded characters. For example: + +```js +const { URL } = require('url'); +const myURL = new URL('https://%CF%80.com/foo'); +console.log(myURL.href); +// Prints https://xn--1xa.com/foo +console.log(myURL.origin); +// Prints https://π.com +``` + [`Error`]: errors.html#errors_class_error -[`querystring`]: querystring.html +[`JSON.stringify()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map [`TypeError`]: errors.html#errors_class_typeerror +[`URLSearchParams`]: #url_class_urlsearchparams +[`array.toString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString +[`new URL()`]: #url_constructor_new_url_input_base +[`querystring`]: querystring.html +[`require('url').format()`]: #url_url_format_url_options +[`url.domainToASCII()`]: #url_url_domaintoascii_domain +[`url.domainToUnicode()`]: #url_url_domaintounicode_domain +[`url.format()`]: #url_url_format_urlobject +[`url.href`]: #url_url_href +[`url.parse()`]: #url_url_parse_urlstring_parsequerystring_slashesdenotehost +[`url.search`]: #url_url_search +[`url.toJSON()`]: #url_url_tojson +[`url.toString()`]: #url_url_tostring +[`urlSearchParams.entries()`]: #url_urlsearchparams_entries +[`urlSearchParams@@iterator()`]: #url_urlsearchparams_iterator +[ICU]: intl.html#intl_options_for_building_node_js +[Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4 +[WHATWG URL Standard]: https://url.spec.whatwg.org/ +[WHATWG URL]: #url_the_whatwg_url_api +[examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing +[legacy urlObject]: #url_legacy_urlobject +[percent-encoded]: #whatwg-percent-encoding +[stable sorting algorithm]: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 8b79d14ff12166..c92242e38bf8c1 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -67,14 +67,15 @@ function Agent(options) { if (count > self.maxSockets || freeLen >= self.maxFreeSockets) { socket.destroy(); - } else { + } else if (self.keepSocketAlive(socket)) { freeSockets = freeSockets || []; self.freeSockets[name] = freeSockets; - socket.setKeepAlive(true, self.keepAliveMsecs); - socket.unref(); socket._httpMessage = null; self.removeSocket(socket, options); freeSockets.push(socket); + } else { + // Implementation doesn't want to keep socket alive + socket.destroy(); } } else { socket.destroy(); @@ -142,13 +143,12 @@ Agent.prototype.addRequest = function(req, options) { if (freeLen) { // we have a free socket, so use that. var socket = this.freeSockets[name].shift(); - debug('have free socket'); // don't leak if (!this.freeSockets[name].length) delete this.freeSockets[name]; - socket.ref(); + this.reuseSocket(socket, req); req.onSocket(socket); this.sockets[name].push(socket); } else if (sockLen < this.maxSockets) { @@ -279,7 +279,19 @@ Agent.prototype.removeSocket = function removeSocket(s, options) { } }; -Agent.prototype.destroy = function() { +Agent.prototype.keepSocketAlive = function keepSocketAlive(socket) { + socket.setKeepAlive(true, this.keepAliveMsecs); + socket.unref(); + + return true; +}; + +Agent.prototype.reuseSocket = function reuseSocket(socket, req) { + debug('have free socket'); + socket.ref(); +}; + +Agent.prototype.destroy = function destroy() { var sets = [this.freeSockets, this.sockets]; for (var s = 0; s < sets.length; s++) { var set = sets[s]; diff --git a/lib/console.js b/lib/console.js index 2359cb36e011d0..00f1ee51672586 100644 --- a/lib/console.js +++ b/lib/console.js @@ -1,6 +1,7 @@ 'use strict'; const util = require('util'); +const kCounts = Symbol('counts'); function Console(stdout, stderr) { if (!(this instanceof Console)) { @@ -27,6 +28,8 @@ function Console(stdout, stderr) { prop.value = new Map(); Object.defineProperty(this, '_times', prop); + this[kCounts] = new Map(); + // bind the prototype functions to this Console instance var keys = Object.keys(Console.prototype); for (var v = 0; v < keys.length; v++) { @@ -96,6 +99,42 @@ Console.prototype.assert = function(expression, ...args) { } }; +// Defined by: https://console.spec.whatwg.org/#clear +Console.prototype.clear = function clear() { + // It only makes sense to clear if _stdout is a TTY. + // Otherwise, do nothing. + if (this._stdout.isTTY) { + // The require is here intentionally to avoid readline being + // required too early when console is first loaded. + const { cursorTo, clearScreenDown } = require('readline'); + cursorTo(this._stdout, 0, 0); + clearScreenDown(this._stdout); + } +}; + +// Defined by: https://console.spec.whatwg.org/#count +Console.prototype.count = function count(label = 'default') { + // Ensures that label is a string, and only things that can be + // coerced to strings. e.g. Symbol is not allowed + label = `${label}`; + const counts = this[kCounts]; + let count = counts.get(label); + if (count === undefined) + count = 1; + else + count++; + counts.set(label, count); + this.log(`${label}: ${count}`); +}; + +// Not yet defined by the https://console.spec.whatwg.org, but +// proposed to be added and currently implemented by Edge. Having +// the ability to reset counters is important to help prevent +// the counter from being a memory leak. +Console.prototype.countReset = function countReset(label = 'default') { + const counts = this[kCounts]; + counts.delete(`${label}`); +}; module.exports = new Console(process.stdout, process.stderr); module.exports.Console = Console; diff --git a/lib/crypto.js b/lib/crypto.js index f4eeb7baa3aad5..52c29830a473e9 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -19,12 +19,34 @@ const setFipsCrypto = binding.setFipsCrypto; const timingSafeEqual = binding.timingSafeEqual; const Buffer = require('buffer').Buffer; +const kBufferMaxLength = require('buffer').kMaxLength; const stream = require('stream'); const util = require('util'); const LazyTransform = require('internal/streams/lazy_transform'); const DH_GENERATOR = 2; +const ReflectApply = Reflect.apply; + +const TypedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype); +const TypedArrayProto_toStringTag = + uncurryThis( + Object.getOwnPropertyDescriptor(TypedArrayPrototype, + Symbol.toStringTag).get); + +// This function is borrowed from the function with the same name on V8 Extras' +// `utils` object. V8 implements Reflect.apply very efficiently in conjunction +// with the spread syntax, such that no additional special case is needed for +// function calls w/o arguments. +// Refs: https://github.com/v8/v8/blob/d6ead37d265d7215cf9c5f768f279e21bd170212/src/js/prologue.js#L152-L156 +function uncurryThis(func) { + return (thisArg, ...args) => ReflectApply(func, thisArg, args); +} + +function isUint8Array(value) { + return TypedArrayProto_toStringTag(value) === 'Uint8Array'; +} + Object.defineProperty(exports, 'constants', { configurable: false, enumerable: true, @@ -44,7 +66,6 @@ function toBuf(str, encoding) { } exports._toBuf = toBuf; - const assert = require('assert'); const StringDecoder = require('string_decoder').StringDecoder; @@ -534,17 +555,16 @@ DiffieHellman.prototype.setPrivateKey = function setPrivateKey(key, encoding) { }; +exports.createECDH = exports.ECDH = ECDH; function ECDH(curve) { + if (!(this instanceof ECDH)) + return new ECDH(curve); if (typeof curve !== 'string') throw new TypeError('"curve" argument should be a string'); this._handle = new binding.ECDH(curve); } -exports.createECDH = function createECDH(curve) { - return new ECDH(curve); -}; - ECDH.prototype.computeSecret = DiffieHellman.prototype.computeSecret; ECDH.prototype.setPrivateKey = DiffieHellman.prototype.setPrivateKey; ECDH.prototype.setPublicKey = DiffieHellman.prototype.setPublicKey; @@ -677,6 +697,74 @@ exports.setEngine = function setEngine(id, flags) { return binding.setEngine(id, flags); }; +const kMaxUint32 = Math.pow(2, 32) - 1; + +function randomFillSync(buf, offset = 0, size) { + if (!isUint8Array(buf)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + + assertOffset(offset, buf.length); + + if (size === undefined) size = buf.length - offset; + + assertSize(size, offset, buf.length); + + return binding.randomFill(buf, offset, size); +} +exports.randomFillSync = randomFillSync; + +function randomFill(buf, offset, size, cb) { + if (!isUint8Array(buf)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + + if (typeof offset === 'function') { + cb = offset; + offset = 0; + size = buf.length; + } else if (typeof size === 'function') { + cb = size; + size = buf.length - offset; + } else if (typeof cb !== 'function') { + throw new TypeError('"cb" argument must be a function'); + } + + assertOffset(offset, buf.length); + assertSize(size, offset, buf.length); + + return binding.randomFill(buf, offset, size, cb); +} +exports.randomFill = randomFill; + +function assertOffset(offset, length) { + if (typeof offset !== 'number' || offset !== offset) { + throw new TypeError('offset must be a number'); + } + + if (offset > kMaxUint32 || offset < 0) { + throw new TypeError('offset must be a uint32'); + } + + if (offset > kBufferMaxLength || offset > length) { + throw new RangeError('offset out of range'); + } +} + +function assertSize(size, offset, length) { + if (typeof size !== 'number' || size !== size) { + throw new TypeError('size must be a number'); + } + + if (size > kMaxUint32 || size < 0) { + throw new TypeError('size must be a uint32'); + } + + if (size + offset > length || size > kBufferMaxLength) { + throw new RangeError('buffer too small'); + } +} + exports.randomBytes = exports.pseudoRandomBytes = randomBytes; exports.rng = exports.prng = randomBytes; diff --git a/lib/dgram.js b/lib/dgram.js index d38687ab6a7aa8..f4cabdbc5d1b95 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -493,6 +493,19 @@ Socket.prototype.setMulticastLoopback = function(arg) { }; +Socket.prototype.setMulticastInterface = function(interfaceAddress) { + this._healthCheck(); + + if (typeof interfaceAddress !== 'string') { + throw new TypeError('"interfaceAddress" argument must be a string'); + } + + const err = this._handle.setMulticastInterface(interfaceAddress); + if (err) { + throw errnoException(err, 'setMulticastInterface'); + } +}; + Socket.prototype.addMembership = function(multicastAddress, interfaceAddress) { this._healthCheck(); diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 310dc9dd029375..4b5a500adc598e 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -62,6 +62,10 @@ _process.setupRawDebug(); + // Ensure setURLConstructor() is called before the native + // URL::ToObject() method is used. + NativeModule.require('internal/url'); + Object.defineProperty(process, 'argv0', { enumerable: true, configurable: false, diff --git a/lib/internal/process/promises.js b/lib/internal/process/promises.js index d976b9d38a9050..54a3ff41ec40c1 100644 --- a/lib/internal/process/promises.js +++ b/lib/internal/process/promises.js @@ -1,5 +1,7 @@ 'use strict'; +const { safeToString } = process.binding('util'); + const promiseRejectEvent = process._promiseRejectEvent; const hasBeenNotifiedProperty = new WeakMap(); const promiseToGuidProperty = new WeakMap(); @@ -64,12 +66,17 @@ function setupPromises(scheduleMicrotasks) { hasBeenNotifiedProperty.set(promise, true); const uid = promiseToGuidProperty.get(promise); if (!process.emit('unhandledRejection', reason, promise)) { - const warning = new Error('Unhandled promise rejection ' + - `(rejection id: ${uid}): ${reason}`); + const warning = new Error( + `Unhandled promise rejection (rejection id: ${uid}): ` + + safeToString(reason)); warning.name = 'UnhandledPromiseRejectionWarning'; warning.id = uid; - if (reason instanceof Error) { - warning.stack = reason.stack; + try { + if (reason instanceof Error) { + warning.stack = reason.stack; + } + } catch (err) { + // ignored } process.emitWarning(warning); } else { diff --git a/lib/internal/querystring.js b/lib/internal/querystring.js new file mode 100644 index 00000000000000..d1684418097100 --- /dev/null +++ b/lib/internal/querystring.js @@ -0,0 +1,29 @@ +'use strict'; + +const hexTable = new Array(256); +for (var i = 0; i < 256; ++i) + hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + +const isHexTable = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32 - 47 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 64 - 79 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 95 + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 96 - 111 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 112 - 127 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128 ... + 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, + 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 // ... 256 +]; + +module.exports = { + hexTable, + isHexTable +}; diff --git a/lib/internal/url.js b/lib/internal/url.js new file mode 100644 index 00000000000000..91a03ec99a87fd --- /dev/null +++ b/lib/internal/url.js @@ -0,0 +1,1428 @@ +'use strict'; + +const util = require('util'); +const { + hexTable, + isHexTable +} = require('internal/querystring'); + +const { getConstructorOf } = require('internal/util'); +const querystring = require('querystring'); + +const { platform } = process; +const isWindows = platform === 'win32'; + +const { + domainToASCII: _domainToASCII, + domainToUnicode: _domainToUnicode, + encodeAuth, + toUSVString: _toUSVString, + parse: _parse, + setURLConstructor, + URL_FLAGS_CANNOT_BE_BASE, + URL_FLAGS_HAS_FRAGMENT, + URL_FLAGS_HAS_HOST, + URL_FLAGS_HAS_PASSWORD, + URL_FLAGS_HAS_PATH, + URL_FLAGS_HAS_QUERY, + URL_FLAGS_HAS_USERNAME, + URL_FLAGS_SPECIAL, + kFragment, + kHost, + kHostname, + kPathStart, + kPort, + kQuery, + kSchemeStart +} = process.binding('url'); + +const context = Symbol('context'); +const cannotBeBase = Symbol('cannot-be-base'); +const cannotHaveUsernamePasswordPort = + Symbol('cannot-have-username-password-port'); +const special = Symbol('special'); +const searchParams = Symbol('query'); +const kFormat = Symbol('format'); + +// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object +const IteratorPrototype = Object.getPrototypeOf( + Object.getPrototypeOf([][Symbol.iterator]()) +); + +const unpairedSurrogateRe = + /(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/; +function toUSVString(val) { + const str = `${val}`; + // As of V8 5.5, `str.search()` (and `unpairedSurrogateRe[@@search]()`) are + // slower than `unpairedSurrogateRe.exec()`. + const match = unpairedSurrogateRe.exec(str); + if (!match) + return str; + return _toUSVString(str, match.index); +} + +// Refs: https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque +const kOpaqueOrigin = 'null'; + +// Refs: https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin +function serializeTupleOrigin(scheme, host, port) { + return `${scheme}//${host}${port === null ? '' : `:${port}`}`; +} + +// This class provides the internal state of a URL object. An instance of this +// class is stored in every URL object and is accessed internally by setters +// and getters. It roughly corresponds to the concept of a URL record in the +// URL Standard, with a few differences. It is also the object transported to +// the C++ binding. +// Refs: https://url.spec.whatwg.org/#concept-url +class URLContext { + constructor() { + this.flags = 0; + this.scheme = ':'; + this.username = ''; + this.password = ''; + this.host = null; + this.port = null; + this.path = []; + this.query = null; + this.fragment = null; + } +} + +class URLSearchParams { + // URL Standard says the default value is '', but as undefined and '' have + // the same result, undefined is used to prevent unnecessary parsing. + // Default parameter is necessary to keep URLSearchParams.length === 0 in + // accordance with Web IDL spec. + constructor(init = undefined) { + if (init === null || init === undefined) { + this[searchParams] = []; + } else if ((typeof init === 'object' && init !== null) || + typeof init === 'function') { + const method = init[Symbol.iterator]; + if (method === this[Symbol.iterator]) { + // While the spec does not have this branch, we can use it as a + // shortcut to avoid having to go through the costly generic iterator. + const childParams = init[searchParams]; + this[searchParams] = childParams.slice(); + } else if (method !== null && method !== undefined) { + if (typeof method !== 'function') { + throw new TypeError('Query pairs must be iterable'); + } + + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if ((typeof pair !== 'object' && typeof pair !== 'function') || + pair === null || + typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError( + 'Each query pair must be an iterable [name, value] tuple'); + } + const convertedPair = []; + for (const element of pair) + convertedPair.push(toUSVString(element)); + pairs.push(convertedPair); + } + + this[searchParams] = []; + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError( + 'Each query pair must be an iterable [name, value] tuple'); + } + this[searchParams].push(pair[0], pair[1]); + } + } else { + // record + // Need to use reflection APIs for full spec compliance. + this[searchParams] = []; + const keys = Reflect.ownKeys(init); + for (var i = 0; i < keys.length; i++) { + const key = keys[i]; + const desc = Reflect.getOwnPropertyDescriptor(init, key); + if (desc !== undefined && desc.enumerable) { + const typedKey = toUSVString(key); + const typedValue = toUSVString(init[key]); + this[searchParams].push(typedKey, typedValue); + } + } + } + } else { + // USVString + init = toUSVString(init); + if (init[0] === '?') init = init.slice(1); + initSearchParams(this, init); + } + + // "associated url object" + this[context] = null; + } + + [util.inspect.custom](recurseTimes, ctx) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + + if (typeof recurseTimes === 'number' && recurseTimes < 0) + return ctx.stylize('[Object]', 'special'); + + var separator = ', '; + var innerOpts = util._extend({}, ctx); + if (recurseTimes !== null) { + innerOpts.depth = recurseTimes - 1; + } + var innerInspect = (v) => util.inspect(v, innerOpts); + + var list = this[searchParams]; + var output = []; + for (var i = 0; i < list.length; i += 2) + output.push(`${innerInspect(list[i])} => ${innerInspect(list[i + 1])}`); + + var colorRe = /\u001b\[\d\d?m/g; + var length = output.reduce( + (prev, cur) => prev + cur.replace(colorRe, '').length + separator.length, + -separator.length + ); + if (length > ctx.breakLength) { + return `${this.constructor.name} {\n ${output.join(',\n ')} }`; + } else if (output.length) { + return `${this.constructor.name} { ${output.join(separator)} }`; + } else { + return `${this.constructor.name} {}`; + } + } +} + +function onParseComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + var ctx = this[context]; + ctx.flags = flags; + ctx.scheme = protocol; + ctx.username = (flags & URL_FLAGS_HAS_USERNAME) !== 0 ? username : ''; + ctx.password = (flags & URL_FLAGS_HAS_PASSWORD) !== 0 ? password : ''; + ctx.port = port; + ctx.path = (flags & URL_FLAGS_HAS_PATH) !== 0 ? path : []; + ctx.query = query; + ctx.fragment = fragment; + ctx.host = host; + if (!this[searchParams]) { // invoked from URL constructor + this[searchParams] = new URLSearchParams(); + this[searchParams][context] = this; + } + initSearchParams(this[searchParams], query); +} + +function onParseError(flags, input) { + const error = new TypeError(`Invalid URL: ${input}`); + error.input = input; + throw error; +} + +// Reused by URL constructor and URL#href setter. +function parse(url, input, base) { + const base_context = base ? base[context] : undefined; + url[context] = new URLContext(); + _parse(input.trim(), -1, base_context, undefined, + onParseComplete.bind(url), onParseError); +} + +function onParseProtocolComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + const ctx = this[context]; + if ((flags & URL_FLAGS_SPECIAL) !== 0) { + ctx.flags |= URL_FLAGS_SPECIAL; + } else { + ctx.flags &= ~URL_FLAGS_SPECIAL; + } + ctx.scheme = protocol; + ctx.port = port; +} + +function onParseHostComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + const ctx = this[context]; + if ((flags & URL_FLAGS_HAS_HOST) !== 0) { + ctx.host = host; + ctx.flags |= URL_FLAGS_HAS_HOST; + } else { + ctx.host = null; + ctx.flags &= ~URL_FLAGS_HAS_HOST; + } + if (port !== null) + ctx.port = port; +} + +function onParseHostnameComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + const ctx = this[context]; + if ((flags & URL_FLAGS_HAS_HOST) !== 0) { + ctx.host = host; + ctx.flags |= URL_FLAGS_HAS_HOST; + } else { + ctx.host = null; + ctx.flags &= ~URL_FLAGS_HAS_HOST; + } +} + +function onParsePortComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + this[context].port = port; +} + +function onParsePathComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + const ctx = this[context]; + if ((flags & URL_FLAGS_HAS_PATH) !== 0) { + ctx.path = path; + ctx.flags |= URL_FLAGS_HAS_PATH; + } else { + ctx.path = []; + ctx.flags &= ~URL_FLAGS_HAS_PATH; + } + + // The C++ binding may set host to empty string. + if ((flags & URL_FLAGS_HAS_HOST) !== 0) { + ctx.host = host; + ctx.flags |= URL_FLAGS_HAS_HOST; + } +} + +function onParseSearchComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + this[context].query = query; +} + +function onParseHashComplete(flags, protocol, username, password, + host, port, path, query, fragment) { + this[context].fragment = fragment; +} + +class URL { + constructor(input, base) { + // toUSVString is not needed. + input = `${input}`; + if (base !== undefined && + (!base[searchParams] || !base[searchParams][searchParams])) { + base = new URL(base); + } + parse(this, input, base); + } + + get [special]() { + return (this[context].flags & URL_FLAGS_SPECIAL) !== 0; + } + + get [cannotBeBase]() { + return (this[context].flags & URL_FLAGS_CANNOT_BE_BASE) !== 0; + } + + // https://url.spec.whatwg.org/#cannot-have-a-username-password-port + get [cannotHaveUsernamePasswordPort]() { + const { host, scheme } = this[context]; + return ((host == null || host === '') || + this[cannotBeBase] || + scheme === 'file:'); + } + + [util.inspect.custom](depth, opts) { + if (this == null || + Object.getPrototypeOf(this[context]) !== URLContext.prototype) { + throw new TypeError('Value of "this" must be of type URL'); + } + + if (typeof depth === 'number' && depth < 0) + return opts.stylize('[Object]', 'special'); + + var ctor = getConstructorOf(this); + + var obj = Object.create({ + constructor: ctor === null ? URL : ctor + }); + + obj.href = this.href; + obj.origin = this.origin; + obj.protocol = this.protocol; + obj.username = this.username; + obj.password = this.password; + obj.host = this.host; + obj.hostname = this.hostname; + obj.port = this.port; + obj.pathname = this.pathname; + obj.search = this.search; + obj.searchParams = this.searchParams; + obj.hash = this.hash; + + if (opts.showHidden) { + obj.cannotBeBase = this[cannotBeBase]; + obj.special = this[special]; + obj[context] = this[context]; + } + + return util.inspect(obj, opts); + } +} + +Object.defineProperties(URL.prototype, { + [kFormat]: { + enumerable: false, + configurable: false, + // eslint-disable-next-line func-name-matching + value: function format(options) { + if (options && typeof options !== 'object') + throw new TypeError('The "options" argument must be of type Object'); + options = util._extend({ + fragment: true, + unicode: false, + search: true, + auth: true + }, options); + const ctx = this[context]; + var ret = ctx.scheme; + if (ctx.host !== null) { + ret += '//'; + const has_username = ctx.username !== ''; + const has_password = ctx.password !== ''; + if (options.auth && (has_username || has_password)) { + if (has_username) + ret += ctx.username; + if (has_password) + ret += `:${ctx.password}`; + ret += '@'; + } + ret += options.unicode ? + domainToUnicode(this.host) : this.host; + } else if (ctx.scheme === 'file:') { + ret += '//'; + } + if (this.pathname) + ret += this.pathname; + if (options.search && ctx.query !== null) + ret += `?${ctx.query}`; + if (options.fragment && ctx.fragment !== null) + ret += `#${ctx.fragment}`; + return ret; + } + }, + [Symbol.toStringTag]: { + configurable: true, + value: 'URL' + }, + toString: { + // https://heycam.github.io/webidl/#es-stringifier + writable: true, + enumerable: true, + configurable: true, + // eslint-disable-next-line func-name-matching + value: function toString() { + return this[kFormat]({}); + } + }, + href: { + enumerable: true, + configurable: true, + get() { + return this[kFormat]({}); + }, + set(input) { + // toUSVString is not needed. + input = `${input}`; + parse(this, input); + } + }, + origin: { // readonly + enumerable: true, + configurable: true, + get() { + // Refs: https://url.spec.whatwg.org/#concept-url-origin + const ctx = this[context]; + switch (ctx.scheme) { + case 'blob:': + if (ctx.path.length > 0) { + try { + return (new URL(ctx.path[0])).origin; + } catch (err) { + // fall through... do nothing + } + } + return kOpaqueOrigin; + case 'ftp:': + case 'gopher:': + case 'http:': + case 'https:': + case 'ws:': + case 'wss:': + return serializeTupleOrigin(ctx.scheme, ctx.host, ctx.port); + } + return kOpaqueOrigin; + } + }, + protocol: { + enumerable: true, + configurable: true, + get() { + return this[context].scheme; + }, + set(scheme) { + // toUSVString is not needed. + scheme = `${scheme}`; + if (scheme.length === 0) + return; + const ctx = this[context]; + if (ctx.scheme === 'file:' && + (ctx.host === '' || ctx.host === null)) { + return; + } + _parse(scheme, kSchemeStart, null, ctx, + onParseProtocolComplete.bind(this)); + } + }, + username: { + enumerable: true, + configurable: true, + get() { + return this[context].username; + }, + set(username) { + // toUSVString is not needed. + username = `${username}`; + if (this[cannotHaveUsernamePasswordPort]) + return; + const ctx = this[context]; + if (username === '') { + ctx.username = ''; + ctx.flags &= ~URL_FLAGS_HAS_USERNAME; + return; + } + ctx.username = encodeAuth(username); + ctx.flags |= URL_FLAGS_HAS_USERNAME; + } + }, + password: { + enumerable: true, + configurable: true, + get() { + return this[context].password; + }, + set(password) { + // toUSVString is not needed. + password = `${password}`; + if (this[cannotHaveUsernamePasswordPort]) + return; + const ctx = this[context]; + if (password === '') { + ctx.password = ''; + ctx.flags &= ~URL_FLAGS_HAS_PASSWORD; + return; + } + ctx.password = encodeAuth(password); + ctx.flags |= URL_FLAGS_HAS_PASSWORD; + } + }, + host: { + enumerable: true, + configurable: true, + get() { + const ctx = this[context]; + var ret = ctx.host || ''; + if (ctx.port !== null) + ret += `:${ctx.port}`; + return ret; + }, + set(host) { + const ctx = this[context]; + // toUSVString is not needed. + host = `${host}`; + if (this[cannotBeBase]) { + // Cannot set the host if cannot-be-base is set + return; + } + _parse(host, kHost, null, ctx, onParseHostComplete.bind(this)); + } + }, + hostname: { + enumerable: true, + configurable: true, + get() { + return this[context].host || ''; + }, + set(host) { + const ctx = this[context]; + // toUSVString is not needed. + host = `${host}`; + if (this[cannotBeBase]) { + // Cannot set the host if cannot-be-base is set + return; + } + _parse(host, kHostname, null, ctx, onParseHostnameComplete.bind(this)); + } + }, + port: { + enumerable: true, + configurable: true, + get() { + const port = this[context].port; + return port === null ? '' : String(port); + }, + set(port) { + // toUSVString is not needed. + port = `${port}`; + if (this[cannotHaveUsernamePasswordPort]) + return; + const ctx = this[context]; + if (port === '') { + ctx.port = null; + return; + } + _parse(port, kPort, null, ctx, onParsePortComplete.bind(this)); + } + }, + pathname: { + enumerable: true, + configurable: true, + get() { + const ctx = this[context]; + if (this[cannotBeBase]) + return ctx.path[0]; + if (ctx.path.length === 0) + return ''; + return `/${ctx.path.join('/')}`; + }, + set(path) { + // toUSVString is not needed. + path = `${path}`; + if (this[cannotBeBase]) + return; + _parse(path, kPathStart, null, this[context], + onParsePathComplete.bind(this)); + } + }, + search: { + enumerable: true, + configurable: true, + get() { + const { query } = this[context]; + if (query === null || query === '') + return ''; + return `?${query}`; + }, + set(search) { + const ctx = this[context]; + search = toUSVString(search); + if (search === '') { + ctx.query = null; + ctx.flags &= ~URL_FLAGS_HAS_QUERY; + } else { + if (search[0] === '?') search = search.slice(1); + ctx.query = ''; + ctx.flags |= URL_FLAGS_HAS_QUERY; + if (search) { + _parse(search, kQuery, null, ctx, onParseSearchComplete.bind(this)); + } + } + initSearchParams(this[searchParams], search); + } + }, + searchParams: { // readonly + enumerable: true, + configurable: true, + get() { + return this[searchParams]; + } + }, + hash: { + enumerable: true, + configurable: true, + get() { + const { fragment } = this[context]; + if (fragment === null || fragment === '') + return ''; + return `#${fragment}`; + }, + set(hash) { + const ctx = this[context]; + // toUSVString is not needed. + hash = `${hash}`; + if (!hash) { + ctx.fragment = null; + ctx.flags &= ~URL_FLAGS_HAS_FRAGMENT; + return; + } + if (hash[0] === '#') hash = hash.slice(1); + ctx.fragment = ''; + ctx.flags |= URL_FLAGS_HAS_FRAGMENT; + _parse(hash, kFragment, null, ctx, onParseHashComplete.bind(this)); + } + }, + toJSON: { + writable: true, + enumerable: true, + configurable: true, + // eslint-disable-next-line func-name-matching + value: function toJSON() { + return this[kFormat]({}); + } + } +}); + +function update(url, params) { + if (!url) + return; + + const ctx = url[context]; + const serializedParams = params.toString(); + if (serializedParams) { + ctx.query = serializedParams; + ctx.flags |= URL_FLAGS_HAS_QUERY; + } else { + ctx.query = null; + ctx.flags &= ~URL_FLAGS_HAS_QUERY; + } +} + +function initSearchParams(url, init) { + if (!init) { + url[searchParams] = []; + return; + } + url[searchParams] = parseParams(init); +} + +// application/x-www-form-urlencoded parser +// Ref: https://url.spec.whatwg.org/#concept-urlencoded-parser +function parseParams(qs) { + const out = []; + var pairStart = 0; + var lastPos = 0; + var seenSep = false; + var buf = ''; + var encoded = false; + var encodeCheck = 0; + var i; + for (i = 0; i < qs.length; ++i) { + const code = qs.charCodeAt(i); + + // Try matching key/value pair separator + if (code === 38/*&*/) { + if (pairStart === i) { + // We saw an empty substring between pair separators + lastPos = pairStart = i + 1; + continue; + } + + if (lastPos < i) + buf += qs.slice(lastPos, i); + if (encoded) + buf = querystring.unescape(buf); + out.push(buf); + + // If `buf` is the key, add an empty value. + if (!seenSep) + out.push(''); + + seenSep = false; + buf = ''; + encoded = false; + encodeCheck = 0; + lastPos = pairStart = i + 1; + continue; + } + + // Try matching key/value separator (e.g. '=') if we haven't already + if (!seenSep && code === 61/*=*/) { + // Key/value separator match! + if (lastPos < i) + buf += qs.slice(lastPos, i); + if (encoded) + buf = querystring.unescape(buf); + out.push(buf); + + seenSep = true; + buf = ''; + encoded = false; + encodeCheck = 0; + lastPos = i + 1; + continue; + } + + // Handle + and percent decoding. + if (code === 43/*+*/) { + if (lastPos < i) + buf += qs.slice(lastPos, i); + buf += ' '; + lastPos = i + 1; + } else if (!encoded) { + // Try to match an (valid) encoded byte (once) to minimize unnecessary + // calls to string decoding functions + if (code === 37/*%*/) { + encodeCheck = 1; + } else if (encodeCheck > 0) { + // eslint-disable-next-line no-extra-boolean-cast + if (!!isHexTable[code]) { + if (++encodeCheck === 3) + encoded = true; + } else { + encodeCheck = 0; + } + } + } + } + + // Deal with any leftover key or value data + + // There is a trailing &. No more processing is needed. + if (pairStart === i) + return out; + + if (lastPos < i) + buf += qs.slice(lastPos, i); + if (encoded) + buf = querystring.unescape(buf); + out.push(buf); + + // If `buf` is the key, add an empty value. + if (!seenSep) + out.push(''); + + return out; +} + +// Adapted from querystring's implementation. +// Ref: https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer +const noEscape = [ +//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x00 - 0x0F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x10 - 0x1F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, // 0x20 - 0x2F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 0x30 - 0x3F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 0x4F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 0x50 - 0x5F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 0x70 - 0x7F +]; + +// Special version of hexTable that uses `+` for U+0020 SPACE. +const paramHexTable = hexTable.slice(); +paramHexTable[0x20] = '+'; + +function escapeParam(str) { + const len = str.length; + if (len === 0) + return ''; + + var out = ''; + var lastPos = 0; + + for (var i = 0; i < len; i++) { + var c = str.charCodeAt(i); + + // ASCII + if (c < 0x80) { + if (noEscape[c] === 1) + continue; + if (lastPos < i) + out += str.slice(lastPos, i); + lastPos = i + 1; + out += paramHexTable[c]; + continue; + } + + if (lastPos < i) + out += str.slice(lastPos, i); + + // Multi-byte characters ... + if (c < 0x800) { + lastPos = i + 1; + out += paramHexTable[0xC0 | (c >> 6)] + + paramHexTable[0x80 | (c & 0x3F)]; + continue; + } + if (c < 0xD800 || c >= 0xE000) { + lastPos = i + 1; + out += paramHexTable[0xE0 | (c >> 12)] + + paramHexTable[0x80 | ((c >> 6) & 0x3F)] + + paramHexTable[0x80 | (c & 0x3F)]; + continue; + } + // Surrogate pair + ++i; + var c2; + if (i < len) + c2 = str.charCodeAt(i) & 0x3FF; + else { + // This branch should never happen because all URLSearchParams entries + // should already be converted to USVString. But, included for + // completion's sake anyway. + c2 = 0; + } + lastPos = i + 1; + c = 0x10000 + (((c & 0x3FF) << 10) | c2); + out += paramHexTable[0xF0 | (c >> 18)] + + paramHexTable[0x80 | ((c >> 12) & 0x3F)] + + paramHexTable[0x80 | ((c >> 6) & 0x3F)] + + paramHexTable[0x80 | (c & 0x3F)]; + } + if (lastPos === 0) + return str; + if (lastPos < len) + return out + str.slice(lastPos); + return out; +} + +// application/x-www-form-urlencoded serializer +// Ref: https://url.spec.whatwg.org/#concept-urlencoded-serializer +function serializeParams(array) { + const len = array.length; + if (len === 0) + return ''; + + var output = `${escapeParam(array[0])}=${escapeParam(array[1])}`; + for (var i = 2; i < len; i += 2) + output += `&${escapeParam(array[i])}=${escapeParam(array[i + 1])}`; + return output; +} + +// Mainly to mitigate func-name-matching ESLint rule +function defineIDLClass(proto, classStr, obj) { + // https://heycam.github.io/webidl/#dfn-class-string + Object.defineProperty(proto, Symbol.toStringTag, { + writable: false, + enumerable: false, + configurable: true, + value: classStr + }); + + // https://heycam.github.io/webidl/#es-operations + for (const key of Object.keys(obj)) { + Object.defineProperty(proto, key, { + writable: true, + enumerable: true, + configurable: true, + value: obj[key] + }); + } + for (const key of Object.getOwnPropertySymbols(obj)) { + Object.defineProperty(proto, key, { + writable: true, + enumerable: false, + configurable: true, + value: obj[key] + }); + } +} + +// for merge sort +function merge(out, start, mid, end, lBuffer, rBuffer) { + const sizeLeft = mid - start; + const sizeRight = end - mid; + var l, r, o; + + for (l = 0; l < sizeLeft; l++) + lBuffer[l] = out[start + l]; + for (r = 0; r < sizeRight; r++) + rBuffer[r] = out[mid + r]; + + l = 0; + r = 0; + o = start; + while (l < sizeLeft && r < sizeRight) { + if (lBuffer[l] <= rBuffer[r]) { + out[o++] = lBuffer[l++]; + out[o++] = lBuffer[l++]; + } else { + out[o++] = rBuffer[r++]; + out[o++] = rBuffer[r++]; + } + } + while (l < sizeLeft) + out[o++] = lBuffer[l++]; + while (r < sizeRight) + out[o++] = rBuffer[r++]; +} + +defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { + append(name, value) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (arguments.length < 2) { + throw new TypeError('The "name" and "value" arguments must be specified'); + } + + name = toUSVString(name); + value = toUSVString(value); + this[searchParams].push(name, value); + update(this[context], this); + }, + + delete(name) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (arguments.length < 1) { + throw new TypeError('The "name" argument must be specified'); + } + + const list = this[searchParams]; + name = toUSVString(name); + for (var i = 0; i < list.length;) { + const cur = list[i]; + if (cur === name) { + list.splice(i, 2); + } else { + i += 2; + } + } + update(this[context], this); + }, + + get(name) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (arguments.length < 1) { + throw new TypeError('The "name" argument must be specified'); + } + + const list = this[searchParams]; + name = toUSVString(name); + for (var i = 0; i < list.length; i += 2) { + if (list[i] === name) { + return list[i + 1]; + } + } + return null; + }, + + getAll(name) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (arguments.length < 1) { + throw new TypeError('The "name" argument must be specified'); + } + + const list = this[searchParams]; + const values = []; + name = toUSVString(name); + for (var i = 0; i < list.length; i += 2) { + if (list[i] === name) { + values.push(list[i + 1]); + } + } + return values; + }, + + has(name) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (arguments.length < 1) { + throw new TypeError('The "name" argument must be specified'); + } + + const list = this[searchParams]; + name = toUSVString(name); + for (var i = 0; i < list.length; i += 2) { + if (list[i] === name) { + return true; + } + } + return false; + }, + + set(name, value) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (arguments.length < 2) { + throw new TypeError('The "name" and "value" arguments must be specified'); + } + + const list = this[searchParams]; + name = toUSVString(name); + value = toUSVString(value); + + // If there are any name-value pairs whose name is `name`, in `list`, set + // the value of the first such name-value pair to `value` and remove the + // others. + var found = false; + for (var i = 0; i < list.length;) { + const cur = list[i]; + if (cur === name) { + if (!found) { + list[i + 1] = value; + found = true; + i += 2; + } else { + list.splice(i, 2); + } + } else { + i += 2; + } + } + + // Otherwise, append a new name-value pair whose name is `name` and value + // is `value`, to `list`. + if (!found) { + list.push(name, value); + } + + update(this[context], this); + }, + + sort() { + const a = this[searchParams]; + const len = a.length; + + if (len <= 2) { + // Nothing needs to be done. + } else if (len < 100) { + // 100 is found through testing. + // Simple stable in-place insertion sort + // Derived from v8/src/js/array.js + for (var i = 2; i < len; i += 2) { + var curKey = a[i]; + var curVal = a[i + 1]; + var j; + for (j = i - 2; j >= 0; j -= 2) { + if (a[j] > curKey) { + a[j + 2] = a[j]; + a[j + 3] = a[j + 1]; + } else { + break; + } + } + a[j + 2] = curKey; + a[j + 3] = curVal; + } + } else { + // Bottom-up iterative stable merge sort + const lBuffer = new Array(len); + const rBuffer = new Array(len); + for (var step = 2; step < len; step *= 2) { + for (var start = 0; start < len - 2; start += 2 * step) { + var mid = start + step; + var end = mid + step; + end = end < len ? end : len; + if (mid > end) + continue; + merge(a, start, mid, end, lBuffer, rBuffer); + } + } + } + + update(this[context], this); + }, + + // https://heycam.github.io/webidl/#es-iterators + // Define entries here rather than [Symbol.iterator] as the function name + // must be set to `entries`. + entries() { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + + return createSearchParamsIterator(this, 'key+value'); + }, + + forEach(callback, thisArg = undefined) { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + if (typeof callback !== 'function') { + throw new TypeError('Callback must be a function'); + } + + let list = this[searchParams]; + + var i = 0; + while (i < list.length) { + const key = list[i]; + const value = list[i + 1]; + callback.call(thisArg, value, key, this); + // in case the URL object's `search` is updated + list = this[searchParams]; + i += 2; + } + }, + + // https://heycam.github.io/webidl/#es-iterable + keys() { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + + return createSearchParamsIterator(this, 'key'); + }, + + values() { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + + return createSearchParamsIterator(this, 'value'); + }, + + // https://heycam.github.io/webidl/#es-stringifier + // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior + toString() { + if (!this || !this[searchParams] || this[searchParams][searchParams]) { + throw new TypeError('Value of "this" must be of type URLSearchParams'); + } + + return serializeParams(this[searchParams]); + } +}); + +// https://heycam.github.io/webidl/#es-iterable-entries +Object.defineProperty(URLSearchParams.prototype, Symbol.iterator, { + writable: true, + configurable: true, + value: URLSearchParams.prototype.entries +}); + +// https://heycam.github.io/webidl/#dfn-default-iterator-object +function createSearchParamsIterator(target, kind) { + const iterator = Object.create(URLSearchParamsIteratorPrototype); + iterator[context] = { + target, + kind, + index: 0 + }; + return iterator; +} + +// https://heycam.github.io/webidl/#dfn-iterator-prototype-object +const URLSearchParamsIteratorPrototype = Object.create(IteratorPrototype); + +defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParamsIterator', { + next() { + if (!this || + Object.getPrototypeOf(this) !== URLSearchParamsIteratorPrototype) { + throw new TypeError( + 'Value of "this" must be of type URLSearchParamsIterator'); + } + + const { + target, + kind, + index + } = this[context]; + const values = target[searchParams]; + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } + + const name = values[index]; + const value = values[index + 1]; + this[context].index = index + 2; + + let result; + if (kind === 'key') { + result = name; + } else if (kind === 'value') { + result = value; + } else { + result = [name, value]; + } + + return { + value: result, + done: false + }; + }, + [util.inspect.custom](recurseTimes, ctx) { + if (this == null || this[context] == null || this[context].target == null) + throw new TypeError( + 'Value of "this" must be of type URLSearchParamsIterator'); + + if (typeof recurseTimes === 'number' && recurseTimes < 0) + return ctx.stylize('[Object]', 'special'); + + const innerOpts = util._extend({}, ctx); + if (recurseTimes !== null) { + innerOpts.depth = recurseTimes - 1; + } + const { + target, + kind, + index + } = this[context]; + const output = target[searchParams].slice(index).reduce((prev, cur, i) => { + const key = i % 2 === 0; + if (kind === 'key' && key) { + prev.push(cur); + } else if (kind === 'value' && !key) { + prev.push(cur); + } else if (kind === 'key+value' && !key) { + prev.push([target[searchParams][index + i - 1], cur]); + } + return prev; + }, []); + const breakLn = util.inspect(output, innerOpts).includes('\n'); + const outputStrs = output.map((p) => util.inspect(p, innerOpts)); + let outputStr; + if (breakLn) { + outputStr = `\n ${outputStrs.join(',\n ')}`; + } else { + outputStr = ` ${outputStrs.join(', ')}`; + } + return `${this[Symbol.toStringTag]} {${outputStr} }`; + } +}); + +function domainToASCII(domain) { + if (arguments.length < 1) + throw new TypeError('The "domain" argument must be specified'); + + // toUSVString is not needed. + return _domainToASCII(`${domain}`); +} + +function domainToUnicode(domain) { + if (arguments.length < 1) + throw new TypeError('The "domain" argument must be specified'); + + // toUSVString is not needed. + return _domainToUnicode(`${domain}`); +} + +// Utility function that converts a URL object into an ordinary +// options object as expected by the http.request and https.request +// APIs. +function urlToOptions(url) { + var options = { + protocol: url.protocol, + hostname: url.hostname, + hash: url.hash, + search: url.search, + pathname: url.pathname, + path: `${url.pathname}${url.search}`, + href: url.href + }; + if (url.port !== '') { + options.port = Number(url.port); + } + if (url.username || url.password) { + options.auth = `${url.username}:${url.password}`; + } + return options; +} + +function getPathFromURLWin32(url) { + var hostname = url.hostname; + var pathname = url.pathname; + for (var n = 0; n < pathname.length; n++) { + if (pathname[n] === '%') { + var third = pathname.codePointAt(n + 2) | 0x20; + if ((pathname[n + 1] === '2' && third === 102) || // 2f 2F / + (pathname[n + 1] === '5' && third === 99)) { // 5c 5C \ + return new TypeError( + 'File URL path must not include encoded \\ or / characters'); + } + } + } + pathname = decodeURIComponent(pathname); + if (hostname !== '') { + // If hostname is set, then we have a UNC path + // Pass the hostname through domainToUnicode just in case + // it is an IDN using punycode encoding. We do not need to worry + // about percent encoding because the URL parser will have + // already taken care of that for us. Note that this only + // causes IDNs with an appropriate `xn--` prefix to be decoded. + return `//${domainToUnicode(hostname)}${pathname}`; + } else { + // Otherwise, it's a local path that requires a drive letter + var letter = pathname.codePointAt(1) | 0x20; + var sep = pathname[2]; + if (letter < 97 || letter > 122 || // a..z A..Z + (sep !== ':')) { + return new TypeError('File URL path must be absolute'); + } + return pathname.slice(1); + } +} + +function getPathFromURLPosix(url) { + if (url.hostname !== '') { + return new TypeError( + `File URL host must be "localhost" or empty on ${platform}`); + } + var pathname = url.pathname; + for (var n = 0; n < pathname.length; n++) { + if (pathname[n] === '%') { + var third = pathname.codePointAt(n + 2) | 0x20; + if (pathname[n + 1] === '2' && third === 102) { + return new TypeError( + 'File URL path must not include encoded / characters'); + } + } + } + return decodeURIComponent(pathname); +} + +function getPathFromURL(path) { + if (path == null || !path[searchParams] || + !path[searchParams][searchParams]) { + return path; + } + if (path.protocol !== 'file:') + return new TypeError('The URL must be of scheme file'); + return isWindows ? getPathFromURLWin32(path) : getPathFromURLPosix(path); +} + +// We percent-encode % character when converting from file path to URL, +// as this is the only character that won't be percent encoded by +// default URL percent encoding when pathname is set. +const percentRegEx = /%/g; +function getURLFromFilePath(filepath) { + const tmp = new URL('file://'); + if (filepath.includes('%')) + filepath = filepath.replace(percentRegEx, '%25'); + tmp.pathname = filepath; + return tmp; +} + +function NativeURL(ctx) { + this[context] = ctx; +} +NativeURL.prototype = URL.prototype; + +function constructUrl(flags, protocol, username, password, + host, port, path, query, fragment) { + var ctx = new URLContext(); + ctx.flags = flags; + ctx.scheme = protocol; + ctx.username = (flags & URL_FLAGS_HAS_USERNAME) !== 0 ? username : ''; + ctx.password = (flags & URL_FLAGS_HAS_PASSWORD) !== 0 ? password : ''; + ctx.port = port; + ctx.path = (flags & URL_FLAGS_HAS_PATH) !== 0 ? path : []; + ctx.query = query; + ctx.fragment = fragment; + ctx.host = host; + const url = new NativeURL(ctx); + url[searchParams] = new URLSearchParams(); + url[searchParams][context] = url; + initSearchParams(url[searchParams], query); + return url; +} +setURLConstructor(constructUrl); + +module.exports = { + toUSVString, + getPathFromURL, + getURLFromFilePath, + URL, + URLSearchParams, + domainToASCII, + domainToUnicode, + urlToOptions, + formatSymbol: kFormat, + searchParamsSymbol: searchParams +}; diff --git a/lib/internal/util.js b/lib/internal/util.js index 58aa011c08c6b9..f66698295f33e7 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -6,6 +6,21 @@ const prefix = `(${process.release.name}:${process.pid}) `; exports.getHiddenValue = binding.getHiddenValue; exports.setHiddenValue = binding.setHiddenValue; +exports.getConstructorOf = function getConstructorOf(obj) { + while (obj) { + var descriptor = Object.getOwnPropertyDescriptor(obj, 'constructor'); + if (descriptor !== undefined && + typeof descriptor.value === 'function' && + descriptor.value.name !== '') { + return descriptor.value; + } + + obj = Object.getPrototypeOf(obj); + } + + return null; +}; + // The `buffer` module uses this. Defining it here instead of in the public // `util` module makes it accessible without having to `require('util')` there. exports.customInspectSymbol = Symbol('util.inspect.custom'); diff --git a/lib/module.js b/lib/module.js index 537a2dcafb31d0..3b258f051bd4ca 100644 --- a/lib/module.js +++ b/lib/module.js @@ -48,9 +48,16 @@ function Module(id, parent) { } module.exports = Module; +const builtinModules = Object.keys(NativeModule._source) + .filter(NativeModule.nonInternalExists); + +Object.freeze(builtinModules); +Module.builtinModules = builtinModules; + Module._cache = {}; Module._pathCache = {}; Module._extensions = {}; + var modulePaths = []; Module.globalPaths = []; diff --git a/lib/net.js b/lib/net.js index 78337cda6dd808..c819ac1516ebef 100644 --- a/lib/net.js +++ b/lib/net.js @@ -444,6 +444,8 @@ Socket.prototype.end = function(data, encoding) { this.read(0); else maybeDestroy(this); + + return this; }; @@ -1485,7 +1487,8 @@ Server.prototype.getConnections = function(cb) { } if (!this._usingSlaves) { - return end(null, this._connections); + end(null, this._connections); + return this; } // Poll slaves @@ -1505,6 +1508,8 @@ Server.prototype.getConnections = function(cb) { this._slaves.forEach(function(slave) { slave.getConnections(oncount); }); + + return this; }; diff --git a/lib/querystring.js b/lib/querystring.js index 5ccb5fa77b320f..668628cdc386f6 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -1,5 +1,6 @@ 'use strict'; +const { hexTable } = require('internal/querystring'); const QueryString = module.exports = { unescapeBuffer, // `unescape()` is a JS global, so we need to use a different local name @@ -116,10 +117,6 @@ function qsUnescape(s, decodeSpaces) { } -const hexTable = []; -for (var i = 0; i < 256; ++i) - hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); - // These characters do not need escaping when generating query strings: // ! - . _ ~ // ' ( ) * diff --git a/lib/repl.js b/lib/repl.js index f841b3e3eff34b..2287af180899ce 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -870,7 +870,18 @@ function complete(line, callback) { filter = match[1]; var dir, files, f, name, base, ext, abs, subfiles, s; group = []; - var paths = module.paths.concat(Module.globalPaths); + let paths = []; + + if (completeOn === '.') { + group = ['./', '../']; + } else if (completeOn === '..') { + group = ['../']; + } else if (/^\.\.?\//.test(completeOn)) { + paths = [process.cwd()]; + } else { + paths = module.paths.concat(Module.globalPaths); + } + for (i = 0; i < paths.length; i++) { dir = path.resolve(paths[i], subdir); try { diff --git a/lib/url.js b/lib/url.js index 214c8a93204e70..980a2b2a1f00f2 100644 --- a/lib/url.js +++ b/lib/url.js @@ -3,12 +3,17 @@ const { toASCII } = process.binding('config').hasIntl ? process.binding('icu') : require('punycode'); -exports.parse = urlParse; -exports.resolve = urlResolve; -exports.resolveObject = urlResolveObject; -exports.format = urlFormat; +const { hexTable } = require('internal/querystring'); -exports.Url = Url; +// WHATWG URL implementation provided by internal/url +const { + URL, + URLSearchParams, + domainToASCII, + domainToUnicode +} = require('internal/url'); + +// Original url.parse() API function Url() { this.protocol = null; @@ -311,7 +316,10 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. - this.hostname = toASCII(this.hostname); + + // Use lenient mode (`true`) to try to support even non-compliant + // URLs. + this.hostname = toASCII(this.hostname, true); } var p = this.port ? ':' + this.port : ''; @@ -939,10 +947,6 @@ function spliceOne(list, index) { list.pop(); } -var hexTable = new Array(256); -for (var i = 0; i < 256; ++i) - hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); - // These characters do not need escaping: // ! - . _ ~ // ' ( ) * : @@ -1014,3 +1018,18 @@ function encodeAuth(str) { return out + str.slice(lastPos); return out; } + +module.exports = { + // Original API + Url, + parse: urlParse, + resolve: urlResolve, + resolveObject: urlResolveObject, + format: urlFormat, + + // WHATWG API + URL, + URLSearchParams, + domainToASCII, + domainToUnicode +}; diff --git a/lib/util.js b/lib/util.js index 2a3a5cb797f176..8c476d59e2034b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -279,22 +279,6 @@ function arrayToHash(array) { } -function getConstructorOf(obj) { - while (obj) { - var descriptor = Object.getOwnPropertyDescriptor(obj, 'constructor'); - if (descriptor !== undefined && - typeof descriptor.value === 'function' && - descriptor.value.name !== '') { - return descriptor.value; - } - - obj = Object.getPrototypeOf(obj); - } - - return null; -} - - function ensureDebugIsInitialized() { if (Debug === undefined) { const runInDebugContext = require('vm').runInDebugContext; @@ -454,12 +438,12 @@ function formatValue(ctx, value, recurseTimes) { // Can't do the same for DataView because it has a non-primitive // .buffer property that we need to recurse for. if (binding.isArrayBuffer(value) || binding.isSharedArrayBuffer(value)) { - return `${getConstructorOf(value).name}` + + return `${internalUtil.getConstructorOf(value).name}` + ` { byteLength: ${formatNumber(ctx, value.byteLength)} }`; } } - var constructor = getConstructorOf(value); + var constructor = internalUtil.getConstructorOf(value); var base = '', empty = false, braces; var formatter = formatObject; diff --git a/node.gyp b/node.gyp index 1b17d991ae3244..8a7af9bfd1e50a 100644 --- a/node.gyp +++ b/node.gyp @@ -86,9 +86,11 @@ 'lib/internal/process/stdio.js', 'lib/internal/process/warning.js', 'lib/internal/process.js', + 'lib/internal/querystring.js', 'lib/internal/readline.js', 'lib/internal/repl.js', 'lib/internal/socket_list.js', + 'lib/internal/url.js', 'lib/internal/util.js', 'lib/internal/v8_prof_polyfill.js', 'lib/internal/v8_prof_processor.js', @@ -162,6 +164,7 @@ 'src/node_main.cc', 'src/node_os.cc', 'src/node_revert.cc', + 'src/node_url.cc', 'src/node_util.cc', 'src/node_v8.cc', 'src/node_stat_watcher.cc', @@ -231,18 +234,28 @@ '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc', ], + 'variables': { + 'openssl_system_ca_path%': '', + }, + 'defines': [ 'NODE_ARCH="<(target_arch)"', 'NODE_PLATFORM="<(OS)"', 'NODE_WANT_INTERNALS=1', # Warn when using deprecated V8 APIs. 'V8_DEPRECATION_WARNINGS=1', + 'NODE_OPENSSL_SYSTEM_CERT_PATH="<(openssl_system_ca_path)"', ], 'conditions': [ [ 'node_shared=="true" and node_module_version!="" and OS!="win"', { 'product_extension': '<(shlib_suffix)', }] ], + 'direct_dependent_settings': { + 'defines': [ + 'NODE_OPENSSL_SYSTEM_CERT_PATH="<(openssl_system_ca_path)"', + ], + }, }, { 'target_name': 'mkssldef', @@ -588,6 +601,7 @@ '<(OBJ_PATH)/node.<(OBJ_SUFFIX)', '<(OBJ_PATH)/node_buffer.<(OBJ_SUFFIX)', '<(OBJ_PATH)/node_i18n.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_url.<(OBJ_SUFFIX)', '<(OBJ_PATH)/debug-agent.<(OBJ_SUFFIX)', '<(OBJ_PATH)/util.<(OBJ_SUFFIX)', '<(OBJ_PATH)/string_bytes.<(OBJ_SUFFIX)', @@ -611,6 +625,7 @@ 'sources': [ 'test/cctest/test_base64.cc', 'test/cctest/test_util.cc', + 'test/cctest/test_url.cc' ], 'sources!': [ diff --git a/src/env.h b/src/env.h index 940c97fe4ddbf1..c4489857161b75 100644 --- a/src/env.h +++ b/src/env.h @@ -252,6 +252,7 @@ namespace node { V(tls_wrap_constructor_template, v8::FunctionTemplate) \ V(tty_constructor_template, v8::FunctionTemplate) \ V(udp_constructor_function, v8::Function) \ + V(url_constructor_function, v8::Function) \ V(write_wrap_constructor_function, v8::Function) \ class Environment; diff --git a/src/node.cc b/src/node.cc index 20deda5034f5d1..8ab9e4d1f45f51 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2950,6 +2950,12 @@ static void EnvEnumerator(const PropertyCallbackInfo& info) { } +static void GetParentProcessId(Local property, + const PropertyCallbackInfo& info) { + info.GetReturnValue().Set(Integer::New(info.GetIsolate(), uv_os_getppid())); +} + + static Local GetFeatures(Environment* env) { EscapableHandleScope scope(env->isolate()); @@ -3305,6 +3311,9 @@ void SetupProcessObject(Environment* env, READONLY_PROPERTY(process, "pid", Integer::New(env->isolate(), getpid())); READONLY_PROPERTY(process, "features", GetFeatures(env)); + process->SetAccessor(FIXED_ONE_BYTE_STRING(env->isolate(), "ppid"), + GetParentProcessId); + auto need_immediate_callback_string = FIXED_ONE_BYTE_STRING(env->isolate(), "_needImmediateCallback"); CHECK(process->SetAccessor(env->context(), need_immediate_callback_string, @@ -3878,6 +3887,10 @@ static void ParseArgs(int* argc, const char** new_exec_argv = new const char*[nargs]; const char** new_v8_argv = new const char*[nargs]; const char** new_argv = new const char*[nargs]; +#if HAVE_OPENSSL + bool use_bundled_ca = false; + bool use_openssl_ca = false; +#endif // HAVE_OPENSSL for (unsigned int i = 0; i < nargs; ++i) { new_exec_argv[i] = nullptr; @@ -3983,7 +3996,9 @@ static void ParseArgs(int* argc, default_cipher_list = arg + 18; } else if (strncmp(arg, "--use-openssl-ca", 16) == 0) { ssl_openssl_cert_store = true; + use_openssl_ca = true; } else if (strncmp(arg, "--use-bundled-ca", 16) == 0) { + use_bundled_ca = true; ssl_openssl_cert_store = false; #if NODE_FIPS_MODE } else if (strcmp(arg, "--enable-fips") == 0) { @@ -4018,6 +4033,16 @@ static void ParseArgs(int* argc, index += args_consumed; } +#if HAVE_OPENSSL + if (use_openssl_ca && use_bundled_ca) { + fprintf(stderr, + "%s: either --use-openssl-ca or --use-bundled-ca can be used, " + "not both\n", + argv[0]); + exit(9); + } +#endif + // Copy remaining arguments. const unsigned int args_left = nargs - index; diff --git a/src/node_crypto.cc b/src/node_crypto.cc index af892d4367c5da..70b5602a4eda13 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -124,6 +124,8 @@ static const char* const root_certs[] = { #include "node_root_certs.h" // NOLINT(build/include_order) }; +static const char system_cert_path[] = NODE_OPENSSL_SYSTEM_CERT_PATH; + static std::string extra_root_certs_file; // NOLINT(runtime/string) static X509_STORE* root_cert_store; @@ -724,6 +726,9 @@ static X509_STORE* NewRootCertStore() { } X509_STORE* store = X509_STORE_new(); + if (*system_cert_path != '\0') { + X509_STORE_load_locations(store, system_cert_path, nullptr); + } if (ssl_openssl_cert_store) { X509_STORE_set_default_paths(store); } else { @@ -5595,11 +5600,18 @@ void PBKDF2(const FunctionCallbackInfo& args) { // Only instantiate within a valid HandleScope. class RandomBytesRequest : public AsyncWrap { public: - RandomBytesRequest(Environment* env, Local object, size_t size) + enum FreeMode { FREE_DATA, DONT_FREE_DATA }; + + RandomBytesRequest(Environment* env, + Local object, + size_t size, + char* data, + FreeMode free_mode) : AsyncWrap(env, object, AsyncWrap::PROVIDER_CRYPTO), error_(0), size_(size), - data_(node::Malloc(size)) { + data_(data), + free_mode_(free_mode) { Wrap(object, this); } @@ -5620,9 +5632,15 @@ class RandomBytesRequest : public AsyncWrap { return data_; } + inline void set_data(char* data) { + data_ = data; + } + inline void release() { - free(data_); size_ = 0; + if (free_mode_ == FREE_DATA) { + free(data_); + } } inline void return_memory(char** d, size_t* len) { @@ -5648,6 +5666,7 @@ class RandomBytesRequest : public AsyncWrap { unsigned long error_; // NOLINT(runtime/int) size_t size_; char* data_; + const FreeMode free_mode_; }; @@ -5686,7 +5705,18 @@ void RandomBytesCheck(RandomBytesRequest* req, Local argv[2]) { size_t size; req->return_memory(&data, &size); argv[0] = Null(req->env()->isolate()); - argv[1] = Buffer::New(req->env(), data, size).ToLocalChecked(); + Local buffer = + req->object()->Get(req->env()->context(), + req->env()->buffer_string()).ToLocalChecked(); + + if (buffer->IsUint8Array()) { + CHECK_LE(req->size(), Buffer::Length(buffer)); + char* buf = Buffer::Data(buffer); + memcpy(buf, data, req->size()); + argv[1] = buffer; + } else { + argv[1] = Buffer::New(req->env(), data, size).ToLocalChecked(); + } } } @@ -5705,11 +5735,22 @@ void RandomBytesAfter(uv_work_t* work_req, int status) { } +void RandomBytesProcessSync(Environment* env, + RandomBytesRequest* req, + Local argv[2]) { + env->PrintSyncTrace(); + RandomBytesWork(req->work_req()); + RandomBytesCheck(req, argv); + delete req; + + if (!argv[0]->IsNull()) + env->isolate()->ThrowException(argv[0]); +} + + void RandomBytes(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - // maybe allow a buffer to write to? cuts down on object creation - // when generating random data in a loop if (!args[0]->IsUint32()) { return env->ThrowTypeError("size must be a number >= 0"); } @@ -5719,7 +5760,13 @@ void RandomBytes(const FunctionCallbackInfo& args) { return env->ThrowRangeError("size is not a valid Smi"); Local obj = env->NewInternalFieldObject(); - RandomBytesRequest* req = new RandomBytesRequest(env, obj, size); + char* data = node::Malloc(size); + RandomBytesRequest* req = + new RandomBytesRequest(env, + obj, + size, + data, + RandomBytesRequest::FREE_DATA); if (args[1]->IsFunction()) { obj->Set(FIXED_ONE_BYTE_STRING(args.GetIsolate(), "ondone"), args[1]); @@ -5732,15 +5779,55 @@ void RandomBytes(const FunctionCallbackInfo& args) { RandomBytesAfter); args.GetReturnValue().Set(obj); } else { - env->PrintSyncTrace(); Local argv[2]; - RandomBytesWork(req->work_req()); - RandomBytesCheck(req, argv); - delete req; + RandomBytesProcessSync(env, req, argv); + if (argv[0]->IsNull()) + args.GetReturnValue().Set(argv[1]); + } +} - if (!argv[0]->IsNull()) - env->isolate()->ThrowException(argv[0]); - else + +void RandomBytesBuffer(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + + CHECK(args[0]->IsUint8Array()); + CHECK(args[1]->IsUint32()); + CHECK(args[2]->IsUint32()); + + int64_t offset = args[1]->IntegerValue(); + int64_t size = args[2]->IntegerValue(); + + Local obj = env->NewInternalFieldObject(); + obj->Set(env->context(), env->buffer_string(), args[0]).FromJust(); + char* data = Buffer::Data(args[0]); + data += offset; + + RandomBytesRequest* req = + new RandomBytesRequest(env, + obj, + size, + data, + RandomBytesRequest::DONT_FREE_DATA); + if (args[3]->IsFunction()) { + obj->Set(env->context(), + FIXED_ONE_BYTE_STRING(args.GetIsolate(), "ondone"), + args[3]).FromJust(); + + if (env->in_domain()) { + obj->Set(env->context(), + env->domain_string(), + env->domain_array()->Get(0)).FromJust(); + } + + uv_queue_work(env->event_loop(), + req->work_req(), + RandomBytesWork, + RandomBytesAfter); + args.GetReturnValue().Set(obj); + } else { + Local argv[2]; + RandomBytesProcessSync(env, req, argv); + if (argv[0]->IsNull()) args.GetReturnValue().Set(argv[1]); } } @@ -6168,6 +6255,7 @@ void InitCrypto(Local target, env->SetMethod(target, "setFipsCrypto", SetFipsCrypto); env->SetMethod(target, "PBKDF2", PBKDF2); env->SetMethod(target, "randomBytes", RandomBytes); + env->SetMethod(target, "randomFill", RandomBytesBuffer); env->SetMethod(target, "timingSafeEqual", TimingSafeEqual); env->SetMethod(target, "getSSLCiphers", GetSSLCiphers); env->SetMethod(target, "getCiphers", GetCiphers); diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index bfb29366e8c58d..7ddfe2904f0ef3 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -51,8 +51,6 @@ void NodeBIO::AssignEnvironment(Environment* env) { int NodeBIO::New(BIO* bio) { bio->ptr = new NodeBIO(); - // XXX Why am I doing it?! - bio->shutdown = 1; bio->init = 1; bio->num = -1; diff --git a/src/node_i18n.cc b/src/node_i18n.cc index 8e32f1fe08177b..c013027981755f 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -77,12 +77,11 @@ bool InitializeICUDirectory(const std::string& path) { } } -static int32_t ToUnicode(MaybeStackBuffer* buf, - const char* input, - size_t length) { +int32_t ToUnicode(MaybeStackBuffer* buf, + const char* input, + size_t length) { UErrorCode status = U_ZERO_ERROR; - uint32_t options = UIDNA_DEFAULT; - options |= UIDNA_NONTRANSITIONAL_TO_UNICODE; + uint32_t options = UIDNA_NONTRANSITIONAL_TO_UNICODE; UIDNA* uidna = uidna_openUTS46(options, &status); if (U_FAILURE(status)) return -1; @@ -90,33 +89,52 @@ static int32_t ToUnicode(MaybeStackBuffer* buf, int32_t len = uidna_nameToUnicodeUTF8(uidna, input, length, - **buf, buf->length(), + **buf, buf->capacity(), &info, &status); + // Do not check info.errors like we do with ToASCII since ToUnicode always + // returns a string, despite any possible errors that may have occurred. + if (status == U_BUFFER_OVERFLOW_ERROR) { status = U_ZERO_ERROR; buf->AllocateSufficientStorage(len); len = uidna_nameToUnicodeUTF8(uidna, input, length, - **buf, buf->length(), + **buf, buf->capacity(), &info, &status); } - if (U_FAILURE(status)) + // info.errors is ignored as UTS #46 ToUnicode always produces a Unicode + // string, regardless of whether an error occurred. + + if (U_FAILURE(status)) { len = -1; + buf->SetLength(0); + } else { + buf->SetLength(len); + } uidna_close(uidna); return len; } -static int32_t ToASCII(MaybeStackBuffer* buf, - const char* input, - size_t length) { +int32_t ToASCII(MaybeStackBuffer* buf, + const char* input, + size_t length, + enum idna_mode mode) { UErrorCode status = U_ZERO_ERROR; - uint32_t options = UIDNA_DEFAULT; - options |= UIDNA_NONTRANSITIONAL_TO_ASCII; + uint32_t options = // CheckHyphens = false; handled later + UIDNA_CHECK_BIDI | // CheckBidi = true + UIDNA_CHECK_CONTEXTJ | // CheckJoiners = true + UIDNA_NONTRANSITIONAL_TO_ASCII; // Nontransitional_Processing + if (mode == IDNA_STRICT) { + options |= UIDNA_USE_STD3_RULES; // UseSTD3ASCIIRules = beStrict + // VerifyDnsLength = beStrict; + // handled later + } + UIDNA* uidna = uidna_openUTS46(options, &status); if (U_FAILURE(status)) return -1; @@ -124,7 +142,7 @@ static int32_t ToASCII(MaybeStackBuffer* buf, int32_t len = uidna_nameToASCII_UTF8(uidna, input, length, - **buf, buf->length(), + **buf, buf->capacity(), &info, &status); @@ -133,13 +151,45 @@ static int32_t ToASCII(MaybeStackBuffer* buf, buf->AllocateSufficientStorage(len); len = uidna_nameToASCII_UTF8(uidna, input, length, - **buf, buf->length(), + **buf, buf->capacity(), &info, &status); } - if (U_FAILURE(status)) + // In UTS #46 which specifies ToASCII, certain error conditions are + // configurable through options, and the WHATWG URL Standard promptly elects + // to disable some of them to accommodate for real-world use cases. + // Unfortunately, ICU4C's IDNA module does not support disabling some of + // these options through `options` above, and thus continues throwing + // unnecessary errors. To counter this situation, we just filter out the + // errors that may have happened afterwards, before deciding whether to + // return an error from this function. + + // CheckHyphens = false + // (Specified in the current UTS #46 draft rev. 18.) + // Refs: + // - https://github.com/whatwg/url/issues/53 + // - https://github.com/whatwg/url/pull/309 + // - http://www.unicode.org/review/pri317/ + // - http://www.unicode.org/reports/tr46/tr46-18.html + // - https://www.icann.org/news/announcement-2000-01-07-en + info.errors &= ~UIDNA_ERROR_HYPHEN_3_4; + info.errors &= ~UIDNA_ERROR_LEADING_HYPHEN; + info.errors &= ~UIDNA_ERROR_TRAILING_HYPHEN; + + if (mode != IDNA_STRICT) { + // VerifyDnsLength = beStrict + info.errors &= ~UIDNA_ERROR_EMPTY_LABEL; + info.errors &= ~UIDNA_ERROR_LABEL_TOO_LONG; + info.errors &= ~UIDNA_ERROR_DOMAIN_NAME_TOO_LONG; + } + + if (U_FAILURE(status) || (mode != IDNA_LENIENT && info.errors != 0)) { len = -1; + buf->SetLength(0); + } else { + buf->SetLength(len); + } uidna_close(uidna); return len; @@ -169,8 +219,12 @@ static void ToASCII(const FunctionCallbackInfo& args) { CHECK_GE(args.Length(), 1); CHECK(args[0]->IsString()); Utf8Value val(env->isolate(), args[0]); + // optional arg + bool lenient = args[1]->BooleanValue(env->context()).FromJust(); + enum idna_mode mode = lenient ? IDNA_LENIENT : IDNA_DEFAULT; + MaybeStackBuffer buf; - int32_t len = ToASCII(&buf, *val, val.length()); + int32_t len = ToASCII(&buf, *val, val.length(), mode); if (len < 0) { return env->ThrowError("Cannot convert name to ASCII"); diff --git a/src/node_i18n.h b/src/node_i18n.h index ff9e87cea7fe83..30acefd1a8a996 100644 --- a/src/node_i18n.h +++ b/src/node_i18n.h @@ -16,6 +16,30 @@ namespace i18n { bool InitializeICUDirectory(const std::string& path); +enum idna_mode { + // Default mode for maximum compatibility. + IDNA_DEFAULT, + // Ignore all errors in IDNA conversion, if possible. + IDNA_LENIENT, + // Enforce STD3 rules (UseSTD3ASCIIRules) and DNS length restrictions + // (VerifyDnsLength). Corresponds to `beStrict` flag in the "domain to ASCII" + // algorithm. + IDNA_STRICT +}; + +// Implements the WHATWG URL Standard "domain to ASCII" algorithm. +// https://url.spec.whatwg.org/#concept-domain-to-ascii +int32_t ToASCII(MaybeStackBuffer* buf, + const char* input, + size_t length, + enum idna_mode mode = IDNA_DEFAULT); + +// Implements the WHATWG URL Standard "domain to Unicode" algorithm. +// https://url.spec.whatwg.org/#concept-domain-to-unicode +int32_t ToUnicode(MaybeStackBuffer* buf, + const char* input, + size_t length); + } // namespace i18n } // namespace node diff --git a/src/node_url.cc b/src/node_url.cc new file mode 100644 index 00000000000000..49c005a23bc2c7 --- /dev/null +++ b/src/node_url.cc @@ -0,0 +1,2223 @@ +#include "node_url.h" +#include "node_internals.h" +#include "base-object-inl.h" +#include "node_i18n.h" + +#include +#include +#include +#include + +namespace node { + +using v8::Array; +using v8::Context; +using v8::Function; +using v8::FunctionCallbackInfo; +using v8::HandleScope; +using v8::Integer; +using v8::Isolate; +using v8::Local; +using v8::MaybeLocal; +using v8::Null; +using v8::Object; +using v8::String; +using v8::TryCatch; +using v8::Undefined; +using v8::Value; + +#define GET(env, obj, name) \ + obj->Get(env->context(), \ + OneByteString(env->isolate(), name)).ToLocalChecked() + +#define GET_AND_SET(env, obj, name, data, flag) \ + { \ + Local val = GET(env, obj, #name); \ + if (val->IsString()) { \ + Utf8Value value(env->isolate(), val.As()); \ + data->name = *value; \ + data->flags |= flag; \ + } \ + } + +#define UTF8STRING(isolate, str) \ + String::NewFromUtf8(isolate, str.c_str(), v8::NewStringType::kNormal) \ + .ToLocalChecked() + +namespace url { + +// https://url.spec.whatwg.org/#eof-code-point +static const char kEOL = -1; + +// Used in ToUSVString(). +static const char16_t kUnicodeReplacementCharacter = 0xFFFD; + +// https://url.spec.whatwg.org/#concept-host +union url_host_value { + std::string domain; + uint32_t ipv4; + uint16_t ipv6[8]; + std::string opaque; + ~url_host_value() {} +}; + +enum url_host_type { + HOST_TYPE_FAILED = -1, + HOST_TYPE_DOMAIN = 0, + HOST_TYPE_IPV4 = 1, + HOST_TYPE_IPV6 = 2, + HOST_TYPE_OPAQUE = 3, +}; + +struct url_host { + url_host_value value; + enum url_host_type type; +}; + +#define ARGS(XX) \ + XX(ARG_FLAGS) \ + XX(ARG_PROTOCOL) \ + XX(ARG_USERNAME) \ + XX(ARG_PASSWORD) \ + XX(ARG_HOST) \ + XX(ARG_PORT) \ + XX(ARG_PATH) \ + XX(ARG_QUERY) \ + XX(ARG_FRAGMENT) + +#define ERR_ARGS(XX) \ + XX(ERR_ARG_FLAGS) \ + XX(ERR_ARG_INPUT) \ + +enum url_cb_args { +#define XX(name) name, + ARGS(XX) +#undef XX +}; + +enum url_error_cb_args { +#define XX(name) name, + ERR_ARGS(XX) +#undef XX +}; + +#define CHAR_TEST(bits, name, expr) \ + template \ + static inline bool name(const T ch) { \ + static_assert(sizeof(ch) >= (bits) / 8, \ + "Character must be wider than " #bits " bits"); \ + return (expr); \ + } + +#define TWO_CHAR_STRING_TEST(bits, name, expr) \ + template \ + static inline bool name(const T ch1, const T ch2) { \ + static_assert(sizeof(ch1) >= (bits) / 8, \ + "Character must be wider than " #bits " bits"); \ + return (expr); \ + } \ + template \ + static inline bool name(const std::basic_string& str) { \ + static_assert(sizeof(str[0]) >= (bits) / 8, \ + "Character must be wider than " #bits " bits"); \ + return str.length() >= 2 && name(str[0], str[1]); \ + } + +// https://infra.spec.whatwg.org/#ascii-tab-or-newline +CHAR_TEST(8, IsASCIITabOrNewline, (ch == '\t' || ch == '\n' || ch == '\r')) + +// https://infra.spec.whatwg.org/#c0-control-or-space +CHAR_TEST(8, IsC0ControlOrSpace, (ch >= '\0' && ch <= ' ')) + +// https://infra.spec.whatwg.org/#ascii-digit +CHAR_TEST(8, IsASCIIDigit, (ch >= '0' && ch <= '9')) + +// https://infra.spec.whatwg.org/#ascii-hex-digit +CHAR_TEST(8, IsASCIIHexDigit, (IsASCIIDigit(ch) || + (ch >= 'A' && ch <= 'F') || + (ch >= 'a' && ch <= 'f'))) + +// https://infra.spec.whatwg.org/#ascii-alpha +CHAR_TEST(8, IsASCIIAlpha, ((ch >= 'A' && ch <= 'Z') || + (ch >= 'a' && ch <= 'z'))) + +// https://infra.spec.whatwg.org/#ascii-alphanumeric +CHAR_TEST(8, IsASCIIAlphanumeric, (IsASCIIDigit(ch) || IsASCIIAlpha(ch))) + +// https://infra.spec.whatwg.org/#ascii-lowercase +template +static inline T ASCIILowercase(T ch) { + return IsASCIIAlpha(ch) ? (ch | 0x20) : ch; +} + +// https://url.spec.whatwg.org/#forbidden-host-code-point +CHAR_TEST(8, IsForbiddenHostCodePoint, + ch == '\0' || ch == '\t' || ch == '\n' || ch == '\r' || + ch == ' ' || ch == '#' || ch == '%' || ch == '/' || + ch == ':' || ch == '?' || ch == '@' || ch == '[' || + ch == '\\' || ch == ']') + +// https://url.spec.whatwg.org/#windows-drive-letter +TWO_CHAR_STRING_TEST(8, IsWindowsDriveLetter, + (IsASCIIAlpha(ch1) && (ch2 == ':' || ch2 == '|'))) + +// https://url.spec.whatwg.org/#normalized-windows-drive-letter +TWO_CHAR_STRING_TEST(8, IsNormalizedWindowsDriveLetter, + (IsASCIIAlpha(ch1) && ch2 == ':')) + +// If a UTF-16 character is a low/trailing surrogate. +CHAR_TEST(16, IsUnicodeTrail, (ch & 0xFC00) == 0xDC00) + +// If a UTF-16 character is a surrogate. +CHAR_TEST(16, IsUnicodeSurrogate, (ch & 0xF800) == 0xD800) + +// If a UTF-16 surrogate is a low/trailing one. +CHAR_TEST(16, IsUnicodeSurrogateTrail, (ch & 0x400) != 0) + +#undef CHAR_TEST +#undef TWO_CHAR_STRING_TEST + +static const char* hex[256] = { + "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07", + "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F", + "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", + "%18", "%19", "%1A", "%1B", "%1C", "%1D", "%1E", "%1F", + "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27", + "%28", "%29", "%2A", "%2B", "%2C", "%2D", "%2E", "%2F", + "%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37", + "%38", "%39", "%3A", "%3B", "%3C", "%3D", "%3E", "%3F", + "%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47", + "%48", "%49", "%4A", "%4B", "%4C", "%4D", "%4E", "%4F", + "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57", + "%58", "%59", "%5A", "%5B", "%5C", "%5D", "%5E", "%5F", + "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67", + "%68", "%69", "%6A", "%6B", "%6C", "%6D", "%6E", "%6F", + "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77", + "%78", "%79", "%7A", "%7B", "%7C", "%7D", "%7E", "%7F", + "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87", + "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F", + "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", + "%98", "%99", "%9A", "%9B", "%9C", "%9D", "%9E", "%9F", + "%A0", "%A1", "%A2", "%A3", "%A4", "%A5", "%A6", "%A7", + "%A8", "%A9", "%AA", "%AB", "%AC", "%AD", "%AE", "%AF", + "%B0", "%B1", "%B2", "%B3", "%B4", "%B5", "%B6", "%B7", + "%B8", "%B9", "%BA", "%BB", "%BC", "%BD", "%BE", "%BF", + "%C0", "%C1", "%C2", "%C3", "%C4", "%C5", "%C6", "%C7", + "%C8", "%C9", "%CA", "%CB", "%CC", "%CD", "%CE", "%CF", + "%D0", "%D1", "%D2", "%D3", "%D4", "%D5", "%D6", "%D7", + "%D8", "%D9", "%DA", "%DB", "%DC", "%DD", "%DE", "%DF", + "%E0", "%E1", "%E2", "%E3", "%E4", "%E5", "%E6", "%E7", + "%E8", "%E9", "%EA", "%EB", "%EC", "%ED", "%EE", "%EF", + "%F0", "%F1", "%F2", "%F3", "%F4", "%F5", "%F6", "%F7", + "%F8", "%F9", "%FA", "%FB", "%FC", "%FD", "%FE", "%FF" +}; + +static const uint8_t C0_CONTROL_ENCODE_SET[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, + // 80 81 82 83 84 85 86 87 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 88 89 8A 8B 8C 8D 8E 8F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 90 91 92 93 94 95 96 97 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 98 99 9A 9B 9C 9D 9E 9F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A0 A1 A2 A3 A4 A5 A6 A7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A8 A9 AA AB AC AD AE AF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B0 B1 B2 B3 B4 B5 B6 B7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B8 B9 BA BB BC BD BE BF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C0 C1 C2 C3 C4 C5 C6 C7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C8 C9 CA CB CC CD CE CF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D0 D1 D2 D3 D4 D5 D6 D7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D8 D9 DA DB DC DD DE DF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E0 E1 E2 E3 E4 E5 E6 E7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E8 E9 EA EB EC ED EE EF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F0 F1 F2 F3 F4 F5 F6 F7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 +}; + +static const uint8_t PATH_ENCODE_SET[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x80, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x08 | 0x00 | 0x20 | 0x00 | 0x80, + // 80 81 82 83 84 85 86 87 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 88 89 8A 8B 8C 8D 8E 8F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 90 91 92 93 94 95 96 97 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 98 99 9A 9B 9C 9D 9E 9F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A0 A1 A2 A3 A4 A5 A6 A7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A8 A9 AA AB AC AD AE AF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B0 B1 B2 B3 B4 B5 B6 B7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B8 B9 BA BB BC BD BE BF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C0 C1 C2 C3 C4 C5 C6 C7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C8 C9 CA CB CC CD CE CF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D0 D1 D2 D3 D4 D5 D6 D7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D8 D9 DA DB DC DD DE DF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E0 E1 E2 E3 E4 E5 E6 E7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E8 E9 EA EB EC ED EE EF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F0 F1 F2 F3 F4 F5 F6 F7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 +}; + +static const uint8_t USERINFO_ENCODE_SET[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 40 41 42 43 44 45 46 47 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x40 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x00 | 0x80, + // 80 81 82 83 84 85 86 87 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 88 89 8A 8B 8C 8D 8E 8F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 90 91 92 93 94 95 96 97 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 98 99 9A 9B 9C 9D 9E 9F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A0 A1 A2 A3 A4 A5 A6 A7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A8 A9 AA AB AC AD AE AF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B0 B1 B2 B3 B4 B5 B6 B7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B8 B9 BA BB BC BD BE BF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C0 C1 C2 C3 C4 C5 C6 C7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C8 C9 CA CB CC CD CE CF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D0 D1 D2 D3 D4 D5 D6 D7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D8 D9 DA DB DC DD DE DF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E0 E1 E2 E3 E4 E5 E6 E7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E8 E9 EA EB EC ED EE EF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F0 F1 F2 F3 F4 F5 F6 F7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 +}; + +static const uint8_t QUERY_ENCODE_SET[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, + // 80 81 82 83 84 85 86 87 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 88 89 8A 8B 8C 8D 8E 8F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 90 91 92 93 94 95 96 97 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 98 99 9A 9B 9C 9D 9E 9F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A0 A1 A2 A3 A4 A5 A6 A7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A8 A9 AA AB AC AD AE AF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B0 B1 B2 B3 B4 B5 B6 B7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B8 B9 BA BB BC BD BE BF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C0 C1 C2 C3 C4 C5 C6 C7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C8 C9 CA CB CC CD CE CF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D0 D1 D2 D3 D4 D5 D6 D7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D8 D9 DA DB DC DD DE DF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E0 E1 E2 E3 E4 E5 E6 E7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E8 E9 EA EB EC ED EE EF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F0 F1 F2 F3 F4 F5 F6 F7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 +}; + +static inline bool BitAt(const uint8_t a[], const uint8_t i) { + return !!(a[i >> 3] & (1 << (i & 7))); +} + +// Appends ch to str. If ch position in encode_set is set, the ch will +// be percent-encoded then appended. +static inline void AppendOrEscape(std::string* str, + const unsigned char ch, + const uint8_t encode_set[]) { + if (BitAt(encode_set, ch)) + *str += hex[ch]; + else + *str += ch; +} + +template +static inline unsigned hex2bin(const T ch) { + if (ch >= '0' && ch <= '9') + return ch - '0'; + if (ch >= 'A' && ch <= 'F') + return 10 + (ch - 'A'); + if (ch >= 'a' && ch <= 'f') + return 10 + (ch - 'a'); + return static_cast(-1); +} + +static inline void PercentDecode(const char* input, + size_t len, + std::string* dest) { + if (len == 0) + return; + dest->reserve(len); + const char* pointer = input; + const char* end = input + len; + + while (pointer < end) { + const char ch = pointer[0]; + const size_t remaining = end - pointer - 1; + if (ch != '%' || remaining < 2 || + (ch == '%' && + (!IsASCIIHexDigit(pointer[1]) || + !IsASCIIHexDigit(pointer[2])))) { + *dest += ch; + pointer++; + continue; + } else { + unsigned a = hex2bin(pointer[1]); + unsigned b = hex2bin(pointer[2]); + char c = static_cast(a * 16 + b); + *dest += c; + pointer += 3; + } + } +} + +#define SPECIALS(XX) \ + XX("ftp:", 21) \ + XX("file:", -1) \ + XX("gopher:", 70) \ + XX("http:", 80) \ + XX("https:", 443) \ + XX("ws:", 80) \ + XX("wss:", 443) + +static inline bool IsSpecial(std::string scheme) { +#define XX(name, _) if (scheme == name) return true; + SPECIALS(XX); +#undef XX + return false; +} + +// https://url.spec.whatwg.org/#start-with-a-windows-drive-letter +static inline bool StartsWithWindowsDriveLetter(const char* p, + const char* end) { + const size_t length = end - p; + return length >= 2 && + IsWindowsDriveLetter(p[0], p[1]) && + (length == 2 || + p[2] == '/' || + p[2] == '\\' || + p[2] == '?' || + p[2] == '#'); +} + +static inline int NormalizePort(std::string scheme, int p) { +#define XX(name, port) if (scheme == name && p == port) return -1; + SPECIALS(XX); +#undef XX + return p; +} + +#if defined(NODE_HAVE_I18N_SUPPORT) +static inline bool ToUnicode(const std::string& input, std::string* output) { + MaybeStackBuffer buf; + if (i18n::ToUnicode(&buf, input.c_str(), input.length()) < 0) + return false; + output->assign(*buf, buf.length()); + return true; +} + +static inline bool ToASCII(const std::string& input, std::string* output) { + MaybeStackBuffer buf; + if (i18n::ToASCII(&buf, input.c_str(), input.length()) < 0) + return false; + output->assign(*buf, buf.length()); + return true; +} +#else +// Intentional non-ops if ICU is not present. +static inline bool ToUnicode(const std::string& input, std::string* output) { + *output = input; + return true; +} + +static inline bool ToASCII(const std::string& input, std::string* output) { + *output = input; + return true; +} +#endif + +static url_host_type ParseIPv6Host(url_host* host, + const char* input, + size_t length) { + url_host_type type = HOST_TYPE_FAILED; + for (unsigned n = 0; n < 8; n++) + host->value.ipv6[n] = 0; + uint16_t* piece_pointer = &host->value.ipv6[0]; + uint16_t* last_piece = piece_pointer + 8; + uint16_t* compress_pointer = nullptr; + const char* pointer = input; + const char* end = pointer + length; + unsigned value, len, swaps, numbers_seen; + char ch = pointer < end ? pointer[0] : kEOL; + if (ch == ':') { + if (length < 2 || pointer[1] != ':') + goto end; + pointer += 2; + ch = pointer < end ? pointer[0] : kEOL; + piece_pointer++; + compress_pointer = piece_pointer; + } + while (ch != kEOL) { + if (piece_pointer > last_piece) + goto end; + if (ch == ':') { + if (compress_pointer != nullptr) + goto end; + pointer++; + ch = pointer < end ? pointer[0] : kEOL; + piece_pointer++; + compress_pointer = piece_pointer; + continue; + } + value = 0; + len = 0; + while (len < 4 && IsASCIIHexDigit(ch)) { + value = value * 0x10 + hex2bin(ch); + pointer++; + ch = pointer < end ? pointer[0] : kEOL; + len++; + } + switch (ch) { + case '.': + if (len == 0) + goto end; + pointer -= len; + ch = pointer < end ? pointer[0] : kEOL; + if (piece_pointer > last_piece - 2) + goto end; + numbers_seen = 0; + while (ch != kEOL) { + value = 0xffffffff; + if (numbers_seen > 0) { + if (ch == '.' && numbers_seen < 4) { + pointer++; + ch = pointer < end ? pointer[0] : kEOL; + } else { + goto end; + } + } + if (!IsASCIIDigit(ch)) + goto end; + while (IsASCIIDigit(ch)) { + unsigned number = ch - '0'; + if (value == 0xffffffff) { + value = number; + } else if (value == 0) { + goto end; + } else { + value = value * 10 + number; + } + if (value > 255) + goto end; + pointer++; + ch = pointer < end ? pointer[0] : kEOL; + } + *piece_pointer = *piece_pointer * 0x100 + value; + numbers_seen++; + if (numbers_seen == 2 || numbers_seen == 4) + piece_pointer++; + } + if (numbers_seen != 4) + goto end; + continue; + case ':': + pointer++; + ch = pointer < end ? pointer[0] : kEOL; + if (ch == kEOL) + goto end; + break; + case kEOL: + break; + default: + goto end; + } + *piece_pointer = value; + piece_pointer++; + } + + if (compress_pointer != nullptr) { + swaps = piece_pointer - compress_pointer; + piece_pointer = last_piece - 1; + while (piece_pointer != &host->value.ipv6[0] && swaps > 0) { + uint16_t temp = *piece_pointer; + uint16_t* swap_piece = compress_pointer + swaps - 1; + *piece_pointer = *swap_piece; + *swap_piece = temp; + piece_pointer--; + swaps--; + } + } else if (compress_pointer == nullptr && + piece_pointer != last_piece) { + goto end; + } + type = HOST_TYPE_IPV6; + end: + host->type = type; + return type; +} + +static inline int64_t ParseNumber(const char* start, const char* end) { + unsigned R = 10; + if (end - start >= 2 && start[0] == '0' && (start[1] | 0x20) == 'x') { + start += 2; + R = 16; + } + if (end - start == 0) { + return 0; + } else if (R == 10 && end - start > 1 && start[0] == '0') { + start++; + R = 8; + } + const char* p = start; + + while (p < end) { + const char ch = p[0]; + switch (R) { + case 8: + if (ch < '0' || ch > '7') + return -1; + break; + case 10: + if (!IsASCIIDigit(ch)) + return -1; + break; + case 16: + if (!IsASCIIHexDigit(ch)) + return -1; + break; + } + p++; + } + return strtoll(start, NULL, R); +} + +static url_host_type ParseIPv4Host(url_host* host, + const char* input, + size_t length) { + url_host_type type = HOST_TYPE_DOMAIN; + const char* pointer = input; + const char* mark = input; + const char* end = pointer + length; + int parts = 0; + uint32_t val = 0; + uint64_t numbers[4]; + int tooBigNumbers = 0; + if (length == 0) + goto end; + + while (pointer <= end) { + const char ch = pointer < end ? pointer[0] : kEOL; + const int remaining = end - pointer - 1; + if (ch == '.' || ch == kEOL) { + if (++parts > 4) + goto end; + if (pointer == mark) + goto end; + int64_t n = ParseNumber(mark, pointer); + if (n < 0) + goto end; + + if (n > 255) { + tooBigNumbers++; + } + numbers[parts - 1] = n; + mark = pointer + 1; + if (ch == '.' && remaining == 0) + break; + } + pointer++; + } + CHECK_GT(parts, 0); + + // If any but the last item in numbers is greater than 255, return failure. + // If the last item in numbers is greater than or equal to + // 256^(5 - the number of items in numbers), return failure. + if (tooBigNumbers > 1 || + (tooBigNumbers == 1 && numbers[parts - 1] <= 255) || + numbers[parts - 1] >= pow(256, static_cast(5 - parts))) { + type = HOST_TYPE_FAILED; + goto end; + } + + type = HOST_TYPE_IPV4; + val = numbers[parts - 1]; + for (int n = 0; n < parts - 1; n++) { + double b = 3 - n; + val += numbers[n] * pow(256, b); + } + + host->value.ipv4 = val; + end: + host->type = type; + return type; +} + +static url_host_type ParseOpaqueHost(url_host* host, + const char* input, + size_t length) { + url_host_type type = HOST_TYPE_OPAQUE; + std::string output; + output.reserve(length * 3); + for (size_t i = 0; i < length; i++) { + const char ch = input[i]; + if (ch != '%' && IsForbiddenHostCodePoint(ch)) { + type = HOST_TYPE_FAILED; + goto end; + } else { + AppendOrEscape(&output, ch, C0_CONTROL_ENCODE_SET); + } + } + + host->value.opaque = output; + end: + host->type = type; + return type; +} + +static url_host_type ParseHost(url_host* host, + const char* input, + size_t length, + bool is_special, + bool unicode = false) { + url_host_type type = HOST_TYPE_FAILED; + const char* pointer = input; + std::string decoded; + + if (length == 0) + goto end; + + if (pointer[0] == '[') { + if (pointer[length - 1] != ']') + goto end; + return ParseIPv6Host(host, ++pointer, length - 2); + } + + if (!is_special) + return ParseOpaqueHost(host, input, length); + + // First, we have to percent decode + PercentDecode(input, length, &decoded); + + // Then we have to punycode toASCII + if (!ToASCII(decoded, &decoded)) + goto end; + + // If any of the following characters are still present, we have to fail + for (size_t n = 0; n < decoded.size(); n++) { + const char ch = decoded[n]; + if (IsForbiddenHostCodePoint(ch)) { + goto end; + } + } + + // Check to see if it's an IPv4 IP address + type = ParseIPv4Host(host, decoded.c_str(), decoded.length()); + if (type == HOST_TYPE_IPV4 || type == HOST_TYPE_FAILED) + goto end; + + // If the unicode flag is set, run the result through punycode ToUnicode + if (unicode && !ToUnicode(decoded, &decoded)) + goto end; + + // It's not an IPv4 or IPv6 address, it must be a domain + type = HOST_TYPE_DOMAIN; + host->value.domain = decoded; + + end: + host->type = type; + return type; +} + +// Locates the longest sequence of 0 segments in an IPv6 address +// in order to use the :: compression when serializing +static inline uint16_t* FindLongestZeroSequence(uint16_t* values, + size_t len) { + uint16_t* start = values; + uint16_t* end = start + len; + uint16_t* result = nullptr; + + uint16_t* current = nullptr; + unsigned counter = 0, longest = 1; + + while (start < end) { + if (*start == 0) { + if (current == nullptr) + current = start; + counter++; + } else { + if (counter > longest) { + longest = counter; + result = current; + } + counter = 0; + current = nullptr; + } + start++; + } + if (counter > longest) + result = current; + return result; +} + +static url_host_type WriteHost(url_host* host, std::string* dest) { + dest->clear(); + switch (host->type) { + case HOST_TYPE_DOMAIN: + *dest = host->value.domain; + break; + case HOST_TYPE_IPV4: { + dest->reserve(15); + uint32_t value = host->value.ipv4; + for (int n = 0; n < 4; n++) { + char buf[4]; + char* buffer = buf; + snprintf(buffer, sizeof(buf), "%d", value % 256); + dest->insert(0, buf); + if (n < 3) + dest->insert(0, 1, '.'); + value /= 256; + } + break; + } + case HOST_TYPE_IPV6: { + dest->reserve(41); + *dest+= '['; + uint16_t* start = &host->value.ipv6[0]; + uint16_t* compress_pointer = + FindLongestZeroSequence(start, 8); + bool ignore0 = false; + for (int n = 0; n <= 7; n++) { + uint16_t* piece = &host->value.ipv6[n]; + if (ignore0 && *piece == 0) + continue; + else if (ignore0) + ignore0 = false; + if (compress_pointer == piece) { + *dest += n == 0 ? "::" : ":"; + ignore0 = true; + continue; + } + char buf[5]; + char* buffer = buf; + snprintf(buffer, sizeof(buf), "%x", *piece); + *dest += buf; + if (n < 7) + *dest += ':'; + } + *dest += ']'; + break; + } + case HOST_TYPE_OPAQUE: + *dest = host->value.opaque; + break; + case HOST_TYPE_FAILED: + break; + } + return host->type; +} + +static bool ParseHost(std::string* input, + std::string* output, + bool is_special, + bool unicode = false) { + if (input->length() == 0) { + output->clear(); + return true; + } + url_host host{{""}, HOST_TYPE_DOMAIN}; + ParseHost(&host, input->c_str(), input->length(), is_special, unicode); + if (host.type == HOST_TYPE_FAILED) + return false; + WriteHost(&host, output); + return true; +} + +static inline void Copy(Environment* env, + Local ary, + std::vector* vec) { + const int32_t len = ary->Length(); + if (len == 0) + return; // nothing to copy + vec->reserve(len); + for (int32_t n = 0; n < len; n++) { + Local val = ary->Get(env->context(), n).ToLocalChecked(); + if (val->IsString()) { + Utf8Value value(env->isolate(), val.As()); + vec->push_back(std::string(*value, value.length())); + } + } +} + +static inline Local Copy(Environment* env, + const std::vector& vec) { + Isolate* isolate = env->isolate(); + Local ary = Array::New(isolate, vec.size()); + for (size_t n = 0; n < vec.size(); n++) + ary->Set(env->context(), n, UTF8STRING(isolate, vec[n])).FromJust(); + return ary; +} + +static inline void HarvestBase(Environment* env, + struct url_data* base, + Local base_obj) { + Local context = env->context(); + Local flags = GET(env, base_obj, "flags"); + if (flags->IsInt32()) + base->flags = flags->Int32Value(context).FromJust(); + + Local scheme = GET(env, base_obj, "scheme"); + base->scheme = Utf8Value(env->isolate(), scheme).out(); + + GET_AND_SET(env, base_obj, username, base, URL_FLAGS_HAS_USERNAME); + GET_AND_SET(env, base_obj, password, base, URL_FLAGS_HAS_PASSWORD); + GET_AND_SET(env, base_obj, host, base, URL_FLAGS_HAS_HOST); + GET_AND_SET(env, base_obj, query, base, URL_FLAGS_HAS_QUERY); + GET_AND_SET(env, base_obj, fragment, base, URL_FLAGS_HAS_FRAGMENT); + Local port = GET(env, base_obj, "port"); + if (port->IsInt32()) + base->port = port->Int32Value(context).FromJust(); + Local path = GET(env, base_obj, "path"); + if (path->IsArray()) { + base->flags |= URL_FLAGS_HAS_PATH; + Copy(env, path.As(), &(base->path)); + } +} + +static inline void HarvestContext(Environment* env, + struct url_data* context, + Local context_obj) { + Local flags = GET(env, context_obj, "flags"); + if (flags->IsInt32()) { + int32_t _flags = flags->Int32Value(env->context()).FromJust(); + if (_flags & URL_FLAGS_SPECIAL) + context->flags |= URL_FLAGS_SPECIAL; + if (_flags & URL_FLAGS_CANNOT_BE_BASE) + context->flags |= URL_FLAGS_CANNOT_BE_BASE; + if (_flags & URL_FLAGS_HAS_USERNAME) + context->flags |= URL_FLAGS_HAS_USERNAME; + if (_flags & URL_FLAGS_HAS_PASSWORD) + context->flags |= URL_FLAGS_HAS_PASSWORD; + if (_flags & URL_FLAGS_HAS_HOST) + context->flags |= URL_FLAGS_HAS_HOST; + } + Local scheme = GET(env, context_obj, "scheme"); + if (scheme->IsString()) { + Utf8Value value(env->isolate(), scheme); + context->scheme.assign(*value, value.length()); + } + Local port = GET(env, context_obj, "port"); + if (port->IsInt32()) + context->port = port->Int32Value(env->context()).FromJust(); + if (context->flags & URL_FLAGS_HAS_USERNAME) { + Local username = GET(env, context_obj, "username"); + CHECK(username->IsString()); + Utf8Value value(env->isolate(), username); + context->username.assign(*value, value.length()); + } + if (context->flags & URL_FLAGS_HAS_PASSWORD) { + Local password = GET(env, context_obj, "password"); + CHECK(password->IsString()); + Utf8Value value(env->isolate(), password); + context->password.assign(*value, value.length()); + } + Local host = GET(env, context_obj, "host"); + if (host->IsString()) { + Utf8Value value(env->isolate(), host); + context->host.assign(*value, value.length()); + } +} + +// Single dot segment can be ".", "%2e", or "%2E" +static inline bool IsSingleDotSegment(std::string str) { + switch (str.size()) { + case 1: + return str == "."; + case 3: + return str[0] == '%' && + str[1] == '2' && + ASCIILowercase(str[2]) == 'e'; + default: + return false; + } +} + +// Double dot segment can be: +// "..", ".%2e", ".%2E", "%2e.", "%2E.", +// "%2e%2e", "%2E%2E", "%2e%2E", or "%2E%2e" +static inline bool IsDoubleDotSegment(std::string str) { + switch (str.size()) { + case 2: + return str == ".."; + case 4: + if (str[0] != '.' && str[0] != '%') + return false; + return ((str[0] == '.' && + str[1] == '%' && + str[2] == '2' && + ASCIILowercase(str[3]) == 'e') || + (str[0] == '%' && + str[1] == '2' && + ASCIILowercase(str[2]) == 'e' && + str[3] == '.')); + case 6: + return (str[0] == '%' && + str[1] == '2' && + ASCIILowercase(str[2]) == 'e' && + str[3] == '%' && + str[4] == '2' && + ASCIILowercase(str[5]) == 'e'); + default: + return false; + } +} + +static inline void ShortenUrlPath(struct url_data* url) { + if (url->path.empty()) return; + if (url->path.size() == 1 && url->scheme == "file:" && + IsNormalizedWindowsDriveLetter(url->path[0])) return; + url->path.pop_back(); +} + +void URL::Parse(const char* input, + size_t len, + enum url_parse_state state_override, + struct url_data* url, + bool has_url, + const struct url_data* base, + bool has_base) { + const char* p = input; + const char* end = input + len; + + if (!has_url) { + for (const char* ptr = p; ptr < end; ptr++) { + if (IsC0ControlOrSpace(*ptr)) + p++; + else + break; + } + for (const char* ptr = end - 1; ptr >= p; ptr--) { + if (IsC0ControlOrSpace(*ptr)) + end--; + else + break; + } + len = end - p; + } + + std::string whitespace_stripped; + whitespace_stripped.reserve(len); + for (const char* ptr = p; ptr < end; ptr++) + if (!IsASCIITabOrNewline(*ptr)) + whitespace_stripped += *ptr; + + input = whitespace_stripped.c_str(); + len = whitespace_stripped.size(); + p = input; + end = input + len; + + bool atflag = false; + bool sbflag = false; + bool uflag = false; + + std::string buffer; + url->scheme.reserve(len); + url->username.reserve(len); + url->password.reserve(len); + url->host.reserve(len); + url->path.reserve(len); + url->query.reserve(len); + url->fragment.reserve(len); + buffer.reserve(len); + + // Set the initial parse state. + const bool has_state_override = state_override != kUnknownState; + enum url_parse_state state = has_state_override ? state_override : + kSchemeStart; + + if (state < kSchemeStart || state > kFragment) { + url->flags |= URL_FLAGS_INVALID_PARSE_STATE; + return; + } + + while (p <= end) { + const char ch = p < end ? p[0] : kEOL; + bool special = (url->flags & URL_FLAGS_SPECIAL); + bool cannot_be_base; + const bool special_back_slash = (special && ch == '\\'); + + switch (state) { + case kSchemeStart: + if (IsASCIIAlpha(ch)) { + buffer += ASCIILowercase(ch); + state = kScheme; + } else if (!has_state_override) { + state = kNoScheme; + continue; + } else { + url->flags |= URL_FLAGS_FAILED; + return; + } + break; + case kScheme: + if (IsASCIIAlphanumeric(ch) || ch == '+' || ch == '-' || ch == '.') { + buffer += ASCIILowercase(ch); + } else if (ch == ':' || (has_state_override && ch == kEOL)) { + if (has_state_override && buffer.size() == 0) { + url->flags |= URL_FLAGS_TERMINATED; + return; + } + buffer += ':'; + + bool new_is_special = IsSpecial(buffer); + + if (has_state_override) { + if ((special != new_is_special) || + ((buffer == "file:") && + ((url->flags & URL_FLAGS_HAS_USERNAME) || + (url->flags & URL_FLAGS_HAS_PASSWORD) || + (url->port != -1)))) { + url->flags |= URL_FLAGS_TERMINATED; + return; + } + + // File scheme && (host == empty or null) check left to JS-land + // as it can be done before even entering C++ binding. + } + + url->scheme = buffer; + url->port = NormalizePort(url->scheme, url->port); + if (new_is_special) { + url->flags |= URL_FLAGS_SPECIAL; + special = true; + } else { + url->flags &= ~URL_FLAGS_SPECIAL; + special = false; + } + buffer.clear(); + if (has_state_override) + return; + if (url->scheme == "file:") { + state = kFile; + } else if (special && + has_base && + url->scheme == base->scheme) { + state = kSpecialRelativeOrAuthority; + } else if (special) { + state = kSpecialAuthoritySlashes; + } else if (p[1] == '/') { + state = kPathOrAuthority; + p++; + } else { + url->flags |= URL_FLAGS_CANNOT_BE_BASE; + url->flags |= URL_FLAGS_HAS_PATH; + url->path.push_back(""); + state = kCannotBeBase; + } + } else if (!has_state_override) { + buffer.clear(); + state = kNoScheme; + p = input; + continue; + } else { + url->flags |= URL_FLAGS_FAILED; + return; + } + break; + case kNoScheme: + cannot_be_base = has_base && (base->flags & URL_FLAGS_CANNOT_BE_BASE); + if (!has_base || (cannot_be_base && ch != '#')) { + url->flags |= URL_FLAGS_FAILED; + return; + } else if (cannot_be_base && ch == '#') { + url->scheme = base->scheme; + if (IsSpecial(url->scheme)) { + url->flags |= URL_FLAGS_SPECIAL; + special = true; + } else { + url->flags &= ~URL_FLAGS_SPECIAL; + special = false; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + if (base->flags & URL_FLAGS_HAS_QUERY) { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query = base->query; + } + if (base->flags & URL_FLAGS_HAS_FRAGMENT) { + url->flags |= URL_FLAGS_HAS_FRAGMENT; + url->fragment = base->fragment; + } + url->flags |= URL_FLAGS_CANNOT_BE_BASE; + state = kFragment; + } else if (has_base && + base->scheme != "file:") { + state = kRelative; + continue; + } else { + url->scheme = "file:"; + url->flags |= URL_FLAGS_SPECIAL; + special = true; + state = kFile; + continue; + } + break; + case kSpecialRelativeOrAuthority: + if (ch == '/' && p[1] == '/') { + state = kSpecialAuthorityIgnoreSlashes; + p++; + } else { + state = kRelative; + continue; + } + break; + case kPathOrAuthority: + if (ch == '/') { + state = kAuthority; + } else { + state = kPath; + continue; + } + break; + case kRelative: + url->scheme = base->scheme; + if (IsSpecial(url->scheme)) { + url->flags |= URL_FLAGS_SPECIAL; + special = true; + } else { + url->flags &= ~URL_FLAGS_SPECIAL; + special = false; + } + switch (ch) { + case kEOL: + if (base->flags & URL_FLAGS_HAS_USERNAME) { + url->flags |= URL_FLAGS_HAS_USERNAME; + url->username = base->username; + } + if (base->flags & URL_FLAGS_HAS_PASSWORD) { + url->flags |= URL_FLAGS_HAS_PASSWORD; + url->password = base->password; + } + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_QUERY) { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query = base->query; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + url->port = base->port; + break; + case '/': + state = kRelativeSlash; + break; + case '?': + if (base->flags & URL_FLAGS_HAS_USERNAME) { + url->flags |= URL_FLAGS_HAS_USERNAME; + url->username = base->username; + } + if (base->flags & URL_FLAGS_HAS_PASSWORD) { + url->flags |= URL_FLAGS_HAS_PASSWORD; + url->password = base->password; + } + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + url->port = base->port; + state = kQuery; + break; + case '#': + if (base->flags & URL_FLAGS_HAS_USERNAME) { + url->flags |= URL_FLAGS_HAS_USERNAME; + url->username = base->username; + } + if (base->flags & URL_FLAGS_HAS_PASSWORD) { + url->flags |= URL_FLAGS_HAS_PASSWORD; + url->password = base->password; + } + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_QUERY) { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query = base->query; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + url->port = base->port; + state = kFragment; + break; + default: + if (special_back_slash) { + state = kRelativeSlash; + } else { + if (base->flags & URL_FLAGS_HAS_USERNAME) { + url->flags |= URL_FLAGS_HAS_USERNAME; + url->username = base->username; + } + if (base->flags & URL_FLAGS_HAS_PASSWORD) { + url->flags |= URL_FLAGS_HAS_PASSWORD; + url->password = base->password; + } + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + ShortenUrlPath(url); + } + url->port = base->port; + state = kPath; + continue; + } + } + break; + case kRelativeSlash: + if (IsSpecial(url->scheme) && (ch == '/' || ch == '\\')) { + state = kSpecialAuthorityIgnoreSlashes; + } else if (ch == '/') { + state = kAuthority; + } else { + if (base->flags & URL_FLAGS_HAS_USERNAME) { + url->flags |= URL_FLAGS_HAS_USERNAME; + url->username = base->username; + } + if (base->flags & URL_FLAGS_HAS_PASSWORD) { + url->flags |= URL_FLAGS_HAS_PASSWORD; + url->password = base->password; + } + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + url->port = base->port; + state = kPath; + continue; + } + break; + case kSpecialAuthoritySlashes: + state = kSpecialAuthorityIgnoreSlashes; + if (ch == '/' && p[1] == '/') { + p++; + } else { + continue; + } + break; + case kSpecialAuthorityIgnoreSlashes: + if (ch != '/' && ch != '\\') { + state = kAuthority; + continue; + } + break; + case kAuthority: + if (ch == '@') { + if (atflag) { + buffer.reserve(buffer.size() + 3); + buffer.insert(0, "%40"); + } + atflag = true; + const size_t blen = buffer.size(); + if (blen > 0 && buffer[0] != ':') { + url->flags |= URL_FLAGS_HAS_USERNAME; + } + for (size_t n = 0; n < blen; n++) { + const char bch = buffer[n]; + if (bch == ':') { + url->flags |= URL_FLAGS_HAS_PASSWORD; + if (!uflag) { + uflag = true; + continue; + } + } + if (uflag) { + AppendOrEscape(&url->password, bch, USERINFO_ENCODE_SET); + } else { + AppendOrEscape(&url->username, bch, USERINFO_ENCODE_SET); + } + } + buffer.clear(); + } else if (ch == kEOL || + ch == '/' || + ch == '?' || + ch == '#' || + special_back_slash) { + if (atflag && buffer.size() == 0) { + url->flags |= URL_FLAGS_FAILED; + return; + } + p -= buffer.size() + 1; + buffer.clear(); + state = kHost; + } else { + buffer += ch; + } + break; + case kHost: + case kHostname: + if (has_state_override && url->scheme == "file:") { + state = kFileHost; + continue; + } else if (ch == ':' && !sbflag) { + if (buffer.size() == 0) { + url->flags |= URL_FLAGS_FAILED; + return; + } + url->flags |= URL_FLAGS_HAS_HOST; + if (!ParseHost(&buffer, &url->host, special)) { + url->flags |= URL_FLAGS_FAILED; + return; + } + buffer.clear(); + state = kPort; + if (state_override == kHostname) { + return; + } + } else if (ch == kEOL || + ch == '/' || + ch == '?' || + ch == '#' || + special_back_slash) { + p--; + if (special && buffer.size() == 0) { + url->flags |= URL_FLAGS_FAILED; + return; + } + if (has_state_override && + buffer.size() == 0 && + ((url->username.size() > 0 || url->password.size() > 0) || + url->port != -1)) { + url->flags |= URL_FLAGS_TERMINATED; + return; + } + url->flags |= URL_FLAGS_HAS_HOST; + if (!ParseHost(&buffer, &url->host, special)) { + url->flags |= URL_FLAGS_FAILED; + return; + } + buffer.clear(); + state = kPathStart; + if (has_state_override) { + return; + } + } else { + if (ch == '[') + sbflag = true; + if (ch == ']') + sbflag = false; + buffer += ch; + } + break; + case kPort: + if (IsASCIIDigit(ch)) { + buffer += ch; + } else if (has_state_override || + ch == kEOL || + ch == '/' || + ch == '?' || + ch == '#' || + special_back_slash) { + if (buffer.size() > 0) { + unsigned port = 0; + // the condition port <= 0xffff prevents integer overflow + for (size_t i = 0; port <= 0xffff && i < buffer.size(); i++) + port = port * 10 + buffer[i] - '0'; + if (port > 0xffff) { + // TODO(TimothyGu): This hack is currently needed for the host + // setter since it needs access to hostname if it is valid, and + // if the FAILED flag is set the entire response to JS layer + // will be empty. + if (state_override == kHost) + url->port = -1; + else + url->flags |= URL_FLAGS_FAILED; + return; + } + // the port is valid + url->port = NormalizePort(url->scheme, static_cast(port)); + buffer.clear(); + } else if (has_state_override) { + // TODO(TimothyGu): Similar case as above. + if (state_override == kHost) + url->port = -1; + else + url->flags |= URL_FLAGS_TERMINATED; + return; + } + state = kPathStart; + continue; + } else { + url->flags |= URL_FLAGS_FAILED; + return; + } + break; + case kFile: + url->scheme = "file:"; + if (ch == '/' || ch == '\\') { + state = kFileSlash; + } else if (has_base && base->scheme == "file:") { + switch (ch) { + case kEOL: + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + if (base->flags & URL_FLAGS_HAS_QUERY) { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query = base->query; + } + break; + case '?': + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + url->flags |= URL_FLAGS_HAS_QUERY; + url->query.clear(); + state = kQuery; + break; + case '#': + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + if (base->flags & URL_FLAGS_HAS_QUERY) { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query = base->query; + } + url->flags |= URL_FLAGS_HAS_FRAGMENT; + url->fragment.clear(); + state = kFragment; + break; + default: + if (!StartsWithWindowsDriveLetter(p, end)) { + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } + if (base->flags & URL_FLAGS_HAS_PATH) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path = base->path; + } + ShortenUrlPath(url); + } + state = kPath; + continue; + } + } else { + state = kPath; + continue; + } + break; + case kFileSlash: + if (ch == '/' || ch == '\\') { + state = kFileHost; + } else { + if (has_base && + base->scheme == "file:" && + !StartsWithWindowsDriveLetter(p, end)) { + if (IsNormalizedWindowsDriveLetter(base->path[0])) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path.push_back(base->path[0]); + } else { + if (base->flags & URL_FLAGS_HAS_HOST) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host = base->host; + } else { + url->flags &= ~URL_FLAGS_HAS_HOST; + url->host.clear(); + } + } + } + state = kPath; + continue; + } + break; + case kFileHost: + if (ch == kEOL || + ch == '/' || + ch == '\\' || + ch == '?' || + ch == '#') { + if (!has_state_override && + buffer.size() == 2 && + IsWindowsDriveLetter(buffer)) { + state = kPath; + } else if (buffer.size() == 0) { + url->flags |= URL_FLAGS_HAS_HOST; + url->host.clear(); + if (has_state_override) + return; + state = kPathStart; + } else { + std::string host; + if (!ParseHost(&buffer, &host, special)) { + url->flags |= URL_FLAGS_FAILED; + return; + } + if (host == "localhost") + host.clear(); + url->flags |= URL_FLAGS_HAS_HOST; + url->host = host; + if (has_state_override) + return; + buffer.clear(); + state = kPathStart; + } + continue; + } else { + buffer += ch; + } + break; + case kPathStart: + if (IsSpecial(url->scheme)) { + state = kPath; + if (ch != '/' && ch != '\\') { + continue; + } + } else if (!has_state_override && ch == '?') { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query.clear(); + state = kQuery; + } else if (!has_state_override && ch == '#') { + url->flags |= URL_FLAGS_HAS_FRAGMENT; + url->fragment.clear(); + state = kFragment; + } else if (ch != kEOL) { + state = kPath; + if (ch != '/') { + continue; + } + } + break; + case kPath: + if (ch == kEOL || + ch == '/' || + special_back_slash || + (!has_state_override && (ch == '?' || ch == '#'))) { + if (IsDoubleDotSegment(buffer)) { + ShortenUrlPath(url); + if (ch != '/' && !special_back_slash) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path.push_back(""); + } + } else if (IsSingleDotSegment(buffer) && + ch != '/' && !special_back_slash) { + url->flags |= URL_FLAGS_HAS_PATH; + url->path.push_back(""); + } else if (!IsSingleDotSegment(buffer)) { + if (url->scheme == "file:" && + url->path.empty() && + buffer.size() == 2 && + IsWindowsDriveLetter(buffer)) { + if ((url->flags & URL_FLAGS_HAS_HOST) && + !url->host.empty()) { + url->host.clear(); + url->flags |= URL_FLAGS_HAS_HOST; + } + buffer[1] = ':'; + } + url->flags |= URL_FLAGS_HAS_PATH; + std::string segment(buffer.c_str(), buffer.size()); + url->path.push_back(segment); + } + buffer.clear(); + if (url->scheme == "file:" && + (ch == kEOL || + ch == '?' || + ch == '#')) { + while (url->path.size() > 1 && url->path[0].length() == 0) { + url->path.erase(url->path.begin()); + } + } + if (ch == '?') { + url->flags |= URL_FLAGS_HAS_QUERY; + state = kQuery; + } else if (ch == '#') { + state = kFragment; + } + } else { + AppendOrEscape(&buffer, ch, PATH_ENCODE_SET); + } + break; + case kCannotBeBase: + switch (ch) { + case '?': + state = kQuery; + break; + case '#': + state = kFragment; + break; + default: + if (url->path.size() == 0) + url->path.push_back(""); + if (url->path.size() > 0 && ch != kEOL) + AppendOrEscape(&url->path[0], ch, C0_CONTROL_ENCODE_SET); + } + break; + case kQuery: + if (ch == kEOL || (!has_state_override && ch == '#')) { + url->flags |= URL_FLAGS_HAS_QUERY; + url->query = buffer; + buffer.clear(); + if (ch == '#') + state = kFragment; + } else { + AppendOrEscape(&buffer, ch, QUERY_ENCODE_SET); + } + break; + case kFragment: + switch (ch) { + case kEOL: + url->flags |= URL_FLAGS_HAS_FRAGMENT; + url->fragment = buffer; + break; + case 0: + break; + default: + AppendOrEscape(&buffer, ch, C0_CONTROL_ENCODE_SET); + } + break; + default: + url->flags |= URL_FLAGS_INVALID_PARSE_STATE; + return; + } + + p++; + } +} // NOLINT(readability/fn_size) + +static inline void SetArgs(Environment* env, + Local argv[], + const struct url_data* url) { + Isolate* isolate = env->isolate(); + argv[ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url->flags); + argv[ARG_PROTOCOL] = OneByteString(isolate, url->scheme.c_str()); + if (url->flags & URL_FLAGS_HAS_USERNAME) + argv[ARG_USERNAME] = UTF8STRING(isolate, url->username); + if (url->flags & URL_FLAGS_HAS_PASSWORD) + argv[ARG_PASSWORD] = UTF8STRING(isolate, url->password); + if (url->flags & URL_FLAGS_HAS_HOST) + argv[ARG_HOST] = UTF8STRING(isolate, url->host); + if (url->flags & URL_FLAGS_HAS_QUERY) + argv[ARG_QUERY] = UTF8STRING(isolate, url->query); + if (url->flags & URL_FLAGS_HAS_FRAGMENT) + argv[ARG_FRAGMENT] = UTF8STRING(isolate, url->fragment); + if (url->port > -1) + argv[ARG_PORT] = Integer::New(isolate, url->port); + if (url->flags & URL_FLAGS_HAS_PATH) + argv[ARG_PATH] = Copy(env, url->path); +} + +static void Parse(Environment* env, + Local recv, + const char* input, + const size_t len, + enum url_parse_state state_override, + Local base_obj, + Local context_obj, + Local cb, + Local error_cb) { + Isolate* isolate = env->isolate(); + Local context = env->context(); + HandleScope handle_scope(isolate); + Context::Scope context_scope(context); + + const bool has_context = context_obj->IsObject(); + const bool has_base = base_obj->IsObject(); + + struct url_data base; + struct url_data url; + if (has_context) + HarvestContext(env, &url, context_obj.As()); + if (has_base) + HarvestBase(env, &base, base_obj.As()); + + URL::Parse(input, len, state_override, &url, has_context, &base, has_base); + if ((url.flags & URL_FLAGS_INVALID_PARSE_STATE) || + ((state_override != kUnknownState) && + (url.flags & URL_FLAGS_TERMINATED))) + return; + + // Define the return value placeholders + const Local undef = Undefined(isolate); + const Local null = Null(isolate); + if (!(url.flags & URL_FLAGS_FAILED)) { + Local argv[9] = { + undef, + undef, + undef, + undef, + null, // host defaults to null + null, // port defaults to null + undef, + null, // query defaults to null + null, // fragment defaults to null + }; + SetArgs(env, argv, &url); + cb->Call(context, recv, arraysize(argv), argv).FromMaybe(Local()); + } else if (error_cb->IsFunction()) { + Local argv[2] = { undef, undef }; + argv[ERR_ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags); + argv[ERR_ARG_INPUT] = + String::NewFromUtf8(env->isolate(), + input, + v8::NewStringType::kNormal).ToLocalChecked(); + error_cb.As()->Call(context, recv, arraysize(argv), argv) + .FromMaybe(Local()); + } +} + +static void Parse(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK_GE(args.Length(), 5); + CHECK(args[0]->IsString()); // input + CHECK(args[2]->IsUndefined() || // base context + args[2]->IsNull() || + args[2]->IsObject()); + CHECK(args[3]->IsUndefined() || // context + args[3]->IsNull() || + args[3]->IsObject()); + CHECK(args[4]->IsFunction()); // complete callback + CHECK(args[5]->IsUndefined() || args[5]->IsFunction()); // error callback + + Utf8Value input(env->isolate(), args[0]); + enum url_parse_state state_override = kUnknownState; + if (args[1]->IsNumber()) { + state_override = static_cast( + args[1]->Uint32Value(env->context()).FromJust()); + } + + Parse(env, args.This(), + *input, input.length(), + state_override, + args[2], + args[3], + args[4].As(), + args[5]); +} + +static void EncodeAuthSet(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK_GE(args.Length(), 1); + CHECK(args[0]->IsString()); + Utf8Value value(env->isolate(), args[0]); + std::string output; + const size_t len = value.length(); + output.reserve(len); + for (size_t n = 0; n < len; n++) { + const char ch = (*value)[n]; + AppendOrEscape(&output, ch, USERINFO_ENCODE_SET); + } + args.GetReturnValue().Set( + String::NewFromUtf8(env->isolate(), + output.c_str(), + v8::NewStringType::kNormal).ToLocalChecked()); +} + +static void ToUSVString(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK_GE(args.Length(), 2); + CHECK(args[0]->IsString()); + CHECK(args[1]->IsNumber()); + + TwoByteValue value(env->isolate(), args[0]); + const size_t n = value.length(); + + const int64_t start = args[1]->IntegerValue(env->context()).FromJust(); + CHECK_GE(start, 0); + + for (size_t i = start; i < n; i++) { + char16_t c = value[i]; + if (!IsUnicodeSurrogate(c)) { + continue; + } else if (IsUnicodeSurrogateTrail(c) || i == n - 1) { + value[i] = kUnicodeReplacementCharacter; + } else { + char16_t d = value[i + 1]; + if (IsUnicodeTrail(d)) { + i++; + } else { + value[i] = kUnicodeReplacementCharacter; + } + } + } + + args.GetReturnValue().Set( + String::NewFromTwoByte(env->isolate(), + *value, + v8::NewStringType::kNormal, + n).ToLocalChecked()); +} + +static void DomainToASCII(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK_GE(args.Length(), 1); + CHECK(args[0]->IsString()); + Utf8Value value(env->isolate(), args[0]); + + url_host host{{""}, HOST_TYPE_DOMAIN}; + // Assuming the host is used for a special scheme. + ParseHost(&host, *value, value.length(), true); + if (host.type == HOST_TYPE_FAILED) { + args.GetReturnValue().Set(FIXED_ONE_BYTE_STRING(env->isolate(), "")); + return; + } + std::string out; + WriteHost(&host, &out); + args.GetReturnValue().Set( + String::NewFromUtf8(env->isolate(), + out.c_str(), + v8::NewStringType::kNormal).ToLocalChecked()); +} + +static void DomainToUnicode(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK_GE(args.Length(), 1); + CHECK(args[0]->IsString()); + Utf8Value value(env->isolate(), args[0]); + + url_host host{{""}, HOST_TYPE_DOMAIN}; + // Assuming the host is used for a special scheme. + ParseHost(&host, *value, value.length(), true, true); + if (host.type == HOST_TYPE_FAILED) { + args.GetReturnValue().Set(FIXED_ONE_BYTE_STRING(env->isolate(), "")); + return; + } + std::string out; + WriteHost(&host, &out); + args.GetReturnValue().Set( + String::NewFromUtf8(env->isolate(), + out.c_str(), + v8::NewStringType::kNormal).ToLocalChecked()); +} + +std::string URL::ToFilePath() const { + if (context_.scheme != "file:") { + return ""; + } + +#ifdef _WIN32 + const char* slash = "\\"; + auto is_slash = [] (char ch) { + return ch == '/' || ch == '\\'; + }; +#else + const char* slash = "/"; + auto is_slash = [] (char ch) { + return ch == '/'; + }; + if ((context_.flags & URL_FLAGS_HAS_HOST) && + context_.host.length() > 0) { + return ""; + } +#endif + std::string decoded_path; + for (const std::string& part : context_.path) { + std::string decoded; + PercentDecode(part.c_str(), part.length(), &decoded); + for (char& ch : decoded) { + if (is_slash(ch)) { + return ""; + } + } + decoded_path += slash + decoded; + } + +#ifdef _WIN32 + // TODO(TimothyGu): Use "\\?\" long paths on Windows. + + // If hostname is set, then we have a UNC path. Pass the hostname through + // ToUnicode just in case it is an IDN using punycode encoding. We do not + // need to worry about percent encoding because the URL parser will have + // already taken care of that for us. Note that this only causes IDNs with an + // appropriate `xn--` prefix to be decoded. + if ((context_.flags & URL_FLAGS_HAS_HOST) && + context_.host.length() > 0) { + std::string unicode_host; + if (!ToUnicode(context_.host, &unicode_host)) { + return ""; + } + return "\\\\" + unicode_host + decoded_path; + } + // Otherwise, it's a local path that requires a drive letter. + if (decoded_path.length() < 3) { + return ""; + } + if (decoded_path[2] != ':' || + !IsASCIIAlpha(decoded_path[1])) { + return ""; + } + // Strip out the leading '\'. + return decoded_path.substr(1); +#else + return decoded_path; +#endif +} + +// This function works by calling out to a JS function that creates and +// returns the JS URL object. Be mindful of the JS<->Native boundary +// crossing that is required. +const Local URL::ToObject(Environment* env) const { + Isolate* isolate = env->isolate(); + Local context = env->context(); + Context::Scope context_scope(context); + + const Local undef = Undefined(isolate); + const Local null = Null(isolate); + + if (context_.flags & URL_FLAGS_FAILED) + return Local(); + + Local argv[9] = { + undef, + undef, + undef, + undef, + null, // host defaults to null + null, // port defaults to null + undef, + null, // query defaults to null + null, // fragment defaults to null + }; + SetArgs(env, argv, &context_); + + TryCatch try_catch(isolate); + + // The SetURLConstructor method must have been called already to + // set the constructor function used below. SetURLConstructor is + // called automatically when the internal/url.js module is loaded + // during the internal/bootstrap_node.js processing. + MaybeLocal ret = + env->url_constructor_function() + ->Call(env->context(), undef, 9, argv); + + if (ret.IsEmpty()) { + ClearFatalExceptionHandlers(env); + FatalException(isolate, try_catch); + } + + return ret.ToLocalChecked(); +} + +static void SetURLConstructor(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + CHECK_EQ(args.Length(), 1); + CHECK(args[0]->IsFunction()); + env->set_url_constructor_function(args[0].As()); +} + +static void Init(Local target, + Local unused, + Local context, + void* priv) { + Environment* env = Environment::GetCurrent(context); + env->SetMethod(target, "parse", Parse); + env->SetMethod(target, "encodeAuth", EncodeAuthSet); + env->SetMethod(target, "toUSVString", ToUSVString); + env->SetMethod(target, "domainToASCII", DomainToASCII); + env->SetMethod(target, "domainToUnicode", DomainToUnicode); + env->SetMethod(target, "setURLConstructor", SetURLConstructor); + +#define XX(name, _) NODE_DEFINE_CONSTANT(target, name); + FLAGS(XX) +#undef XX + +#define XX(name) NODE_DEFINE_CONSTANT(target, name); + PARSESTATES(XX) +#undef XX +} +} // namespace url +} // namespace node + +NODE_MODULE_CONTEXT_AWARE_BUILTIN(url, node::url::Init) diff --git a/src/node_url.h b/src/node_url.h new file mode 100644 index 00000000000000..6b526d15b07703 --- /dev/null +++ b/src/node_url.h @@ -0,0 +1,191 @@ +#ifndef SRC_NODE_URL_H_ +#define SRC_NODE_URL_H_ + +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#include "node.h" +#include "env-inl.h" + +#include + +namespace node { +namespace url { + +using v8::Local; +using v8::Value; + + +#define PARSESTATES(XX) \ + XX(kSchemeStart) \ + XX(kScheme) \ + XX(kNoScheme) \ + XX(kSpecialRelativeOrAuthority) \ + XX(kPathOrAuthority) \ + XX(kRelative) \ + XX(kRelativeSlash) \ + XX(kSpecialAuthoritySlashes) \ + XX(kSpecialAuthorityIgnoreSlashes) \ + XX(kAuthority) \ + XX(kHost) \ + XX(kHostname) \ + XX(kPort) \ + XX(kFile) \ + XX(kFileSlash) \ + XX(kFileHost) \ + XX(kPathStart) \ + XX(kPath) \ + XX(kCannotBeBase) \ + XX(kQuery) \ + XX(kFragment) + +#define FLAGS(XX) \ + XX(URL_FLAGS_NONE, 0) \ + XX(URL_FLAGS_FAILED, 0x01) \ + XX(URL_FLAGS_CANNOT_BE_BASE, 0x02) \ + XX(URL_FLAGS_INVALID_PARSE_STATE, 0x04) \ + XX(URL_FLAGS_TERMINATED, 0x08) \ + XX(URL_FLAGS_SPECIAL, 0x10) \ + XX(URL_FLAGS_HAS_USERNAME, 0x20) \ + XX(URL_FLAGS_HAS_PASSWORD, 0x40) \ + XX(URL_FLAGS_HAS_HOST, 0x80) \ + XX(URL_FLAGS_HAS_PATH, 0x100) \ + XX(URL_FLAGS_HAS_QUERY, 0x200) \ + XX(URL_FLAGS_HAS_FRAGMENT, 0x400) + +enum url_parse_state { + kUnknownState = -1, +#define XX(name) name, + PARSESTATES(XX) +#undef XX +}; + +enum url_flags { +#define XX(name, val) name = val, + FLAGS(XX) +#undef XX +}; + +struct url_data { + int32_t flags = URL_FLAGS_NONE; + int port = -1; + std::string scheme; + std::string username; + std::string password; + std::string host; + std::string query; + std::string fragment; + std::vector path; +}; + +class URL { + public: + static void Parse(const char* input, + size_t len, + enum url_parse_state state_override, + struct url_data* url, + bool has_url, + const struct url_data* base, + bool has_base); + + URL(const char* input, const size_t len) { + Parse(input, len, kUnknownState, &context_, false, nullptr, false); + } + + URL(const char* input, const size_t len, const URL* base) { + if (base != nullptr) + Parse(input, len, kUnknownState, + &context_, false, + &(base->context_), true); + else + Parse(input, len, kUnknownState, &context_, false, nullptr, false); + } + + URL(const char* input, const size_t len, + const char* base, const size_t baselen) { + if (base != nullptr && baselen > 0) { + URL _base(base, baselen); + Parse(input, len, kUnknownState, + &context_, false, + &(_base.context_), true); + } else { + Parse(input, len, kUnknownState, &context_, false, nullptr, false); + } + } + + explicit URL(std::string input) : + URL(input.c_str(), input.length()) {} + + URL(std::string input, const URL* base) : + URL(input.c_str(), input.length(), base) {} + + URL(std::string input, const URL& base) : + URL(input.c_str(), input.length(), &base) {} + + URL(std::string input, std::string base) : + URL(input.c_str(), input.length(), base.c_str(), base.length()) {} + + int32_t flags() { + return context_.flags; + } + + int port() { + return context_.port; + } + + const std::string& protocol() const { + return context_.scheme; + } + + const std::string& username() const { + return context_.username; + } + + const std::string& password() const { + return context_.password; + } + + const std::string& host() const { + return context_.host; + } + + const std::string& query() const { + return context_.query; + } + + const std::string& fragment() const { + return context_.fragment; + } + + std::string path() const { + std::string ret; + for (auto i = context_.path.begin(); i != context_.path.end(); i++) { + ret += '/'; + ret += *i; + } + return ret; + } + + // Get the path of the file: URL in a format consumable by native file system + // APIs. Returns an empty string if something went wrong. + std::string ToFilePath() const; + + const Local ToObject(Environment* env) const; + + URL(const URL&) = default; + URL& operator=(const URL&) = default; + URL(URL&&) = default; + URL& operator=(URL&&) = default; + + URL() : URL("") {} + + private: + struct url_data context_; +}; + +} // namespace url + +} // namespace node + +#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS + +#endif // SRC_NODE_URL_H_ diff --git a/src/node_util.cc b/src/node_util.cc index f96e91483857c7..8b093ab842869d 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -54,6 +54,12 @@ static void GetProxyDetails(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(ret); } +// Side effect-free stringification that will never throw exceptions. +static void SafeToString(const FunctionCallbackInfo& args) { + auto context = args.GetIsolate()->GetCurrentContext(); + args.GetReturnValue().Set(args[0]->ToDetailString(context).ToLocalChecked()); +} + static void GetHiddenValue(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -122,6 +128,7 @@ void Initialize(Local target, env->SetMethod(target, "getHiddenValue", GetHiddenValue); env->SetMethod(target, "setHiddenValue", SetHiddenValue); env->SetMethod(target, "getProxyDetails", GetProxyDetails); + env->SetMethod(target, "safeToString", SafeToString); env->SetMethod(target, "startSigintWatchdog", StartSigintWatchdog); env->SetMethod(target, "stopSigintWatchdog", StopSigintWatchdog); diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 7d2f8d7ebbbd5f..347ca8a3ac70ec 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -97,6 +97,7 @@ void UDPWrap::Initialize(Local target, GetSockOrPeerName); env->SetProtoMethod(t, "addMembership", AddMembership); env->SetProtoMethod(t, "dropMembership", DropMembership); + env->SetProtoMethod(t, "setMulticastInterface", SetMulticastInterface); env->SetProtoMethod(t, "setMulticastTTL", SetMulticastTTL); env->SetProtoMethod(t, "setMulticastLoopback", SetMulticastLoopback); env->SetProtoMethod(t, "setBroadcast", SetBroadcast); @@ -208,6 +209,22 @@ X(SetMulticastLoopback, uv_udp_set_multicast_loop) #undef X +void UDPWrap::SetMulticastInterface(const FunctionCallbackInfo& args) { + UDPWrap* wrap; + ASSIGN_OR_RETURN_UNWRAP(&wrap, + args.Holder(), + args.GetReturnValue().Set(UV_EBADF)); + + CHECK_EQ(args.Length(), 1); + CHECK(args[0]->IsString()); + + Utf8Value iface(args.GetIsolate(), args[0]); + + const char* iface_cstr = *iface; + + int err = uv_udp_set_multicast_interface(&wrap->handle_, iface_cstr); + args.GetReturnValue().Set(err); +} void UDPWrap::SetMembership(const FunctionCallbackInfo& args, uv_membership membership) { diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 8baa0235be12da..0faa22816f9640 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -28,6 +28,8 @@ class UDPWrap: public HandleWrap { static void RecvStop(const v8::FunctionCallbackInfo& args); static void AddMembership(const v8::FunctionCallbackInfo& args); static void DropMembership(const v8::FunctionCallbackInfo& args); + static void SetMulticastInterface( + const v8::FunctionCallbackInfo& args); static void SetMulticastTTL(const v8::FunctionCallbackInfo& args); static void SetMulticastLoopback( const v8::FunctionCallbackInfo& args); diff --git a/src/util.h b/src/util.h index 4ce25e4622f4b2..d1ada38ed57fd2 100644 --- a/src/util.h +++ b/src/util.h @@ -10,6 +10,7 @@ #include #include #include +#include // OSX 10.9 defaults to libc++ which provides a C++11 header. #if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090 @@ -310,29 +311,40 @@ class MaybeStackBuffer { return length_; } - // Call to make sure enough space for `storage` entries is available. - // There can only be 1 call to AllocateSufficientStorage or Invalidate - // per instance. + // Current maximum capacity of the buffer with which SetLength() can be used + // without first calling AllocateSufficientStorage(). + size_t capacity() const { + return IsAllocated() ? capacity_ : + IsInvalidated() ? 0 : kStackStorageSize; + } + + // Make sure enough space for `storage` entries is available. + // This method can be called multiple times throughout the lifetime of the + // buffer, but once this has been called Invalidate() cannot be used. + // Content of the buffer in the range [0, length()) is preserved. void AllocateSufficientStorage(size_t storage) { - if (storage <= kStackStorageSize) { - buf_ = buf_st_; - } else { - buf_ = Malloc(storage); + CHECK(!IsInvalidated()); + if (storage > capacity()) { + bool was_allocated = IsAllocated(); + T* allocated_ptr = was_allocated ? buf_ : nullptr; + buf_ = Realloc(allocated_ptr, storage); + capacity_ = storage; + if (!was_allocated && length_ > 0) + memcpy(buf_, buf_st_, length_ * sizeof(buf_[0])); } - // Remember how much was allocated to check against that in SetLength(). length_ = storage; } void SetLength(size_t length) { - // length_ stores how much memory was allocated. - CHECK_LE(length, length_); + // capacity() returns how much memory is actually available. + CHECK_LE(length, capacity()); length_ = length; } void SetLengthAndZeroTerminate(size_t length) { - // length_ stores how much memory was allocated. - CHECK_LE(length + 1, length_); + // capacity() returns how much memory is actually available. + CHECK_LE(length + 1, capacity()); SetLength(length); // T() is 0 for integer types, nullptr for pointers, etc. @@ -340,15 +352,35 @@ class MaybeStackBuffer { } // Make derefencing this object return nullptr. - // Calling this is mutually exclusive with calling - // AllocateSufficientStorage. + // This method can be called multiple times throughout the lifetime of the + // buffer, but once this has been called AllocateSufficientStorage() cannot + // be used. void Invalidate() { - CHECK_EQ(buf_, buf_st_); + CHECK(!IsAllocated()); length_ = 0; buf_ = nullptr; } - MaybeStackBuffer() : length_(0), buf_(buf_st_) { + // If the buffer is stored in the heap rather than on the stack. + bool IsAllocated() const { + return !IsInvalidated() && buf_ != buf_st_; + } + + // If Invalidate() has been called. + bool IsInvalidated() const { + return buf_ == nullptr; + } + + // Release ownership of the malloc'd buffer. + // Note: This does not free the buffer. + void Release() { + CHECK(IsAllocated()); + buf_ = buf_st_; + length_ = 0; + capacity_ = 0; + } + + MaybeStackBuffer() : length_(0), capacity_(0), buf_(buf_st_) { // Default to a zero-length, null-terminated buffer. buf_[0] = T(); } @@ -358,12 +390,14 @@ class MaybeStackBuffer { } ~MaybeStackBuffer() { - if (buf_ != buf_st_) + if (IsAllocated()) free(buf_); } private: size_t length_; + // capacity of the malloc'ed buf_ + size_t capacity_; T* buf_; T buf_st_[kStackStorageSize]; }; diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index e32e7e6dc6b3ba..5460a26e3764ad 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -34,8 +34,8 @@ struct Argv { snprintf(argv_[0], prog_len, "%s", prog); snprintf(argv_[0] + prog_len, arg1_len, "%s", arg1); snprintf(argv_[0] + prog_len + arg1_len, arg2_len, "%s", arg2); - argv_[1] = argv_[0] + prog_len + 1; - argv_[2] = argv_[0] + prog_len + arg1_len + 1; + argv_[1] = argv_[0] + prog_len; + argv_[2] = argv_[0] + prog_len + arg1_len; } ~Argv() { diff --git a/test/cctest/test_url.cc b/test/cctest/test_url.cc new file mode 100644 index 00000000000000..0b80d44caad807 --- /dev/null +++ b/test/cctest/test_url.cc @@ -0,0 +1,106 @@ +#include "node_url.h" +#include "node_i18n.h" + +#include "gtest/gtest.h" + +using node::url::URL; +using node::url::URL_FLAGS_FAILED; + +class URLTest : public ::testing::Test { + protected: + void SetUp() override { +#if defined(NODE_HAVE_I18N_SUPPORT) + std::string icu_data_dir; + node::i18n::InitializeICUDirectory(icu_data_dir); +#endif + } + + void TearDown() override {} +}; + +TEST_F(URLTest, Simple) { + URL simple("https://example.org:81/a/b/c?query#fragment"); + + EXPECT_FALSE(simple.flags() & URL_FLAGS_FAILED); + EXPECT_EQ(simple.protocol(), "https:"); + EXPECT_EQ(simple.host(), "example.org"); + EXPECT_EQ(simple.port(), 81); + EXPECT_EQ(simple.path(), "/a/b/c"); + EXPECT_EQ(simple.query(), "query"); + EXPECT_EQ(simple.fragment(), "fragment"); +} + +TEST_F(URLTest, Simple2) { + const char* input = "https://example.org:81/a/b/c?query#fragment"; + URL simple(input, strlen(input)); + + EXPECT_FALSE(simple.flags() & URL_FLAGS_FAILED); + EXPECT_EQ(simple.protocol(), "https:"); + EXPECT_EQ(simple.host(), "example.org"); + EXPECT_EQ(simple.port(), 81); + EXPECT_EQ(simple.path(), "/a/b/c"); + EXPECT_EQ(simple.query(), "query"); + EXPECT_EQ(simple.fragment(), "fragment"); +} + +TEST_F(URLTest, NoBase1) { + URL error("123noscheme"); + EXPECT_TRUE(error.flags() & URL_FLAGS_FAILED); +} + +TEST_F(URLTest, Base1) { + URL base("http://example.org/foo/bar"); + ASSERT_FALSE(base.flags() & URL_FLAGS_FAILED); + + URL simple("../baz", &base); + EXPECT_FALSE(simple.flags() & URL_FLAGS_FAILED); + EXPECT_EQ(simple.protocol(), "http:"); + EXPECT_EQ(simple.host(), "example.org"); + EXPECT_EQ(simple.path(), "/baz"); +} + +TEST_F(URLTest, Base2) { + URL simple("../baz", "http://example.org/foo/bar"); + + EXPECT_FALSE(simple.flags() & URL_FLAGS_FAILED); + EXPECT_EQ(simple.protocol(), "http:"); + EXPECT_EQ(simple.host(), "example.org"); + EXPECT_EQ(simple.path(), "/baz"); +} + +TEST_F(URLTest, Base3) { + const char* input = "../baz"; + const char* base = "http://example.org/foo/bar"; + + URL simple(input, strlen(input), base, strlen(base)); + + EXPECT_FALSE(simple.flags() & URL_FLAGS_FAILED); + EXPECT_EQ(simple.protocol(), "http:"); + EXPECT_EQ(simple.host(), "example.org"); + EXPECT_EQ(simple.path(), "/baz"); +} + +TEST_F(URLTest, ToFilePath) { +#define T(url, path) EXPECT_EQ(path, URL(url).ToFilePath()) + T("http://example.org/foo/bar", ""); + +#ifdef _WIN32 + T("file:///C:/Program%20Files/", "C:\\Program Files\\"); + T("file:///C:/a/b/c?query#fragment", "C:\\a\\b\\c"); + T("file://host/path/a/b/c?query#fragment", "\\\\host\\path\\a\\b\\c"); + T("file://xn--weird-prdj8vva.com/host/a", "\\\\wͪ͊eiͬ͋rd.com\\host\\a"); + T("file:///C:/a%2Fb", ""); + T("file:///", ""); + T("file:///home", ""); +#else + T("file:///", "/"); + T("file:///home/user?query#fragment", "/home/user"); + T("file:///home/user/?query#fragment", "/home/user/"); + T("file:///home/user/%20space", "/home/user/ space"); + T("file:///home/us%5Cer", "/home/us\\er"); + T("file:///home/us%2Fer", ""); + T("file://host/path", ""); +#endif + +#undef T +} diff --git a/test/cctest/test_util.cc b/test/cctest/test_util.cc index f1446ae0345153..62309306ba6ffb 100644 --- a/test/cctest/test_util.cc +++ b/test/cctest/test_util.cc @@ -121,3 +121,127 @@ TEST(UtilTest, UncheckedCalloc) { EXPECT_NE(nullptr, UncheckedCalloc(0)); EXPECT_NE(nullptr, UncheckedCalloc(1)); } + +template +static void MaybeStackBufferBasic() { + using node::MaybeStackBuffer; + + MaybeStackBuffer buf; + size_t old_length; + size_t old_capacity; + + /* Default constructor */ + EXPECT_EQ(0U, buf.length()); + EXPECT_FALSE(buf.IsAllocated()); + EXPECT_GT(buf.capacity(), buf.length()); + + /* SetLength() expansion */ + buf.SetLength(buf.capacity()); + EXPECT_EQ(buf.capacity(), buf.length()); + EXPECT_FALSE(buf.IsAllocated()); + + /* Means of accessing raw buffer */ + EXPECT_EQ(buf.out(), *buf); + EXPECT_EQ(&buf[0], *buf); + + /* Basic I/O */ + for (size_t i = 0; i < buf.length(); i++) + buf[i] = static_cast(i); + for (size_t i = 0; i < buf.length(); i++) + EXPECT_EQ(static_cast(i), buf[i]); + + /* SetLengthAndZeroTerminate() */ + buf.SetLengthAndZeroTerminate(buf.capacity() - 1); + EXPECT_EQ(buf.capacity() - 1, buf.length()); + for (size_t i = 0; i < buf.length(); i++) + EXPECT_EQ(static_cast(i), buf[i]); + buf.SetLength(buf.capacity()); + EXPECT_EQ(0, buf[buf.length() - 1]); + + /* Initial Realloc */ + old_length = buf.length() - 1; + old_capacity = buf.capacity(); + buf.AllocateSufficientStorage(buf.capacity() * 2); + EXPECT_EQ(buf.capacity(), buf.length()); + EXPECT_TRUE(buf.IsAllocated()); + for (size_t i = 0; i < old_length; i++) + EXPECT_EQ(static_cast(i), buf[i]); + EXPECT_EQ(0, buf[old_length]); + + /* SetLength() reduction and expansion */ + for (size_t i = 0; i < buf.length(); i++) + buf[i] = static_cast(i); + buf.SetLength(10); + for (size_t i = 0; i < buf.length(); i++) + EXPECT_EQ(static_cast(i), buf[i]); + buf.SetLength(buf.capacity()); + for (size_t i = 0; i < buf.length(); i++) + EXPECT_EQ(static_cast(i), buf[i]); + + /* Subsequent Realloc */ + old_length = buf.length(); + old_capacity = buf.capacity(); + buf.AllocateSufficientStorage(old_capacity * 1.5); + EXPECT_EQ(buf.capacity(), buf.length()); + EXPECT_EQ(static_cast(old_capacity * 1.5), buf.length()); + EXPECT_TRUE(buf.IsAllocated()); + for (size_t i = 0; i < old_length; i++) + EXPECT_EQ(static_cast(i), buf[i]); + + /* Basic I/O on Realloc'd buffer */ + for (size_t i = 0; i < buf.length(); i++) + buf[i] = static_cast(i); + for (size_t i = 0; i < buf.length(); i++) + EXPECT_EQ(static_cast(i), buf[i]); + + /* Release() */ + T* rawbuf = buf.out(); + buf.Release(); + EXPECT_EQ(0U, buf.length()); + EXPECT_FALSE(buf.IsAllocated()); + EXPECT_GT(buf.capacity(), buf.length()); + free(rawbuf); +} + +TEST(UtilTest, MaybeStackBuffer) { + using node::MaybeStackBuffer; + + MaybeStackBufferBasic(); + MaybeStackBufferBasic(); + + // Constructor with size parameter + { + MaybeStackBuffer buf(100); + EXPECT_EQ(100U, buf.length()); + EXPECT_FALSE(buf.IsAllocated()); + EXPECT_GT(buf.capacity(), buf.length()); + buf.SetLength(buf.capacity()); + EXPECT_EQ(buf.capacity(), buf.length()); + EXPECT_FALSE(buf.IsAllocated()); + for (size_t i = 0; i < buf.length(); i++) + buf[i] = static_cast(i); + for (size_t i = 0; i < buf.length(); i++) + EXPECT_EQ(static_cast(i), buf[i]); + + MaybeStackBuffer bigbuf(10000); + EXPECT_EQ(10000U, bigbuf.length()); + EXPECT_TRUE(bigbuf.IsAllocated()); + EXPECT_EQ(bigbuf.length(), bigbuf.capacity()); + for (size_t i = 0; i < bigbuf.length(); i++) + bigbuf[i] = static_cast(i); + for (size_t i = 0; i < bigbuf.length(); i++) + EXPECT_EQ(static_cast(i), bigbuf[i]); + } + + // Invalidated buffer + { + MaybeStackBuffer buf; + buf.Invalidate(); + EXPECT_TRUE(buf.IsInvalidated()); + EXPECT_FALSE(buf.IsAllocated()); + EXPECT_EQ(0U, buf.length()); + EXPECT_EQ(0U, buf.capacity()); + buf.Invalidate(); + EXPECT_TRUE(buf.IsInvalidated()); + } +} diff --git a/test/common/index.js b/test/common/index.js index 6ea3d89f0b9a37..7747cb57cf3ae7 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -577,6 +577,12 @@ exports.expectWarning = function(name, expected) { }, expected.length)); }; +Object.defineProperty(exports, 'hasIntl', { + get: function() { + return process.binding('config').hasIntl; + } +}); + // Crash the process on unhandled rejections. exports.crashOnUnhandledRejection = function() { process.on('unhandledRejection', diff --git a/test/fixtures/url-idna.js b/test/fixtures/url-idna.js new file mode 100644 index 00000000000000..4b8f5a48cc9646 --- /dev/null +++ b/test/fixtures/url-idna.js @@ -0,0 +1,215 @@ +'use strict'; + +// Credit for list: http://www.i18nguy.com/markup/idna-examples.html +module.exports = [ + { ascii: 'xn--mgbaal8b0b9b2b.icom.museum', + unicode: 'افغانستا.icom.museum' + }, + { + ascii: 'xn--lgbbat1ad8j.icom.museum', + unicode: 'الجزائر.icom.museum' + }, + { + ascii: 'xn--sterreich-z7a.icom.museum', + unicode: 'österreich.icom.museum' + }, + { + ascii: 'xn--54b6eqazv8bc7e.icom.museum', + unicode: 'বাংলাদেশ.icom.museum' + }, + { + ascii: 'xn--80abmy0agn7e.icom.museum', + unicode: 'беларусь.icom.museum' + }, + { + ascii: 'xn--belgi-rsa.icom.museum', + unicode: 'belgië.icom.museum' + }, + { + ascii: 'xn--80abgvm6a7d2b.icom.museum', + unicode: 'българия.icom.museum' + }, + { + ascii: 'xn--mgbfqim.icom.museum', + unicode: 'تشادر.icom.museum' + }, + { + ascii: 'xn--fiqs8s.icom.museum', + unicode: '中国.icom.museum' + }, + { + ascii: 'xn--mgbu4chg.icom.museum', + unicode: 'القمر.icom.museum' + }, + { + ascii: 'xn--vxakcego.icom.museum', + unicode: 'κυπρος.icom.museum' + }, + { + ascii: 'xn--eskrepublika-ebb62d.icom.museum', + unicode: 'českárepublika.icom.museum' + }, + { + ascii: 'xn--wgbh1c.icom.museum', + unicode: 'مصر.icom.museum' + }, + { + ascii: 'xn--hxakic4aa.icom.museum', + unicode: 'ελλάδα.icom.museum' + }, + { + ascii: 'xn--magyarorszg-t7a.icom.museum', + unicode: 'magyarország.icom.museum' + }, + { + ascii: 'xn--sland-ysa.icom.museum', + unicode: 'ísland.icom.museum' + }, + { + ascii: 'xn--h2brj9c.icom.museum', + unicode: 'भारत.icom.museum' + }, + { + ascii: 'xn--mgba3a4fra.icom.museum', + unicode: 'ايران.icom.museum' + }, + { + ascii: 'xn--ire-9la.icom.museum', + unicode: 'éire.icom.museum' + }, + { + ascii: 'xn--4dbklr2c8d.xn--4dbrk0ce.museum', + unicode: 'איקו״ם.ישראל.museum' + }, + { + ascii: 'xn--wgv71a.icom.museum', + unicode: '日本.icom.museum' + }, + { + ascii: 'xn--igbhzh7gpa.icom.museum', + unicode: 'الأردن.icom.museum' + }, + { + ascii: 'xn--80aaa0a6awh12ed.icom.museum', + unicode: 'қазақстан.icom.museum' + }, + { + ascii: 'xn--3e0b707e.icom.museum', + unicode: '한국.icom.museum' + }, + { + ascii: 'xn--80afmksoji0fc.icom.museum', + unicode: 'кыргызстан.icom.museum' + }, + { + ascii: 'xn--q7ce6a.icom.museum', + unicode: 'ລາວ.icom.museum' + }, + { + ascii: 'xn--mgbb7fjb.icom.museum', + unicode: 'لبنان.icom.museum' + }, + { + ascii: 'xn--80aaldqjmmi6x.icom.museum', + unicode: 'македонија.icom.museum' + }, + { + ascii: 'xn--mgbah1a3hjkrd.icom.museum', + unicode: 'موريتانيا.icom.museum' + }, + { + ascii: 'xn--mxico-bsa.icom.museum', + unicode: 'méxico.icom.museum' + }, + { + ascii: 'xn--c1aqabffc0aq.icom.museum', + unicode: 'монголулс.icom.museum' + }, + { + ascii: 'xn--mgbc0a9azcg.icom.museum', + unicode: 'المغرب.icom.museum' + }, + { + ascii: 'xn--l2bey1c2b.icom.museum', + unicode: 'नेपाल.icom.museum' + }, + { + ascii: 'xn--mgb9awbf.icom.museum', + unicode: 'عمان.icom.museum' + }, + { + ascii: 'xn--wgbl6a.icom.museum', + unicode: 'قطر.icom.museum' + }, + { + ascii: 'xn--romnia-yta.icom.museum', + unicode: 'românia.icom.museum' + }, + { + ascii: 'xn--h1alffa9f.xn--h1aegh.museum', + unicode: 'россия.иком.museum' + }, + { + ascii: 'xn--80aaabm1ab4blmeec9e7n.xn--h1aegh.museum', + unicode: 'србијаицрнагора.иком.museum' + }, + { + ascii: 'xn--xkc2al3hye2a.icom.museum', + unicode: 'இலங்கை.icom.museum' + }, + { + ascii: 'xn--espaa-rta.icom.museum', + unicode: 'españa.icom.museum' + }, + { + ascii: 'xn--o3cw4h.icom.museum', + unicode: 'ไทย.icom.museum' + }, + { + ascii: 'xn--pgbs0dh.icom.museum', + unicode: 'تونس.icom.museum' + }, + { + ascii: 'xn--trkiye-3ya.icom.museum', + unicode: 'türkiye.icom.museum' + }, + { + ascii: 'xn--80aaxgrpt.icom.museum', + unicode: 'украина.icom.museum' + }, + { + ascii: 'xn--vitnam-jk8b.icom.museum', + unicode: 'việtnam.icom.museum' + }, + // long label + { + ascii: `${'a'.repeat(64)}.com`, + unicode: `${'a'.repeat(64)}.com`, + }, + // long URL + { + ascii: `${`${'a'.repeat(64)}.`.repeat(4)}com`, + unicode: `${`${'a'.repeat(64)}.`.repeat(4)}com` + }, + // URLs with hyphen + { + ascii: 'r4---sn-a5mlrn7s.gevideo.com', + unicode: 'r4---sn-a5mlrn7s.gevideo.com' + }, + { + ascii: '-sn-a5mlrn7s.gevideo.com', + unicode: '-sn-a5mlrn7s.gevideo.com' + }, + { + ascii: 'sn-a5mlrn7s-.gevideo.com', + unicode: 'sn-a5mlrn7s-.gevideo.com' + }, + { + ascii: '-sn-a5mlrn7s-.gevideo.com', + unicode: '-sn-a5mlrn7s-.gevideo.com' + }, + { + ascii: '-sn--a5mlrn7s-.gevideo.com', + unicode: '-sn--a5mlrn7s-.gevideo.com' + } +]; diff --git a/test/fixtures/url-searchparams.js b/test/fixtures/url-searchparams.js new file mode 100644 index 00000000000000..918af678bc563e --- /dev/null +++ b/test/fixtures/url-searchparams.js @@ -0,0 +1,77 @@ +module.exports = [ + ['', '', []], + [ + 'foo=918854443121279438895193', + 'foo=918854443121279438895193', + [['foo', '918854443121279438895193']] + ], + ['foo=bar', 'foo=bar', [['foo', 'bar']]], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', [['foo', 'bar'], ['foo', 'quux']]], + ['foo=1&bar=2', 'foo=1&bar=2', [['foo', '1'], ['bar', '2']]], + [ + "my%20weird%20field=q1!2%22'w%245%267%2Fz8)%3F", + 'my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + [['my weird field', 'q1!2"\'w$5&7/z8)?']] + ], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', [['foo=baz', 'bar']]], + ['foo=baz=bar', 'foo=baz%3Dbar', [['foo', 'baz=bar']]], + [ + 'str=foo&arr=1&somenull&arr=2&undef=&arr=3', + 'str=foo&arr=1&somenull=&arr=2&undef=&arr=3', + [ + ['str', 'foo'], + ['arr', '1'], + ['somenull', ''], + ['arr', '2'], + ['undef', ''], + ['arr', '3'] + ] + ], + [' foo = bar ', '+foo+=+bar+', [[' foo ', ' bar ']]], + ['foo=%zx', 'foo=%25zx', [['foo', '%zx']]], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', [['foo', '\ufffd']]], + // See: https://github.com/joyent/node/issues/3058 + ['foo&bar=baz', 'foo=&bar=baz', [['foo', ''], ['bar', 'baz']]], + ['a=b&c&d=e', 'a=b&c=&d=e', [['a', 'b'], ['c', ''], ['d', 'e']]], + ['a=b&c=&d=e', 'a=b&c=&d=e', [['a', 'b'], ['c', ''], ['d', 'e']]], + ['a=b&=c&d=e', 'a=b&=c&d=e', [['a', 'b'], ['', 'c'], ['d', 'e']]], + ['a=b&=&d=e', 'a=b&=&d=e', [['a', 'b'], ['', ''], ['d', 'e']]], + ['&&foo=bar&&', 'foo=bar', [['foo', 'bar']]], + ['&', '', []], + ['&&&&', '', []], + ['&=&', '=', [['', '']]], + ['&=&=', '=&=', [['', ''], ['', '']]], + ['=', '=', [['', '']]], + ['+', '+=', [[' ', '']]], + ['+=', '+=', [[' ', '']]], + ['+&', '+=', [[' ', '']]], + ['=+', '=+', [['', ' ']]], + ['+=&', '+=', [[' ', '']]], + ['a&&b', 'a=&b=', [['a', ''], ['b', '']]], + ['a=a&&b=b', 'a=a&b=b', [['a', 'a'], ['b', 'b']]], + ['&a', 'a=', [['a', '']]], + ['&=', '=', [['', '']]], + ['a&a&', 'a=&a=', [['a', ''], ['a', '']]], + ['a&a&a&', 'a=&a=&a=', [['a', ''], ['a', ''], ['a', '']]], + ['a&a&a&a&', 'a=&a=&a=&a=', [['a', ''], ['a', ''], ['a', ''], ['a', '']]], + ['a=&a=value&a=', 'a=&a=value&a=', [['a', ''], ['a', 'value'], ['a', '']]], + ['foo%20bar=baz%20quux', 'foo+bar=baz+quux', [['foo bar', 'baz quux']]], + ['+foo=+bar', '+foo=+bar', [[' foo', ' bar']]], + ['a+', 'a+=', [['a ', '']]], + ['=a+', '=a+', [['', 'a ']]], + ['a+&', 'a+=', [['a ', '']]], + ['=a+&', '=a+', [['', 'a ']]], + ['%20+', '++=', [[' ', '']]], + ['=%20+', '=++', [['', ' ']]], + ['%20+&', '++=', [[' ', '']]], + ['=%20+&', '=++', [['', ' ']]], + [ + // fake percent encoding + 'foo=%©ar&baz=%A©uux&xyzzy=%©ud', + 'foo=%25%C2%A9ar&baz=%25A%C2%A9uux&xyzzy=%25%C2%A9ud', + [['foo', '%©ar'], ['baz', '%A©uux'], ['xyzzy', '%©ud']] + ], + // always preserve order of key-value pairs + ['a=1&b=2&a=3', 'a=1&b=2&a=3', [['a', '1'], ['b', '2'], ['a', '3']]], + ['?a', '%3Fa=', [['?a', '']]] +]; diff --git a/test/fixtures/url-setter-tests-additional.js b/test/fixtures/url-setter-tests-additional.js new file mode 100644 index 00000000000000..b27ae336a28776 --- /dev/null +++ b/test/fixtures/url-setter-tests-additional.js @@ -0,0 +1,237 @@ +module.exports = { + 'username': [ + { + 'comment': 'Surrogate pair', + 'href': 'https://github.com/', + 'new_value': '\uD83D\uDE00', + 'expected': { + 'href': 'https://%F0%9F%98%80@github.com/', + 'username': '%F0%9F%98%80' + } + }, + { + 'comment': 'Unpaired low surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uD83D', + 'expected': { + 'href': 'https://%EF%BF%BD@github.com/', + 'username': '%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired low surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uD83Dnode', + 'expected': { + 'href': 'https://%EF%BF%BDnode@github.com/', + 'username': '%EF%BF%BDnode' + } + }, + { + 'comment': 'Unpaired high surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uDE00', + 'expected': { + 'href': 'https://%EF%BF%BD@github.com/', + 'username': '%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired high surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uDE00node', + 'expected': { + 'href': 'https://%EF%BF%BDnode@github.com/', + 'username': '%EF%BF%BDnode' + } + } + ], + 'password': [ + { + 'comment': 'Surrogate pair', + 'href': 'https://github.com/', + 'new_value': '\uD83D\uDE00', + 'expected': { + 'href': 'https://:%F0%9F%98%80@github.com/', + 'password': '%F0%9F%98%80' + } + }, + { + 'comment': 'Unpaired low surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uD83D', + 'expected': { + 'href': 'https://:%EF%BF%BD@github.com/', + 'password': '%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired low surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uD83Dnode', + 'expected': { + 'href': 'https://:%EF%BF%BDnode@github.com/', + 'password': '%EF%BF%BDnode' + } + }, + { + 'comment': 'Unpaired high surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uDE00', + 'expected': { + 'href': 'https://:%EF%BF%BD@github.com/', + 'password': '%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired high surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uDE00node', + 'expected': { + 'href': 'https://:%EF%BF%BDnode@github.com/', + 'password': '%EF%BF%BDnode' + } + } + ], + 'pathname': [ + { + 'comment': 'Surrogate pair', + 'href': 'https://github.com/', + 'new_value': '/\uD83D\uDE00', + 'expected': { + 'href': 'https://github.com/%F0%9F%98%80', + 'pathname': '/%F0%9F%98%80' + } + }, + { + 'comment': 'Unpaired low surrogate 1', + 'href': 'https://github.com/', + 'new_value': '/\uD83D', + 'expected': { + 'href': 'https://github.com/%EF%BF%BD', + 'pathname': '/%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired low surrogate 2', + 'href': 'https://github.com/', + 'new_value': '/\uD83Dnode', + 'expected': { + 'href': 'https://github.com/%EF%BF%BDnode', + 'pathname': '/%EF%BF%BDnode' + } + }, + { + 'comment': 'Unpaired high surrogate 1', + 'href': 'https://github.com/', + 'new_value': '/\uDE00', + 'expected': { + 'href': 'https://github.com/%EF%BF%BD', + 'pathname': '/%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired high surrogate 2', + 'href': 'https://github.com/', + 'new_value': '/\uDE00node', + 'expected': { + 'href': 'https://github.com/%EF%BF%BDnode', + 'pathname': '/%EF%BF%BDnode' + } + } + ], + 'search': [ + { + 'comment': 'Surrogate pair', + 'href': 'https://github.com/', + 'new_value': '\uD83D\uDE00', + 'expected': { + 'href': 'https://github.com/?%F0%9F%98%80', + 'search': '?%F0%9F%98%80' + } + }, + { + 'comment': 'Unpaired low surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uD83D', + 'expected': { + 'href': 'https://github.com/?%EF%BF%BD', + 'search': '?%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired low surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uD83Dnode', + 'expected': { + 'href': 'https://github.com/?%EF%BF%BDnode', + 'search': '?%EF%BF%BDnode' + } + }, + { + 'comment': 'Unpaired high surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uDE00', + 'expected': { + 'href': 'https://github.com/?%EF%BF%BD', + 'search': '?%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired high surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uDE00node', + 'expected': { + 'href': 'https://github.com/?%EF%BF%BDnode', + 'search': '?%EF%BF%BDnode' + } + } + ], + 'hash': [ + { + 'comment': 'Surrogate pair', + 'href': 'https://github.com/', + 'new_value': '\uD83D\uDE00', + 'expected': { + 'href': 'https://github.com/#%F0%9F%98%80', + 'hash': '#%F0%9F%98%80' + } + }, + { + 'comment': 'Unpaired low surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uD83D', + 'expected': { + 'href': 'https://github.com/#%EF%BF%BD', + 'hash': '#%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired low surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uD83Dnode', + 'expected': { + 'href': 'https://github.com/#%EF%BF%BDnode', + 'hash': '#%EF%BF%BDnode' + } + }, + { + 'comment': 'Unpaired high surrogate 1', + 'href': 'https://github.com/', + 'new_value': '\uDE00', + 'expected': { + 'href': 'https://github.com/#%EF%BF%BD', + 'hash': '#%EF%BF%BD' + } + }, + { + 'comment': 'Unpaired high surrogate 2', + 'href': 'https://github.com/', + 'new_value': '\uDE00node', + 'expected': { + 'href': 'https://github.com/#%EF%BF%BDnode', + 'hash': '#%EF%BF%BDnode' + } + } + ] +}; diff --git a/test/fixtures/url-setter-tests.js b/test/fixtures/url-setter-tests.js new file mode 100644 index 00000000000000..6f769eaec7543d --- /dev/null +++ b/test/fixtures/url-setter-tests.js @@ -0,0 +1,1823 @@ +'use strict'; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/b30abaecf4/url/setters_tests.json + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +module.exports = +{ + "comment": [ + "## Tests for setters of https://url.spec.whatwg.org/#urlutils-members", + "", + "This file contains a JSON object.", + "Other than 'comment', each key is an attribute of the `URL` interface", + "defined in WHATWG’s URL Standard.", + "The values are arrays of test case objects for that attribute.", + "", + "To run a test case for the attribute `attr`:", + "", + "* Create a new `URL` object with the value for the 'href' key", + " the constructor single parameter. (Without a base URL.)", + " This must not throw.", + "* Set the attribute `attr` to (invoke its setter with)", + " with the value of for 'new_value' key.", + "* The value for the 'expected' key is another object.", + " For each `key` / `value` pair of that object,", + " get the attribute `key` (invoke its getter).", + " The returned string must be equal to `value`.", + "", + "Note: the 'href' setter is already covered by urltestdata.json." + ], + "protocol": [ + { + "comment": "The empty string is not a valid scheme. Setter leaves the URL unchanged.", + "href": "a://example.net", + "new_value": "", + "expected": { + "href": "a://example.net", + "protocol": "a:" + } + }, + { + "href": "a://example.net", + "new_value": "b", + "expected": { + "href": "b://example.net", + "protocol": "b:" + } + }, + { + "href": "javascript:alert(1)", + "new_value": "defuse", + "expected": { + "href": "defuse:alert(1)", + "protocol": "defuse:" + } + }, + { + "comment": "Upper-case ASCII is lower-cased", + "href": "a://example.net", + "new_value": "B", + "expected": { + "href": "b://example.net", + "protocol": "b:" + } + }, + { + "comment": "Non-ASCII is rejected", + "href": "a://example.net", + "new_value": "é", + "expected": { + "href": "a://example.net", + "protocol": "a:" + } + }, + { + "comment": "No leading digit", + "href": "a://example.net", + "new_value": "0b", + "expected": { + "href": "a://example.net", + "protocol": "a:" + } + }, + { + "comment": "No leading punctuation", + "href": "a://example.net", + "new_value": "+b", + "expected": { + "href": "a://example.net", + "protocol": "a:" + } + }, + { + "href": "a://example.net", + "new_value": "bC0+-.", + "expected": { + "href": "bc0+-.://example.net", + "protocol": "bc0+-.:" + } + }, + { + "comment": "Only some punctuation is acceptable", + "href": "a://example.net", + "new_value": "b,c", + "expected": { + "href": "a://example.net", + "protocol": "a:" + } + }, + { + "comment": "Non-ASCII is rejected", + "href": "a://example.net", + "new_value": "bé", + "expected": { + "href": "a://example.net", + "protocol": "a:" + } + }, + { + "comment": "Can’t switch from URL containing username/password/port to file", + "href": "http://test@example.net", + "new_value": "file", + "expected": { + "href": "http://test@example.net/", + "protocol": "http:" + } + }, + { + "href": "gopher://example.net:1234", + "new_value": "file", + "expected": { + "href": "gopher://example.net:1234/", + "protocol": "gopher:" + } + }, + { + "href": "wss://x:x@example.net:1234", + "new_value": "file", + "expected": { + "href": "wss://x:x@example.net:1234/", + "protocol": "wss:" + } + }, + { + "comment": "Can’t switch from file URL with no host", + "href": "file://localhost/", + "new_value": "http", + "expected": { + "href": "file:///", + "protocol": "file:" + } + }, + { + "href": "file:///test", + "new_value": "gopher", + "expected": { + "href": "file:///test", + "protocol": "file:" + } + }, + { + "href": "file:", + "new_value": "wss", + "expected": { + "href": "file:///", + "protocol": "file:" + } + }, + { + "comment": "Can’t switch from special scheme to non-special", + "href": "http://example.net", + "new_value": "b", + "expected": { + "href": "http://example.net/", + "protocol": "http:" + } + }, + { + "href": "file://hi/path", + "new_value": "s", + "expected": { + "href": "file://hi/path", + "protocol": "file:" + } + }, + { + "href": "https://example.net", + "new_value": "s", + "expected": { + "href": "https://example.net/", + "protocol": "https:" + } + }, + { + "href": "ftp://example.net", + "new_value": "test", + "expected": { + "href": "ftp://example.net/", + "protocol": "ftp:" + } + }, + { + "comment": "Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.", + "href": "mailto:me@example.net", + "new_value": "http", + "expected": { + "href": "mailto:me@example.net", + "protocol": "mailto:" + } + }, + { + "comment": "Can’t switch from non-special scheme to special", + "href": "ssh://me@example.net", + "new_value": "http", + "expected": { + "href": "ssh://me@example.net", + "protocol": "ssh:" + } + }, + { + "href": "ssh://me@example.net", + "new_value": "gopher", + "expected": { + "href": "ssh://me@example.net", + "protocol": "ssh:" + } + }, + { + "href": "ssh://me@example.net", + "new_value": "file", + "expected": { + "href": "ssh://me@example.net", + "protocol": "ssh:" + } + }, + { + "href": "ssh://example.net", + "new_value": "file", + "expected": { + "href": "ssh://example.net", + "protocol": "ssh:" + } + }, + { + "href": "nonsense:///test", + "new_value": "https", + "expected": { + "href": "nonsense:///test", + "protocol": "nonsense:" + } + }, + { + "comment": "Stuff after the first ':' is ignored", + "href": "http://example.net", + "new_value": "https:foo : bar", + "expected": { + "href": "https://example.net/", + "protocol": "https:" + } + }, + { + "comment": "Stuff after the first ':' is ignored", + "href": "data:text/html,

    Test", + "new_value": "view-source+data:foo : bar", + "expected": { + "href": "view-source+data:text/html,

    Test", + "protocol": "view-source+data:" + } + }, + { + "comment": "Port is set to null if it is the default for new scheme.", + "href": "http://foo.com:443/", + "new_value": "https", + "expected": { + "href": "https://foo.com/", + "protocol": "https:", + "port": "" + } + } + ], + "username": [ + { + "comment": "No host means no username", + "href": "file:///home/you/index.html", + "new_value": "me", + "expected": { + "href": "file:///home/you/index.html", + "username": "" + } + }, + { + "comment": "No host means no username", + "href": "unix:/run/foo.socket", + "new_value": "me", + "expected": { + "href": "unix:/run/foo.socket", + "username": "" + } + }, + { + "comment": "Cannot-be-a-base means no username", + "href": "mailto:you@example.net", + "new_value": "me", + "expected": { + "href": "mailto:you@example.net", + "username": "" + } + }, + { + "href": "javascript:alert(1)", + "new_value": "wario", + "expected": { + "href": "javascript:alert(1)", + "username": "" + } + }, + { + "href": "http://example.net", + "new_value": "me", + "expected": { + "href": "http://me@example.net/", + "username": "me" + } + }, + { + "href": "http://:secret@example.net", + "new_value": "me", + "expected": { + "href": "http://me:secret@example.net/", + "username": "me" + } + }, + { + "href": "http://me@example.net", + "new_value": "", + "expected": { + "href": "http://example.net/", + "username": "" + } + }, + { + "href": "http://me:secret@example.net", + "new_value": "", + "expected": { + "href": "http://:secret@example.net/", + "username": "" + } + }, + { + "comment": "UTF-8 percent encoding with the userinfo encode set.", + "href": "http://example.net", + "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé", + "expected": { + "href": "http://%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9@example.net/", + "username": "%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9" + } + }, + { + "comment": "Bytes already percent-encoded are left as-is.", + "href": "http://example.net", + "new_value": "%c3%89té", + "expected": { + "href": "http://%c3%89t%C3%A9@example.net/", + "username": "%c3%89t%C3%A9" + } + }, + { + "href": "sc:///", + "new_value": "x", + "expected": { + "href": "sc:///", + "username": "" + } + }, + { + "href": "javascript://x/", + "new_value": "wario", + "expected": { + "href": "javascript://wario@x/", + "username": "wario" + } + }, + { + "href": "file://test/", + "new_value": "test", + "expected": { + "href": "file://test/", + "username": "" + } + } + ], + "password": [ + { + "comment": "No host means no password", + "href": "file:///home/me/index.html", + "new_value": "secret", + "expected": { + "href": "file:///home/me/index.html", + "password": "" + } + }, + { + "comment": "No host means no password", + "href": "unix:/run/foo.socket", + "new_value": "secret", + "expected": { + "href": "unix:/run/foo.socket", + "password": "" + } + }, + { + "comment": "Cannot-be-a-base means no password", + "href": "mailto:me@example.net", + "new_value": "secret", + "expected": { + "href": "mailto:me@example.net", + "password": "" + } + }, + { + "href": "http://example.net", + "new_value": "secret", + "expected": { + "href": "http://:secret@example.net/", + "password": "secret" + } + }, + { + "href": "http://me@example.net", + "new_value": "secret", + "expected": { + "href": "http://me:secret@example.net/", + "password": "secret" + } + }, + { + "href": "http://:secret@example.net", + "new_value": "", + "expected": { + "href": "http://example.net/", + "password": "" + } + }, + { + "href": "http://me:secret@example.net", + "new_value": "", + "expected": { + "href": "http://me@example.net/", + "password": "" + } + }, + { + "comment": "UTF-8 percent encoding with the userinfo encode set.", + "href": "http://example.net", + "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé", + "expected": { + "href": "http://:%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9@example.net/", + "password": "%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9" + } + }, + { + "comment": "Bytes already percent-encoded are left as-is.", + "href": "http://example.net", + "new_value": "%c3%89té", + "expected": { + "href": "http://:%c3%89t%C3%A9@example.net/", + "password": "%c3%89t%C3%A9" + } + }, + { + "href": "sc:///", + "new_value": "x", + "expected": { + "href": "sc:///", + "password": "" + } + }, + { + "href": "javascript://x/", + "new_value": "bowser", + "expected": { + "href": "javascript://:bowser@x/", + "password": "bowser" + } + }, + { + "href": "file://test/", + "new_value": "test", + "expected": { + "href": "file://test/", + "password": "" + } + } + ], + "host": [ + { + "comment": "Non-special scheme", + "href": "sc://x/", + "new_value": "\u0000", + "expected": { + "href": "sc://x/", + "host": "x", + "hostname": "x" + } + }, + { + "href": "sc://x/", + "new_value": "\u0009", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "\u000A", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "\u000D", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": " ", + "expected": { + "href": "sc://x/", + "host": "x", + "hostname": "x" + } + }, + { + "href": "sc://x/", + "new_value": "#", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "/", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "?", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "@", + "expected": { + "href": "sc://x/", + "host": "x", + "hostname": "x" + } + }, + { + "href": "sc://x/", + "new_value": "ß", + "expected": { + "href": "sc://%C3%9F/", + "host": "%C3%9F", + "hostname": "%C3%9F" + } + }, + { + "comment": "IDNA Nontransitional_Processing", + "href": "https://x/", + "new_value": "ß", + "expected": { + "href": "https://xn--zca/", + "host": "xn--zca", + "hostname": "xn--zca" + } + }, + { + "comment": "Cannot-be-a-base means no host", + "href": "mailto:me@example.net", + "new_value": "example.com", + "expected": { + "href": "mailto:me@example.net", + "host": "" + } + }, + { + "comment": "Cannot-be-a-base means no password", + "href": "data:text/plain,Stuff", + "new_value": "example.net", + "expected": { + "href": "data:text/plain,Stuff", + "host": "" + } + }, + { + "href": "http://example.net", + "new_value": "example.com:8080", + "expected": { + "href": "http://example.com:8080/", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Port number is unchanged if not specified in the new value", + "href": "http://example.net:8080", + "new_value": "example.com", + "expected": { + "href": "http://example.com:8080/", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Port number is unchanged if not specified", + "href": "http://example.net:8080", + "new_value": "example.com:", + "expected": { + "href": "http://example.com:8080/", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "The empty host is not valid for special schemes", + "href": "http://example.net", + "new_value": "", + "expected": { + "href": "http://example.net/", + "host": "example.net" + } + }, + { + "comment": "The empty host is OK for non-special schemes", + "href": "view-source+http://example.net/foo", + "new_value": "", + "expected": { + "href": "view-source+http:///foo", + "host": "" + } + }, + { + "comment": "Path-only URLs can gain a host", + "href": "a:/foo", + "new_value": "example.net", + "expected": { + "href": "a://example.net/foo", + "host": "example.net" + } + }, + { + "comment": "IPv4 address syntax is normalized", + "href": "http://example.net", + "new_value": "0x7F000001:8080", + "expected": { + "href": "http://127.0.0.1:8080/", + "host": "127.0.0.1:8080", + "hostname": "127.0.0.1", + "port": "8080" + } + }, + { + "comment": "IPv6 address syntax is normalized", + "href": "http://example.net", + "new_value": "[::0:01]:2", + "expected": { + "href": "http://[::1]:2/", + "host": "[::1]:2", + "hostname": "[::1]", + "port": "2" + } + }, + { + "comment": "Default port number is removed", + "href": "http://example.net", + "new_value": "example.com:80", + "expected": { + "href": "http://example.com/", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Default port number is removed", + "href": "https://example.net", + "new_value": "example.com:443", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Default port number is only removed for the relevant scheme", + "href": "https://example.net", + "new_value": "example.com:80", + "expected": { + "href": "https://example.com:80/", + "host": "example.com:80", + "hostname": "example.com", + "port": "80" + } + }, + { + "comment": "Stuff after a / delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com/stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a / delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com:8080/stuff", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Stuff after a ? delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com?stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a ? delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com:8080?stuff", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Stuff after a # delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com#stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a # delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com:8080#stuff", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Stuff after a \\ delimiter is ignored for special schemes", + "href": "http://example.net/path", + "new_value": "example.com\\stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a \\ delimiter is ignored for special schemes", + "href": "http://example.net/path", + "new_value": "example.com:8080\\stuff", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "\\ is not a delimiter for non-special schemes, but still forbidden in hosts", + "href": "view-source+http://example.net/path", + "new_value": "example.com\\stuff", + "expected": { + "href": "view-source+http://example.net/path", + "host": "example.net", + "hostname": "example.net", + "port": "" + } + }, + { + "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error", + "href": "view-source+http://example.net/path", + "new_value": "example.com:8080stuff2", + "expected": { + "href": "view-source+http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error", + "href": "http://example.net/path", + "new_value": "example.com:8080stuff2", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error", + "href": "http://example.net/path", + "new_value": "example.com:8080+2", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Port numbers are 16 bit integers", + "href": "http://example.net/path", + "new_value": "example.com:65535", + "expected": { + "href": "http://example.com:65535/path", + "host": "example.com:65535", + "hostname": "example.com", + "port": "65535" + } + }, + { + "comment": "Port numbers are 16 bit integers, overflowing is an error. Hostname is still set, though.", + "href": "http://example.net/path", + "new_value": "example.com:65536", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Broken IPv6", + "href": "http://example.net/", + "new_value": "[google.com]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.2.3.4x]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.2.3.]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.2.]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "file://y/", + "new_value": "x:123", + "expected": { + "href": "file://y/", + "host": "y", + "hostname": "y", + "port": "" + } + }, + { + "href": "file://y/", + "new_value": "loc%41lhost", + "expected": { + "href": "file:///", + "host": "", + "hostname": "", + "port": "" + } + }, + { + "href": "file://hi/x", + "new_value": "", + "expected": { + "href": "file:///x", + "host": "", + "hostname": "", + "port": "" + } + }, + { + "href": "sc://test@test/", + "new_value": "", + "expected": { + "href": "sc://test@test/", + "host": "test", + "hostname": "test", + "username": "test" + } + }, + { + "href": "sc://test:12/", + "new_value": "", + "expected": { + "href": "sc://test:12/", + "host": "test:12", + "hostname": "test", + "port": "12" + } + } + ], + "hostname": [ + { + "comment": "Non-special scheme", + "href": "sc://x/", + "new_value": "\u0000", + "expected": { + "href": "sc://x/", + "host": "x", + "hostname": "x" + } + }, + { + "href": "sc://x/", + "new_value": "\u0009", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "\u000A", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "\u000D", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": " ", + "expected": { + "href": "sc://x/", + "host": "x", + "hostname": "x" + } + }, + { + "href": "sc://x/", + "new_value": "#", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "/", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "?", + "expected": { + "href": "sc:///", + "host": "", + "hostname": "" + } + }, + { + "href": "sc://x/", + "new_value": "@", + "expected": { + "href": "sc://x/", + "host": "x", + "hostname": "x" + } + }, + { + "comment": "Cannot-be-a-base means no host", + "href": "mailto:me@example.net", + "new_value": "example.com", + "expected": { + "href": "mailto:me@example.net", + "host": "" + } + }, + { + "comment": "Cannot-be-a-base means no password", + "href": "data:text/plain,Stuff", + "new_value": "example.net", + "expected": { + "href": "data:text/plain,Stuff", + "host": "" + } + }, + { + "href": "http://example.net:8080", + "new_value": "example.com", + "expected": { + "href": "http://example.com:8080/", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "The empty host is not valid for special schemes", + "href": "http://example.net", + "new_value": "", + "expected": { + "href": "http://example.net/", + "host": "example.net" + } + }, + { + "comment": "The empty host is OK for non-special schemes", + "href": "view-source+http://example.net/foo", + "new_value": "", + "expected": { + "href": "view-source+http:///foo", + "host": "" + } + }, + { + "comment": "Path-only URLs can gain a host", + "href": "a:/foo", + "new_value": "example.net", + "expected": { + "href": "a://example.net/foo", + "host": "example.net" + } + }, + { + "comment": "IPv4 address syntax is normalized", + "href": "http://example.net:8080", + "new_value": "0x7F000001", + "expected": { + "href": "http://127.0.0.1:8080/", + "host": "127.0.0.1:8080", + "hostname": "127.0.0.1", + "port": "8080" + } + }, + { + "comment": "IPv6 address syntax is normalized", + "href": "http://example.net", + "new_value": "[::0:01]", + "expected": { + "href": "http://[::1]/", + "host": "[::1]", + "hostname": "[::1]", + "port": "" + } + }, + { + "comment": "Stuff after a : delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com:8080", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a : delimiter is ignored", + "href": "http://example.net:8080/path", + "new_value": "example.com:", + "expected": { + "href": "http://example.com:8080/path", + "host": "example.com:8080", + "hostname": "example.com", + "port": "8080" + } + }, + { + "comment": "Stuff after a / delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com/stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a ? delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com?stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a # delimiter is ignored", + "href": "http://example.net/path", + "new_value": "example.com#stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "Stuff after a \\ delimiter is ignored for special schemes", + "href": "http://example.net/path", + "new_value": "example.com\\stuff", + "expected": { + "href": "http://example.com/path", + "host": "example.com", + "hostname": "example.com", + "port": "" + } + }, + { + "comment": "\\ is not a delimiter for non-special schemes, but still forbidden in hosts", + "href": "view-source+http://example.net/path", + "new_value": "example.com\\stuff", + "expected": { + "href": "view-source+http://example.net/path", + "host": "example.net", + "hostname": "example.net", + "port": "" + } + }, + { + "comment": "Broken IPv6", + "href": "http://example.net/", + "new_value": "[google.com]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.2.3.4x]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.2.3.]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.2.]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "http://example.net/", + "new_value": "[::1.]", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net" + } + }, + { + "href": "file://y/", + "new_value": "x:123", + "expected": { + "href": "file://y/", + "host": "y", + "hostname": "y", + "port": "" + } + }, + { + "href": "file://y/", + "new_value": "loc%41lhost", + "expected": { + "href": "file:///", + "host": "", + "hostname": "", + "port": "" + } + }, + { + "href": "file://hi/x", + "new_value": "", + "expected": { + "href": "file:///x", + "host": "", + "hostname": "", + "port": "" + } + }, + { + "href": "sc://test@test/", + "new_value": "", + "expected": { + "href": "sc://test@test/", + "host": "test", + "hostname": "test", + "username": "test" + } + }, + { + "href": "sc://test:12/", + "new_value": "", + "expected": { + "href": "sc://test:12/", + "host": "test:12", + "hostname": "test", + "port": "12" + } + } + ], + "port": [ + { + "href": "http://example.net", + "new_value": "8080", + "expected": { + "href": "http://example.net:8080/", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Port number is removed if empty is the new value", + "href": "http://example.net:8080", + "new_value": "", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net", + "port": "" + } + }, + { + "comment": "Default port number is removed", + "href": "http://example.net:8080", + "new_value": "80", + "expected": { + "href": "http://example.net/", + "host": "example.net", + "hostname": "example.net", + "port": "" + } + }, + { + "comment": "Default port number is removed", + "href": "https://example.net:4433", + "new_value": "443", + "expected": { + "href": "https://example.net/", + "host": "example.net", + "hostname": "example.net", + "port": "" + } + }, + { + "comment": "Default port number is only removed for the relevant scheme", + "href": "https://example.net", + "new_value": "80", + "expected": { + "href": "https://example.net:80/", + "host": "example.net:80", + "hostname": "example.net", + "port": "80" + } + }, + { + "comment": "Stuff after a / delimiter is ignored", + "href": "http://example.net/path", + "new_value": "8080/stuff", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Stuff after a ? delimiter is ignored", + "href": "http://example.net/path", + "new_value": "8080?stuff", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Stuff after a # delimiter is ignored", + "href": "http://example.net/path", + "new_value": "8080#stuff", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Stuff after a \\ delimiter is ignored for special schemes", + "href": "http://example.net/path", + "new_value": "8080\\stuff", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error", + "href": "view-source+http://example.net/path", + "new_value": "8080stuff2", + "expected": { + "href": "view-source+http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error", + "href": "http://example.net/path", + "new_value": "8080stuff2", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error", + "href": "http://example.net/path", + "new_value": "8080+2", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Port numbers are 16 bit integers", + "href": "http://example.net/path", + "new_value": "65535", + "expected": { + "href": "http://example.net:65535/path", + "host": "example.net:65535", + "hostname": "example.net", + "port": "65535" + } + }, + { + "comment": "Port numbers are 16 bit integers, overflowing is an error", + "href": "http://example.net:8080/path", + "new_value": "65536", + "expected": { + "href": "http://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "comment": "Port numbers are 16 bit integers, overflowing is an error", + "href": "non-special://example.net:8080/path", + "new_value": "65536", + "expected": { + "href": "non-special://example.net:8080/path", + "host": "example.net:8080", + "hostname": "example.net", + "port": "8080" + } + }, + { + "href": "file://test/", + "new_value": "12", + "expected": { + "href": "file://test/", + "port": "" + } + }, + { + "href": "file://localhost/", + "new_value": "12", + "expected": { + "href": "file:///", + "port": "" + } + }, + { + "href": "non-base:value", + "new_value": "12", + "expected": { + "href": "non-base:value", + "port": "" + } + }, + { + "href": "sc:///", + "new_value": "12", + "expected": { + "href": "sc:///", + "port": "" + } + }, + { + "href": "sc://x/", + "new_value": "12", + "expected": { + "href": "sc://x:12/", + "port": "12" + } + }, + { + "href": "javascript://x/", + "new_value": "12", + "expected": { + "href": "javascript://x:12/", + "port": "12" + } + } + ], + "pathname": [ + { + "comment": "Cannot-be-a-base don’t have a path", + "href": "mailto:me@example.net", + "new_value": "/foo", + "expected": { + "href": "mailto:me@example.net", + "pathname": "me@example.net" + } + }, + { + "href": "unix:/run/foo.socket?timeout=10", + "new_value": "/var/log/../run/bar.socket", + "expected": { + "href": "unix:/var/run/bar.socket?timeout=10", + "pathname": "/var/run/bar.socket" + } + }, + { + "href": "https://example.net#nav", + "new_value": "home", + "expected": { + "href": "https://example.net/home#nav", + "pathname": "/home" + } + }, + { + "href": "https://example.net#nav", + "new_value": "../home", + "expected": { + "href": "https://example.net/home#nav", + "pathname": "/home" + } + }, + { + "comment": "\\ is a segment delimiter for 'special' URLs", + "href": "http://example.net/home?lang=fr#nav", + "new_value": "\\a\\%2E\\b\\%2e.\\c", + "expected": { + "href": "http://example.net/a/c?lang=fr#nav", + "pathname": "/a/c" + } + }, + { + "comment": "\\ is *not* a segment delimiter for non-'special' URLs", + "href": "view-source+http://example.net/home?lang=fr#nav", + "new_value": "\\a\\%2E\\b\\%2e.\\c", + "expected": { + "href": "view-source+http://example.net/\\a\\%2E\\b\\%2e.\\c?lang=fr#nav", + "pathname": "/\\a\\%2E\\b\\%2e.\\c" + } + }, + { + "comment": "UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.", + "href": "a:/", + "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé", + "expected": { + "href": "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9", + "pathname": "/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" + } + }, + { + "comment": "Bytes already percent-encoded are left as-is, including %2E outside dotted segments.", + "href": "http://example.net", + "new_value": "%2e%2E%c3%89té", + "expected": { + "href": "http://example.net/%2e%2E%c3%89t%C3%A9", + "pathname": "/%2e%2E%c3%89t%C3%A9" + } + }, + { + "comment": "? needs to be encoded", + "href": "http://example.net", + "new_value": "?", + "expected": { + "href": "http://example.net/%3F", + "pathname": "/%3F" + } + }, + { + "comment": "# needs to be encoded", + "href": "http://example.net", + "new_value": "#", + "expected": { + "href": "http://example.net/%23", + "pathname": "/%23" + } + }, + { + "comment": "? needs to be encoded, non-special scheme", + "href": "sc://example.net", + "new_value": "?", + "expected": { + "href": "sc://example.net/%3F", + "pathname": "/%3F" + } + }, + { + "comment": "# needs to be encoded, non-special scheme", + "href": "sc://example.net", + "new_value": "#", + "expected": { + "href": "sc://example.net/%23", + "pathname": "/%23" + } + }, + { + "comment": "File URLs and (back)slashes", + "href": "file://monkey/", + "new_value": "\\\\", + "expected": { + "href": "file://monkey/", + "pathname": "/" + } + }, + { + "comment": "File URLs and (back)slashes", + "href": "file:///unicorn", + "new_value": "//\\/", + "expected": { + "href": "file:///", + "pathname": "/" + } + }, + { + "comment": "File URLs and (back)slashes", + "href": "file:///unicorn", + "new_value": "//monkey/..//", + "expected": { + "href": "file:///", + "pathname": "/" + } + } + ], + "search": [ + { + "href": "https://example.net#nav", + "new_value": "lang=fr", + "expected": { + "href": "https://example.net/?lang=fr#nav", + "search": "?lang=fr" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "lang=fr", + "expected": { + "href": "https://example.net/?lang=fr#nav", + "search": "?lang=fr" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "?lang=fr", + "expected": { + "href": "https://example.net/?lang=fr#nav", + "search": "?lang=fr" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "??lang=fr", + "expected": { + "href": "https://example.net/??lang=fr#nav", + "search": "??lang=fr" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "?", + "expected": { + "href": "https://example.net/?#nav", + "search": "" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "", + "expected": { + "href": "https://example.net/#nav", + "search": "" + } + }, + { + "href": "https://example.net?lang=en-US", + "new_value": "", + "expected": { + "href": "https://example.net/", + "search": "" + } + }, + { + "href": "https://example.net", + "new_value": "", + "expected": { + "href": "https://example.net/", + "search": "" + } + }, + { + "comment": "UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.", + "href": "a:/", + "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé", + "expected": { + "href": "a:/?%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_`az{|}~%7F%C2%80%C2%81%C3%89%C3%A9", + "search": "?%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_`az{|}~%7F%C2%80%C2%81%C3%89%C3%A9" + } + }, + { + "comment": "Bytes already percent-encoded are left as-is", + "href": "http://example.net", + "new_value": "%c3%89té", + "expected": { + "href": "http://example.net/?%c3%89t%C3%A9", + "search": "?%c3%89t%C3%A9" + } + } + ], + "hash": [ + { + "href": "https://example.net", + "new_value": "main", + "expected": { + "href": "https://example.net/#main", + "hash": "#main" + } + }, + { + "href": "https://example.net#nav", + "new_value": "main", + "expected": { + "href": "https://example.net/#main", + "hash": "#main" + } + }, + { + "href": "https://example.net?lang=en-US", + "new_value": "##nav", + "expected": { + "href": "https://example.net/?lang=en-US##nav", + "hash": "##nav" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "#main", + "expected": { + "href": "https://example.net/?lang=en-US#main", + "hash": "#main" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "#", + "expected": { + "href": "https://example.net/?lang=en-US#", + "hash": "" + } + }, + { + "href": "https://example.net?lang=en-US#nav", + "new_value": "", + "expected": { + "href": "https://example.net/?lang=en-US", + "hash": "" + } + }, + { + "comment": "Simple percent-encoding; nuls, tabs, and newlines are removed", + "href": "a:/", + "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé", + "expected": { + "href": "a:/#%01%1F !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~%7F%C2%80%C2%81%C3%89%C3%A9", + "hash": "#%01%1F !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~%7F%C2%80%C2%81%C3%89%C3%A9" + } + }, + { + "comment": "Bytes already percent-encoded are left as-is", + "href": "http://example.net", + "new_value": "%c3%89té", + "expected": { + "href": "http://example.net/#%c3%89t%C3%A9", + "hash": "#%c3%89t%C3%A9" + } + }, + { + "href": "javascript:alert(1)", + "new_value": "castle", + "expected": { + "href": "javascript:alert(1)#castle", + "hash": "#castle" + } + } + ] +} diff --git a/test/fixtures/url-tests-additional.js b/test/fixtures/url-tests-additional.js new file mode 100644 index 00000000000000..c1c640f4bb4b7d --- /dev/null +++ b/test/fixtures/url-tests-additional.js @@ -0,0 +1,36 @@ +'use strict'; + +// This file contains test cases not part of the WPT + +module.exports = [ + { + // surrogate pair + 'url': 'https://github.com/nodejs/\uD83D\uDE00node', + 'protocol': 'https:', + 'pathname': '/nodejs/%F0%9F%98%80node' + }, + { + // unpaired low surrogate + 'url': 'https://github.com/nodejs/\uD83D', + 'protocol': 'https:', + 'pathname': '/nodejs/%EF%BF%BD' + }, + { + // unpaired low surrogate + 'url': 'https://github.com/nodejs/\uD83Dnode', + 'protocol': 'https:', + 'pathname': '/nodejs/%EF%BF%BDnode' + }, + { + // unmatched high surrogate + 'url': 'https://github.com/nodejs/\uDE00', + 'protocol': 'https:', + 'pathname': '/nodejs/%EF%BF%BD' + }, + { + // unmatched high surrogate + 'url': 'https://github.com/nodejs/\uDE00node', + 'protocol': 'https:', + 'pathname': '/nodejs/%EF%BF%BDnode' + } +]; diff --git a/test/fixtures/url-tests.js b/test/fixtures/url-tests.js new file mode 100644 index 00000000000000..48f77fe0774d64 --- /dev/null +++ b/test/fixtures/url-tests.js @@ -0,0 +1,6565 @@ +'use strict'; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/11757f1/url/urltestdata.json + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +module.exports = +[ + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js", + { + "input": "http://example\t.\norg", + "base": "http://example.org/foo/bar", + "href": "http://example.org/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://user:pass@foo:21/bar;par?b#c", + "base": "http://example.org/foo/bar", + "href": "http://user:pass@foo:21/bar;par?b#c", + "origin": "http://foo:21", + "protocol": "http:", + "username": "user", + "password": "pass", + "host": "foo:21", + "hostname": "foo", + "port": "21", + "pathname": "/bar;par", + "search": "?b", + "hash": "#c" + }, + { + "input": "https://test:@test", + "base": "about:blank", + "href": "https://test@test/", + "origin": "https://test", + "protocol": "https:", + "username": "test", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://:@test", + "base": "about:blank", + "href": "https://test/", + "origin": "https://test", + "protocol": "https:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://test:@test/x", + "base": "about:blank", + "href": "non-special://test@test/x", + "origin": "null", + "protocol": "non-special:", + "username": "test", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + { + "input": "non-special://:@test/x", + "base": "about:blank", + "href": "non-special://test/x", + "origin": "null", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + { + "input": "http:foo.com", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/foo.com", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/foo.com", + "search": "", + "hash": "" + }, + { + "input": "\t :foo.com \n", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:foo.com", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:foo.com", + "search": "", + "hash": "" + }, + { + "input": " foo.com ", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/foo.com", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/foo.com", + "search": "", + "hash": "" + }, + { + "input": "a:\t foo.com", + "base": "http://example.org/foo/bar", + "href": "a: foo.com", + "origin": "null", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": " foo.com", + "search": "", + "hash": "" + }, + { + "input": "http://f:21/ b ? d # e ", + "base": "http://example.org/foo/bar", + "href": "http://f:21/%20b%20?%20d%20# e", + "origin": "http://f:21", + "protocol": "http:", + "username": "", + "password": "", + "host": "f:21", + "hostname": "f", + "port": "21", + "pathname": "/%20b%20", + "search": "?%20d%20", + "hash": "# e" + }, + { + "input": "lolscheme:x x#x x", + "base": "about:blank", + "href": "lolscheme:x x#x x", + "protocol": "lolscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "x x", + "search": "", + "hash": "#x x" + }, + { + "input": "http://f:/c", + "base": "http://example.org/foo/bar", + "href": "http://f/c", + "origin": "http://f", + "protocol": "http:", + "username": "", + "password": "", + "host": "f", + "hostname": "f", + "port": "", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:0/c", + "base": "http://example.org/foo/bar", + "href": "http://f:0/c", + "origin": "http://f:0", + "protocol": "http:", + "username": "", + "password": "", + "host": "f:0", + "hostname": "f", + "port": "0", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:00000000000000/c", + "base": "http://example.org/foo/bar", + "href": "http://f:0/c", + "origin": "http://f:0", + "protocol": "http:", + "username": "", + "password": "", + "host": "f:0", + "hostname": "f", + "port": "0", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:00000000000000000000080/c", + "base": "http://example.org/foo/bar", + "href": "http://f/c", + "origin": "http://f", + "protocol": "http:", + "username": "", + "password": "", + "host": "f", + "hostname": "f", + "port": "", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:b/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f: /c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f:\n/c", + "base": "http://example.org/foo/bar", + "href": "http://f/c", + "origin": "http://f", + "protocol": "http:", + "username": "", + "password": "", + "host": "f", + "hostname": "f", + "port": "", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:fifty-two/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f:999999/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "non-special://f:999999/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f: 21 / b ? d # e ", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": " \t", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": ":foo.com/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:foo.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:foo.com/", + "search": "", + "hash": "" + }, + { + "input": ":foo.com\\", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:foo.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:foo.com/", + "search": "", + "hash": "" + }, + { + "input": ":", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:", + "search": "", + "hash": "" + }, + { + "input": ":a", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:a", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:a", + "search": "", + "hash": "" + }, + { + "input": ":/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:/", + "search": "", + "hash": "" + }, + { + "input": ":\\", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:/", + "search": "", + "hash": "" + }, + { + "input": ":#", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:#", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:", + "search": "", + "hash": "" + }, + { + "input": "#", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "#/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#/" + }, + { + "input": "#\\", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#\\", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#\\" + }, + { + "input": "#;?", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#;?", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#;?" + }, + { + "input": "?", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar?", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": ":23", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:23", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:23", + "search": "", + "hash": "" + }, + { + "input": "/:23", + "base": "http://example.org/foo/bar", + "href": "http://example.org/:23", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/:23", + "search": "", + "hash": "" + }, + { + "input": "::", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/::", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/::", + "search": "", + "hash": "" + }, + { + "input": "::23", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/::23", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/::23", + "search": "", + "hash": "" + }, + { + "input": "foo://", + "base": "http://example.org/foo/bar", + "href": "foo://", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "http://a:b@c:29/d", + "base": "http://example.org/foo/bar", + "href": "http://a:b@c:29/d", + "origin": "http://c:29", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "c:29", + "hostname": "c", + "port": "29", + "pathname": "/d", + "search": "", + "hash": "" + }, + { + "input": "http::@c:29", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:@c:29", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:@c:29", + "search": "", + "hash": "" + }, + { + "input": "http://&a:foo(b]c@d:2/", + "base": "http://example.org/foo/bar", + "href": "http://&a:foo(b%5Dc@d:2/", + "origin": "http://d:2", + "protocol": "http:", + "username": "&a", + "password": "foo(b%5Dc", + "host": "d:2", + "hostname": "d", + "port": "2", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://::@c@d:2", + "base": "http://example.org/foo/bar", + "href": "http://:%3A%40c@d:2/", + "origin": "http://d:2", + "protocol": "http:", + "username": "", + "password": "%3A%40c", + "host": "d:2", + "hostname": "d", + "port": "2", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo.com:b@d/", + "base": "http://example.org/foo/bar", + "href": "http://foo.com:b@d/", + "origin": "http://d", + "protocol": "http:", + "username": "foo.com", + "password": "b", + "host": "d", + "hostname": "d", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo.com/\\@", + "base": "http://example.org/foo/bar", + "href": "http://foo.com//@", + "origin": "http://foo.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.com", + "hostname": "foo.com", + "port": "", + "pathname": "//@", + "search": "", + "hash": "" + }, + { + "input": "http:\\\\foo.com\\", + "base": "http://example.org/foo/bar", + "href": "http://foo.com/", + "origin": "http://foo.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.com", + "hostname": "foo.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:\\\\a\\b:c\\d@foo.com\\", + "base": "http://example.org/foo/bar", + "href": "http://a/b:c/d@foo.com/", + "origin": "http://a", + "protocol": "http:", + "username": "", + "password": "", + "host": "a", + "hostname": "a", + "port": "", + "pathname": "/b:c/d@foo.com/", + "search": "", + "hash": "" + }, + { + "input": "foo:/", + "base": "http://example.org/foo/bar", + "href": "foo:/", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "foo:/bar.com/", + "base": "http://example.org/foo/bar", + "href": "foo:/bar.com/", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/bar.com/", + "search": "", + "hash": "" + }, + { + "input": "foo://///////", + "base": "http://example.org/foo/bar", + "href": "foo://///////", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///////", + "search": "", + "hash": "" + }, + { + "input": "foo://///////bar.com/", + "base": "http://example.org/foo/bar", + "href": "foo://///////bar.com/", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///////bar.com/", + "search": "", + "hash": "" + }, + { + "input": "foo:////://///", + "base": "http://example.org/foo/bar", + "href": "foo:////://///", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//://///", + "search": "", + "hash": "" + }, + { + "input": "c:/foo", + "base": "http://example.org/foo/bar", + "href": "c:/foo", + "origin": "null", + "protocol": "c:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "//foo/bar", + "base": "http://example.org/foo/bar", + "href": "http://foo/bar", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/bar", + "search": "", + "hash": "" + }, + { + "input": "http://foo/path;a??e#f#g", + "base": "http://example.org/foo/bar", + "href": "http://foo/path;a??e#f#g", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/path;a", + "search": "??e", + "hash": "#f#g" + }, + { + "input": "http://foo/abcd?efgh?ijkl", + "base": "http://example.org/foo/bar", + "href": "http://foo/abcd?efgh?ijkl", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/abcd", + "search": "?efgh?ijkl", + "hash": "" + }, + { + "input": "http://foo/abcd#foo?bar", + "base": "http://example.org/foo/bar", + "href": "http://foo/abcd#foo?bar", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/abcd", + "search": "", + "hash": "#foo?bar" + }, + { + "input": "[61:24:74]:98", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/[61:24:74]:98", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/[61:24:74]:98", + "search": "", + "hash": "" + }, + { + "input": "http:[61:27]/:foo", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/[61:27]/:foo", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/[61:27]/:foo", + "search": "", + "hash": "" + }, + { + "input": "http://[1::2]:3:4", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://2001::1", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://2001::1]", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://2001::1]:80", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://[2001::1]", + "base": "http://example.org/foo/bar", + "href": "http://[2001::1]/", + "origin": "http://[2001::1]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[2001::1]", + "hostname": "[2001::1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[::127.0.0.1]", + "base": "http://example.org/foo/bar", + "href": "http://[::7f00:1]/", + "origin": "http://[::7f00:1]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[::7f00:1]", + "hostname": "[::7f00:1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[0:0:0:0:0:0:13.1.68.3]", + "base": "http://example.org/foo/bar", + "href": "http://[::d01:4403]/", + "origin": "http://[::d01:4403]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[::d01:4403]", + "hostname": "[::d01:4403]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[2001::1]:80", + "base": "http://example.org/foo/bar", + "href": "http://[2001::1]/", + "origin": "http://[2001::1]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[2001::1]", + "hostname": "[2001::1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/example.com/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/example.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftp:/example.com/", + "base": "http://example.org/foo/bar", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:/example.com/", + "base": "http://example.org/foo/bar", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:/example.com/", + "base": "http://example.org/foo/bar", + "href": "madeupscheme:/example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "file:/example.com/", + "base": "http://example.org/foo/bar", + "href": "file:///example.com/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "file://example:1/", + "base": "about:blank", + "failure": true + }, + { + "input": "file://example:test/", + "base": "about:blank", + "failure": true + }, + { + "input": "file://example%/", + "base": "about:blank", + "failure": true + }, + { + "input": "file://[example]/", + "base": "about:blank", + "failure": true + }, + { + "input": "ftps:/example.com/", + "base": "http://example.org/foo/bar", + "href": "ftps:/example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:/example.com/", + "base": "http://example.org/foo/bar", + "href": "gopher://example.com/", + "origin": "gopher://example.com", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws:/example.com/", + "base": "http://example.org/foo/bar", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:/example.com/", + "base": "http://example.org/foo/bar", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:/example.com/", + "base": "http://example.org/foo/bar", + "href": "data:/example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:/example.com/", + "base": "http://example.org/foo/bar", + "href": "javascript:/example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:/example.com/", + "base": "http://example.org/foo/bar", + "href": "mailto:/example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "http:example.com/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/example.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftp:example.com/", + "base": "http://example.org/foo/bar", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:example.com/", + "base": "http://example.org/foo/bar", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:example.com/", + "base": "http://example.org/foo/bar", + "href": "madeupscheme:example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftps:example.com/", + "base": "http://example.org/foo/bar", + "href": "ftps:example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:example.com/", + "base": "http://example.org/foo/bar", + "href": "gopher://example.com/", + "origin": "gopher://example.com", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws:example.com/", + "base": "http://example.org/foo/bar", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:example.com/", + "base": "http://example.org/foo/bar", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:example.com/", + "base": "http://example.org/foo/bar", + "href": "data:example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:example.com/", + "base": "http://example.org/foo/bar", + "href": "javascript:example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:example.com/", + "base": "http://example.org/foo/bar", + "href": "mailto:example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "/a/b/c", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a/b/c", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a/b/c", + "search": "", + "hash": "" + }, + { + "input": "/a/ /c", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a/%20/c", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a/%20/c", + "search": "", + "hash": "" + }, + { + "input": "/a%2fc", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a%2fc", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a%2fc", + "search": "", + "hash": "" + }, + { + "input": "/a/%2f/c", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a/%2f/c", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a/%2f/c", + "search": "", + "hash": "" + }, + { + "input": "#β", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#%CE%B2", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#%CE%B2" + }, + { + "input": "data:text/html,test#test", + "base": "http://example.org/foo/bar", + "href": "data:text/html,test#test", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "text/html,test", + "search": "", + "hash": "#test" + }, + { + "input": "tel:1234567890", + "base": "http://example.org/foo/bar", + "href": "tel:1234567890", + "origin": "null", + "protocol": "tel:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "1234567890", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html", + { + "input": "file:c:\\foo\\bar.html", + "base": "file:///tmp/mock/path", + "href": "file:///c:/foo/bar.html", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar.html", + "search": "", + "hash": "" + }, + { + "input": " File:c|////foo\\bar.html", + "base": "file:///tmp/mock/path", + "href": "file:///c:////foo/bar.html", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:////foo/bar.html", + "search": "", + "hash": "" + }, + { + "input": "C|/foo/bar", + "base": "file:///tmp/mock/path", + "href": "file:///C:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/C|\\foo\\bar", + "base": "file:///tmp/mock/path", + "href": "file:///C:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "//C|/foo/bar", + "base": "file:///tmp/mock/path", + "href": "file:///C:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "//server/file", + "base": "file:///tmp/mock/path", + "href": "file://server/file", + "protocol": "file:", + "username": "", + "password": "", + "host": "server", + "hostname": "server", + "port": "", + "pathname": "/file", + "search": "", + "hash": "" + }, + { + "input": "\\\\server\\file", + "base": "file:///tmp/mock/path", + "href": "file://server/file", + "protocol": "file:", + "username": "", + "password": "", + "host": "server", + "hostname": "server", + "port": "", + "pathname": "/file", + "search": "", + "hash": "" + }, + { + "input": "/\\server/file", + "base": "file:///tmp/mock/path", + "href": "file://server/file", + "protocol": "file:", + "username": "", + "password": "", + "host": "server", + "hostname": "server", + "port": "", + "pathname": "/file", + "search": "", + "hash": "" + }, + { + "input": "file:///foo/bar.txt", + "base": "file:///tmp/mock/path", + "href": "file:///foo/bar.txt", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/foo/bar.txt", + "search": "", + "hash": "" + }, + { + "input": "file:///home/me", + "base": "file:///tmp/mock/path", + "href": "file:///home/me", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/home/me", + "search": "", + "hash": "" + }, + { + "input": "//", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///test", + "base": "file:///tmp/mock/path", + "href": "file:///test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "", + "hash": "" + }, + { + "input": "file://test", + "base": "file:///tmp/mock/path", + "href": "file://test/", + "protocol": "file:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file://localhost", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file://localhost/", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file://localhost/test", + "base": "file:///tmp/mock/path", + "href": "file:///test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "", + "hash": "" + }, + { + "input": "test", + "base": "file:///tmp/mock/path", + "href": "file:///tmp/mock/test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/tmp/mock/test", + "search": "", + "hash": "" + }, + { + "input": "file:test", + "base": "file:///tmp/mock/path", + "href": "file:///tmp/mock/test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/tmp/mock/test", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js", + { + "input": "http://example.com/././foo", + "base": "about:blank", + "href": "http://example.com/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/./.foo", + "base": "about:blank", + "href": "http://example.com/.foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/.foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/.", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/./", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/..", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/../", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/..bar", + "base": "about:blank", + "href": "http://example.com/foo/..bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/..bar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/../ton", + "base": "about:blank", + "href": "http://example.com/foo/ton", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/ton", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/../ton/../../a", + "base": "about:blank", + "href": "http://example.com/a", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/a", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/../../..", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/../../../ton", + "base": "about:blank", + "href": "http://example.com/ton", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/ton", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/%2e", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/%2e%2", + "base": "about:blank", + "href": "http://example.com/foo/%2e%2", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/%2e%2", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar", + "base": "about:blank", + "href": "http://example.com/%2e.bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%2e.bar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com////../..", + "base": "about:blank", + "href": "http://example.com//", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar//../..", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar//..", + "base": "about:blank", + "href": "http://example.com/foo/bar/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/bar/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo", + "base": "about:blank", + "href": "http://example.com/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/%20foo", + "base": "about:blank", + "href": "http://example.com/%20foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%20foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%", + "base": "about:blank", + "href": "http://example.com/foo%", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%2", + "base": "about:blank", + "href": "http://example.com/foo%2", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%2", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%2zbar", + "base": "about:blank", + "href": "http://example.com/foo%2zbar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%2zbar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%2©zbar", + "base": "about:blank", + "href": "http://example.com/foo%2%C3%82%C2%A9zbar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%2%C3%82%C2%A9zbar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%41%7a", + "base": "about:blank", + "href": "http://example.com/foo%41%7a", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%41%7a", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo\t\u0091%91", + "base": "about:blank", + "href": "http://example.com/foo%C2%91%91", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%C2%91%91", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%00%51", + "base": "about:blank", + "href": "http://example.com/foo%00%51", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%00%51", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/(%28:%3A%29)", + "base": "about:blank", + "href": "http://example.com/(%28:%3A%29)", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/(%28:%3A%29)", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/%3A%3a%3C%3c", + "base": "about:blank", + "href": "http://example.com/%3A%3a%3C%3c", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%3A%3a%3C%3c", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo\tbar", + "base": "about:blank", + "href": "http://example.com/foobar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foobar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com\\\\foo\\\\bar", + "base": "about:blank", + "href": "http://example.com//foo//bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "//foo//bar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", + "base": "about:blank", + "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/@asdf%40", + "base": "about:blank", + "href": "http://example.com/@asdf%40", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/@asdf%40", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/你好你好", + "base": "about:blank", + "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/‥/foo", + "base": "about:blank", + "href": "http://example.com/%E2%80%A5/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%E2%80%A5/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com//foo", + "base": "about:blank", + "href": "http://example.com/%EF%BB%BF/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%EF%BB%BF/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/‮/foo/‭/bar", + "base": "about:blank", + "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js", + { + "input": "http://www.google.com/foo?bar=baz#", + "base": "about:blank", + "href": "http://www.google.com/foo?bar=baz#", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/foo", + "search": "?bar=baz", + "hash": "" + }, + { + "input": "http://www.google.com/foo?bar=baz# »", + "base": "about:blank", + "href": "http://www.google.com/foo?bar=baz# %C2%BB", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/foo", + "search": "?bar=baz", + "hash": "# %C2%BB" + }, + { + "input": "data:test# »", + "base": "about:blank", + "href": "data:test# %C2%BB", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "test", + "search": "", + "hash": "# %C2%BB" + }, + { + "input": "http://www.google.com", + "base": "about:blank", + "href": "http://www.google.com/", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.0x00A80001", + "base": "about:blank", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://www/foo%2Ehtml", + "base": "about:blank", + "href": "http://www/foo%2Ehtml", + "origin": "http://www", + "protocol": "http:", + "username": "", + "password": "", + "host": "www", + "hostname": "www", + "port": "", + "pathname": "/foo%2Ehtml", + "search": "", + "hash": "" + }, + { + "input": "http://www/foo/%2E/html", + "base": "about:blank", + "href": "http://www/foo/html", + "origin": "http://www", + "protocol": "http:", + "username": "", + "password": "", + "host": "www", + "hostname": "www", + "port": "", + "pathname": "/foo/html", + "search": "", + "hash": "" + }, + { + "input": "http://user:pass@/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://%25DOMAIN:foobar@foodomain.com/", + "base": "about:blank", + "href": "http://%25DOMAIN:foobar@foodomain.com/", + "origin": "http://foodomain.com", + "protocol": "http:", + "username": "%25DOMAIN", + "password": "foobar", + "host": "foodomain.com", + "hostname": "foodomain.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:\\\\www.google.com\\foo", + "base": "about:blank", + "href": "http://www.google.com/foo", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "http://foo:80/", + "base": "about:blank", + "href": "http://foo/", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo:81/", + "base": "about:blank", + "href": "http://foo:81/", + "origin": "http://foo:81", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo:81", + "hostname": "foo", + "port": "81", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "httpa://foo:80/", + "base": "about:blank", + "href": "httpa://foo:80/", + "origin": "null", + "protocol": "httpa:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo:-80/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://foo:443/", + "base": "about:blank", + "href": "https://foo/", + "origin": "https://foo", + "protocol": "https:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://foo:80/", + "base": "about:blank", + "href": "https://foo:80/", + "origin": "https://foo:80", + "protocol": "https:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp://foo:21/", + "base": "about:blank", + "href": "ftp://foo/", + "origin": "ftp://foo", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp://foo:80/", + "base": "about:blank", + "href": "ftp://foo:80/", + "origin": "ftp://foo:80", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "gopher://foo:70/", + "base": "about:blank", + "href": "gopher://foo/", + "origin": "gopher://foo", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "gopher://foo:443/", + "base": "about:blank", + "href": "gopher://foo:443/", + "origin": "gopher://foo:443", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "foo:443", + "hostname": "foo", + "port": "443", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:80/", + "base": "about:blank", + "href": "ws://foo/", + "origin": "ws://foo", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:81/", + "base": "about:blank", + "href": "ws://foo:81/", + "origin": "ws://foo:81", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo:81", + "hostname": "foo", + "port": "81", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:443/", + "base": "about:blank", + "href": "ws://foo:443/", + "origin": "ws://foo:443", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo:443", + "hostname": "foo", + "port": "443", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:815/", + "base": "about:blank", + "href": "ws://foo:815/", + "origin": "ws://foo:815", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo:815", + "hostname": "foo", + "port": "815", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:80/", + "base": "about:blank", + "href": "wss://foo:80/", + "origin": "wss://foo:80", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:81/", + "base": "about:blank", + "href": "wss://foo:81/", + "origin": "wss://foo:81", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo:81", + "hostname": "foo", + "port": "81", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:443/", + "base": "about:blank", + "href": "wss://foo/", + "origin": "wss://foo", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:815/", + "base": "about:blank", + "href": "wss://foo:815/", + "origin": "wss://foo:815", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo:815", + "hostname": "foo", + "port": "815", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/example.com/", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp:/example.com/", + "base": "about:blank", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:/example.com/", + "base": "about:blank", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:/example.com/", + "base": "about:blank", + "href": "madeupscheme:/example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "file:/example.com/", + "base": "about:blank", + "href": "file:///example.com/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftps:/example.com/", + "base": "about:blank", + "href": "ftps:/example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:/example.com/", + "base": "about:blank", + "href": "gopher://example.com/", + "origin": "gopher://example.com", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws:/example.com/", + "base": "about:blank", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:/example.com/", + "base": "about:blank", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:/example.com/", + "base": "about:blank", + "href": "data:/example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:/example.com/", + "base": "about:blank", + "href": "javascript:/example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:/example.com/", + "base": "about:blank", + "href": "mailto:/example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "http:example.com/", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp:example.com/", + "base": "about:blank", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:example.com/", + "base": "about:blank", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:example.com/", + "base": "about:blank", + "href": "madeupscheme:example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftps:example.com/", + "base": "about:blank", + "href": "ftps:example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:example.com/", + "base": "about:blank", + "href": "gopher://example.com/", + "origin": "gopher://example.com", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws:example.com/", + "base": "about:blank", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:example.com/", + "base": "about:blank", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:example.com/", + "base": "about:blank", + "href": "data:example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:example.com/", + "base": "about:blank", + "href": "javascript:example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:example.com/", + "base": "about:blank", + "href": "mailto:example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html", + { + "input": "http:@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:a:b@www.example.com", + "base": "about:blank", + "href": "http://a:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/a:b@www.example.com", + "base": "about:blank", + "href": "http://a:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://a:b@www.example.com", + "base": "about:blank", + "href": "http://a:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://@pple.com", + "base": "about:blank", + "href": "http://pple.com/", + "origin": "http://pple.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "pple.com", + "hostname": "pple.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http::b@www.example.com", + "base": "about:blank", + "href": "http://:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/:b@www.example.com", + "base": "about:blank", + "href": "http://:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://:b@www.example.com", + "base": "about:blank", + "href": "http://:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/:@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http://user@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:/@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http://@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "https:@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:a:b@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:/a:b@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a:b@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http::@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:a:@www.example.com", + "base": "about:blank", + "href": "http://a@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/a:@www.example.com", + "base": "about:blank", + "href": "http://a@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://a:@www.example.com", + "base": "about:blank", + "href": "http://a@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://www.@pple.com", + "base": "about:blank", + "href": "http://www.@pple.com/", + "origin": "http://pple.com", + "protocol": "http:", + "username": "www.", + "password": "", + "host": "pple.com", + "hostname": "pple.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:@:www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:/@:www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http://@:www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http://:@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# Others", + { + "input": "/", + "base": "http://www.example.com/test", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "/test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": ".", + "base": "http://www.example.com/test", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "http://www.example.com/test", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "./test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "../test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "../aaa/test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/aaa/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/aaa/test.txt", + "search": "", + "hash": "" + }, + { + "input": "../../test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "中/test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/%E4%B8%AD/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/%E4%B8%AD/test.txt", + "search": "", + "hash": "" + }, + { + "input": "http://www.example2.com", + "base": "http://www.example.com/test", + "href": "http://www.example2.com/", + "origin": "http://www.example2.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example2.com", + "hostname": "www.example2.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "//www.example2.com", + "base": "http://www.example.com/test", + "href": "http://www.example2.com/", + "origin": "http://www.example2.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example2.com", + "hostname": "www.example2.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:...", + "base": "http://www.example.com/test", + "href": "file:///...", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/...", + "search": "", + "hash": "" + }, + { + "input": "file:..", + "base": "http://www.example.com/test", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:a", + "base": "http://www.example.com/test", + "href": "file:///a", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/a", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html", + "Basic canonicalization, uppercase should be converted to lowercase", + { + "input": "http://ExAmPlE.CoM", + "base": "http://other.com/", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://example example.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://Goo%20 goo%7C|.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[:]", + "base": "http://other.com/", + "failure": true + }, + "U+3000 is mapped to U+0020 (space) which is disallowed", + { + "input": "http://GOO\u00a0\u3000goo.com", + "base": "http://other.com/", + "failure": true + }, + "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored", + { + "input": "http://GOO\u200b\u2060\ufeffgoo.com", + "base": "http://other.com/", + "href": "http://googoo.com/", + "origin": "http://googoo.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "googoo.com", + "hostname": "googoo.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Leading and trailing C0 control or space", + { + "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)", + { + "input": "http://www.foo。bar.com", + "base": "http://other.com/", + "href": "http://www.foo.bar.com/", + "origin": "http://www.foo.bar.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.foo.bar.com", + "hostname": "www.foo.bar.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0", + { + "input": "http://\ufdd0zyx.com", + "base": "http://other.com/", + "failure": true + }, + "This is the same as previous but escaped", + { + "input": "http://%ef%b7%90zyx.com", + "base": "http://other.com/", + "failure": true + }, + "U+FFFD", + { + "input": "https://\ufffd", + "base": "about:blank", + "failure": true + }, + { + "input": "https://%EF%BF%BD", + "base": "about:blank", + "failure": true + }, + { + "input": "https://x/\ufffd?\ufffd#\ufffd", + "base": "about:blank", + "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD", + "origin": "https://x", + "protocol": "https:", + "username": "", + "password": "", + "host": "x", + "hostname": "x", + "port": "", + "pathname": "/%EF%BF%BD", + "search": "?%EF%BF%BD", + "hash": "#%EF%BF%BD" + }, + "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.", + { + "input": "http://Go.com", + "base": "http://other.com/", + "href": "http://go.com/", + "origin": "http://go.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "go.com", + "hostname": "go.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257", + { + "input": "http://%41.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com", + "base": "http://other.com/", + "failure": true + }, + "...%00 in fullwidth should fail (also as escaped UTF-8 input)", + { + "input": "http://%00.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com", + "base": "http://other.com/", + "failure": true + }, + "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN", + { + "input": "http://你好你好", + "base": "http://other.com/", + "href": "http://xn--6qqa088eba/", + "origin": "http://xn--6qqa088eba", + "protocol": "http:", + "username": "", + "password": "", + "host": "xn--6qqa088eba", + "hostname": "xn--6qqa088eba", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://faß.ExAmPlE/", + "base": "about:blank", + "href": "https://xn--fa-hia.example/", + "origin": "https://xn--fa-hia.example", + "protocol": "https:", + "username": "", + "password": "", + "host": "xn--fa-hia.example", + "hostname": "xn--fa-hia.example", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://faß.ExAmPlE/", + "base": "about:blank", + "href": "sc://fa%C3%9F.ExAmPlE/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "fa%C3%9F.ExAmPlE", + "hostname": "fa%C3%9F.ExAmPlE", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191", + { + "input": "http://%zz%66%a.com", + "base": "http://other.com/", + "failure": true + }, + "If we get an invalid character that has been escaped.", + { + "input": "http://%25", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://hello%00", + "base": "http://other.com/", + "failure": true + }, + "Escaped numbers should be treated like IP addresses if they are.", + { + "input": "http://%30%78%63%30%2e%30%32%35%30.01", + "base": "http://other.com/", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e", + "base": "http://other.com/", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.168.0.257", + "base": "http://other.com/", + "failure": true + }, + "Invalid escaping in hosts causes failure", + { + "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01", + "base": "http://other.com/", + "failure": true + }, + "A space in a host causes failure", + { + "input": "http://192.168.0.1 hello", + "base": "http://other.com/", + "failure": true + }, + { + "input": "https://x x:12", + "base": "about:blank", + "failure": true + }, + "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP", + { + "input": "http://0Xc0.0250.01", + "base": "http://other.com/", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Domains with empty labels", + { + "input": "http://./", + "base": "about:blank", + "href": "http://./", + "origin": "http://.", + "protocol": "http:", + "username": "", + "password": "", + "host": ".", + "hostname": ".", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://../", + "base": "about:blank", + "href": "http://../", + "origin": "http://..", + "protocol": "http:", + "username": "", + "password": "", + "host": "..", + "hostname": "..", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://0..0x300/", + "base": "about:blank", + "href": "http://0..0x300/", + "origin": "http://0..0x300", + "protocol": "http:", + "username": "", + "password": "", + "host": "0..0x300", + "hostname": "0..0x300", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Broken IPv6", + { + "input": "http://[www.google.com]/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://[google.com]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.2.3.4x]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.2.3.]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.2.]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.]", + "base": "http://other.com/", + "failure": true + }, + "Misc Unicode", + { + "input": "http://foo:💩@example.com/bar", + "base": "http://other.com/", + "href": "http://foo:%F0%9F%92%A9@example.com/bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "foo", + "password": "%F0%9F%92%A9", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/bar", + "search": "", + "hash": "" + }, + "# resolving a fragment against any scheme succeeds", + { + "input": "#", + "base": "test:test", + "href": "test:test#", + "origin": "null", + "protocol": "test:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "test", + "search": "", + "hash": "" + }, + { + "input": "#x", + "base": "mailto:x@x.com", + "href": "mailto:x@x.com#x", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "x@x.com", + "search": "", + "hash": "#x" + }, + { + "input": "#x", + "base": "data:,", + "href": "data:,#x", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": ",", + "search": "", + "hash": "#x" + }, + { + "input": "#x", + "base": "about:blank", + "href": "about:blank#x", + "origin": "null", + "protocol": "about:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "blank", + "search": "", + "hash": "#x" + }, + { + "input": "#", + "base": "test:test?test", + "href": "test:test?test#", + "origin": "null", + "protocol": "test:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "test", + "search": "?test", + "hash": "" + }, + "# multiple @ in authority state", + { + "input": "https://@test@test@example:800/", + "base": "http://doesnotmatter/", + "href": "https://%40test%40test@example:800/", + "origin": "https://example:800", + "protocol": "https:", + "username": "%40test%40test", + "password": "", + "host": "example:800", + "hostname": "example", + "port": "800", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://@@@example", + "base": "http://doesnotmatter/", + "href": "https://%40%40@example/", + "origin": "https://example", + "protocol": "https:", + "username": "%40%40", + "password": "", + "host": "example", + "hostname": "example", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "non-az-09 characters", + { + "input": "http://`{}:`{}@h/`{}?`{}", + "base": "http://doesnotmatter/", + "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}", + "origin": "http://h", + "protocol": "http:", + "username": "%60%7B%7D", + "password": "%60%7B%7D", + "host": "h", + "hostname": "h", + "port": "", + "pathname": "/%60%7B%7D", + "search": "?`{}", + "hash": "" + }, + "# Credentials in base", + { + "input": "/some/path", + "base": "http://user@example.org/smth", + "href": "http://user@example.org/some/path", + "origin": "http://example.org", + "protocol": "http:", + "username": "user", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/some/path", + "search": "", + "hash": "" + }, + { + "input": "", + "base": "http://user:pass@example.org:21/smth", + "href": "http://user:pass@example.org:21/smth", + "origin": "http://example.org:21", + "protocol": "http:", + "username": "user", + "password": "pass", + "host": "example.org:21", + "hostname": "example.org", + "port": "21", + "pathname": "/smth", + "search": "", + "hash": "" + }, + { + "input": "/some/path", + "base": "http://user:pass@example.org:21/smth", + "href": "http://user:pass@example.org:21/some/path", + "origin": "http://example.org:21", + "protocol": "http:", + "username": "user", + "password": "pass", + "host": "example.org:21", + "hostname": "example.org", + "port": "21", + "pathname": "/some/path", + "search": "", + "hash": "" + }, + "# a set of tests designed by zcorpan for relative URLs with unknown schemes", + { + "input": "i", + "base": "sc:sd", + "failure": true + }, + { + "input": "i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "i", + "base": "sc:/pa/pa", + "href": "sc:/pa/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/i", + "search": "", + "hash": "" + }, + { + "input": "i", + "base": "sc://ho/pa", + "href": "sc://ho/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "i", + "base": "sc:///pa/pa", + "href": "sc:///pa/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/i", + "search": "", + "hash": "" + }, + { + "input": "../i", + "base": "sc:sd", + "failure": true + }, + { + "input": "../i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "../i", + "base": "sc:/pa/pa", + "href": "sc:/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "../i", + "base": "sc://ho/pa", + "href": "sc://ho/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "../i", + "base": "sc:///pa/pa", + "href": "sc:///i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "/i", + "base": "sc:sd", + "failure": true + }, + { + "input": "/i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "/i", + "base": "sc:/pa/pa", + "href": "sc:/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "/i", + "base": "sc://ho/pa", + "href": "sc://ho/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "/i", + "base": "sc:///pa/pa", + "href": "sc:///i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "?i", + "base": "sc:sd", + "failure": true + }, + { + "input": "?i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "?i", + "base": "sc:/pa/pa", + "href": "sc:/pa/pa?i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "?i", + "hash": "" + }, + { + "input": "?i", + "base": "sc://ho/pa", + "href": "sc://ho/pa?i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/pa", + "search": "?i", + "hash": "" + }, + { + "input": "?i", + "base": "sc:///pa/pa", + "href": "sc:///pa/pa?i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "?i", + "hash": "" + }, + { + "input": "#i", + "base": "sc:sd", + "href": "sc:sd#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "sd", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc:sd/sd", + "href": "sc:sd/sd#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "sd/sd", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc:/pa/pa", + "href": "sc:/pa/pa#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc://ho/pa", + "href": "sc://ho/pa#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/pa", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc:///pa/pa", + "href": "sc:///pa/pa#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "", + "hash": "#i" + }, + "# make sure that relative URL logic works on known typically non-relative schemes too", + { + "input": "about:/../", + "base": "about:blank", + "href": "about:/", + "origin": "null", + "protocol": "about:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:/../", + "base": "about:blank", + "href": "data:/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "javascript:/../", + "base": "about:blank", + "href": "javascript:/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "mailto:/../", + "base": "about:blank", + "href": "mailto:/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# unknown schemes and their hosts", + { + "input": "sc://ñ.test/", + "base": "about:blank", + "href": "sc://%C3%B1.test/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1.test", + "hostname": "%C3%B1.test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/", + "base": "about:blank", + "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~", + "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://\u0000/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc:// /", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://%/", + "base": "about:blank", + "href": "sc://%/", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%", + "hostname": "%", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://@/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://te@s:t@/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://:/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://:12/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://[/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://\\/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://]/", + "base": "about:blank", + "failure": true + }, + { + "input": "x", + "base": "sc://ñ", + "href": "sc://%C3%B1/x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + "# unknown schemes and backslashes", + { + "input": "sc:\\../", + "base": "about:blank", + "href": "sc:\\../", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "\\../", + "search": "", + "hash": "" + }, + "# unknown scheme with path looking like a password", + { + "input": "sc::a@example.net", + "base": "about:blank", + "href": "sc::a@example.net", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": ":a@example.net", + "search": "", + "hash": "" + }, + "# unknown scheme with bogus percent-encoding", + { + "input": "wow:%NBD", + "base": "about:blank", + "href": "wow:%NBD", + "origin": "null", + "protocol": "wow:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "%NBD", + "search": "", + "hash": "" + }, + { + "input": "wow:%1G", + "base": "about:blank", + "href": "wow:%1G", + "origin": "null", + "protocol": "wow:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "%1G", + "search": "", + "hash": "" + }, + "# Hosts and percent-encoding", + { + "input": "ftp://example.com%80/", + "base": "about:blank", + "failure": true + }, + { + "input": "ftp://example.com%A0/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://example.com%80/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://example.com%A0/", + "base": "about:blank", + "failure": true + }, + { + "input": "ftp://%e2%98%83", + "base": "about:blank", + "href": "ftp://xn--n3h/", + "origin": "ftp://xn--n3h", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "xn--n3h", + "hostname": "xn--n3h", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://%e2%98%83", + "base": "about:blank", + "href": "https://xn--n3h/", + "origin": "https://xn--n3h", + "protocol": "https:", + "username": "", + "password": "", + "host": "xn--n3h", + "hostname": "xn--n3h", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# tests from jsdom/whatwg-url designed for code coverage", + { + "input": "http://127.0.0.1:10100/relative_import.html", + "base": "about:blank", + "href": "http://127.0.0.1:10100/relative_import.html", + "origin": "http://127.0.0.1:10100", + "protocol": "http:", + "username": "", + "password": "", + "host": "127.0.0.1:10100", + "hostname": "127.0.0.1", + "port": "10100", + "pathname": "/relative_import.html", + "search": "", + "hash": "" + }, + { + "input": "http://facebook.com/?foo=%7B%22abc%22", + "base": "about:blank", + "href": "http://facebook.com/?foo=%7B%22abc%22", + "origin": "http://facebook.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "facebook.com", + "hostname": "facebook.com", + "port": "", + "pathname": "/", + "search": "?foo=%7B%22abc%22", + "hash": "" + }, + { + "input": "https://localhost:3000/jqueryui@1.2.3", + "base": "about:blank", + "href": "https://localhost:3000/jqueryui@1.2.3", + "origin": "https://localhost:3000", + "protocol": "https:", + "username": "", + "password": "", + "host": "localhost:3000", + "hostname": "localhost", + "port": "3000", + "pathname": "/jqueryui@1.2.3", + "search": "", + "hash": "" + }, + "# tab/LF/CR", + { + "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg", + "base": "about:blank", + "href": "http://host:9000/path?query#frag", + "origin": "http://host:9000", + "protocol": "http:", + "username": "", + "password": "", + "host": "host:9000", + "hostname": "host", + "port": "9000", + "pathname": "/path", + "search": "?query", + "hash": "#frag" + }, + "# Stringification of URL.searchParams", + { + "input": "?a=b&c=d", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar?a=b&c=d", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "?a=b&c=d", + "searchParams": "a=b&c=d", + "hash": "" + }, + { + "input": "??a=b&c=d", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar??a=b&c=d", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "??a=b&c=d", + "searchParams": "%3Fa=b&c=d", + "hash": "" + }, + "# Scheme only", + { + "input": "http:", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "searchParams": "", + "hash": "" + }, + { + "input": "http:", + "base": "https://example.org/foo/bar", + "failure": true + }, + { + "input": "sc:", + "base": "https://example.org/foo/bar", + "href": "sc:", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "searchParams": "", + "hash": "" + }, + "# Percent encoding of fragments", + { + "input": "http://foo.bar/baz?qux#foo\bbar", + "base": "about:blank", + "href": "http://foo.bar/baz?qux#foo%08bar", + "origin": "http://foo.bar", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.bar", + "hostname": "foo.bar", + "port": "", + "pathname": "/baz", + "search": "?qux", + "searchParams": "qux=", + "hash": "#foo%08bar" + }, + "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)", + { + "input": "http://192.168.257", + "base": "http://other.com/", + "href": "http://192.168.1.1/", + "origin": "http://192.168.1.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.1.1", + "hostname": "192.168.1.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.168.257.com", + "base": "http://other.com/", + "href": "http://192.168.257.com/", + "origin": "http://192.168.257.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.257.com", + "hostname": "192.168.257.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://256", + "base": "http://other.com/", + "href": "http://0.0.1.0/", + "origin": "http://0.0.1.0", + "protocol": "http:", + "username": "", + "password": "", + "host": "0.0.1.0", + "hostname": "0.0.1.0", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://256.com", + "base": "http://other.com/", + "href": "http://256.com/", + "origin": "http://256.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "256.com", + "hostname": "256.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://999999999", + "base": "http://other.com/", + "href": "http://59.154.201.255/", + "origin": "http://59.154.201.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "59.154.201.255", + "hostname": "59.154.201.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://999999999.com", + "base": "http://other.com/", + "href": "http://999999999.com/", + "origin": "http://999999999.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "999999999.com", + "hostname": "999999999.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://10000000000", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://10000000000.com", + "base": "http://other.com/", + "href": "http://10000000000.com/", + "origin": "http://10000000000.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "10000000000.com", + "hostname": "10000000000.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://4294967295", + "base": "http://other.com/", + "href": "http://255.255.255.255/", + "origin": "http://255.255.255.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "255.255.255.255", + "hostname": "255.255.255.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://4294967296", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://0xffffffff", + "base": "http://other.com/", + "href": "http://255.255.255.255/", + "origin": "http://255.255.255.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "255.255.255.255", + "hostname": "255.255.255.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://0xffffffff1", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://256.256.256.256", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://256.256.256.256.256", + "base": "http://other.com/", + "href": "http://256.256.256.256.256/", + "origin": "http://256.256.256.256.256", + "protocol": "http:", + "username": "", + "password": "", + "host": "256.256.256.256.256", + "hostname": "256.256.256.256.256", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://0x.0x.0", + "base": "about:blank", + "href": "https://0.0.0.0/", + "origin": "https://0.0.0.0", + "protocol": "https:", + "username": "", + "password": "", + "host": "0.0.0.0", + "hostname": "0.0.0.0", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)", + { + "input": "https://0x100000000/test", + "base": "about:blank", + "failure": true + }, + { + "input": "https://256.0.0.1/test", + "base": "about:blank", + "failure": true + }, + "# file URLs containing percent-encoded Windows drive letters (shouldn't work)", + { + "input": "file:///C%3A/", + "base": "about:blank", + "href": "file:///C%3A/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C%3A/", + "search": "", + "hash": "" + }, + { + "input": "file:///C%7C/", + "base": "about:blank", + "href": "file:///C%7C/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C%7C/", + "search": "", + "hash": "" + }, + "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)", + { + "input": "pix/submit.gif", + "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html", + "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///C:/", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# More file URL tests by zcorpan and annevk", + { + "input": "/", + "base": "file:///C:/a/b", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "//d:", + "base": "file:///C:/a/b", + "href": "file:///d:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/d:", + "search": "", + "hash": "" + }, + { + "input": "//d:/..", + "base": "file:///C:/a/b", + "href": "file:///d:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/d:/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///ab:/", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///1:/", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "", + "base": "file:///test?test#test", + "href": "file:///test?test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "" + }, + { + "input": "file:", + "base": "file:///test?test#test", + "href": "file:///test?test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "" + }, + { + "input": "?x", + "base": "file:///test?test#test", + "href": "file:///test?x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?x", + "hash": "" + }, + { + "input": "file:?x", + "base": "file:///test?test#test", + "href": "file:///test?x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?x", + "hash": "" + }, + { + "input": "#x", + "base": "file:///test?test#test", + "href": "file:///test?test#x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "#x" + }, + { + "input": "file:#x", + "base": "file:///test?test#test", + "href": "file:///test?test#x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "#x" + }, + "# File URLs and many (back)slashes", + { + "input": "file:\\\\//", + "base": "about:blank", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:\\\\\\\\", + "base": "about:blank", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:\\\\\\\\?fox", + "base": "about:blank", + "href": "file:///?fox", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "?fox", + "hash": "" + }, + { + "input": "file:\\\\\\\\#guppy", + "base": "about:blank", + "href": "file:///#guppy", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "#guppy" + }, + { + "input": "file://spider///", + "base": "about:blank", + "href": "file://spider/", + "protocol": "file:", + "username": "", + "password": "", + "host": "spider", + "hostname": "spider", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:\\\\localhost//", + "base": "about:blank", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:///localhost//cat", + "base": "about:blank", + "href": "file:///localhost//cat", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/localhost//cat", + "search": "", + "hash": "" + }, + { + "input": "file://\\/localhost//cat", + "base": "about:blank", + "href": "file:///localhost//cat", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/localhost//cat", + "search": "", + "hash": "" + }, + { + "input": "file://localhost//a//../..//", + "base": "about:blank", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "/////mouse", + "base": "file:///elephant", + "href": "file:///mouse", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/mouse", + "search": "", + "hash": "" + }, + { + "input": "\\//pig", + "base": "file://lion/", + "href": "file:///pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pig", + "search": "", + "hash": "" + }, + { + "input": "\\/localhost//pig", + "base": "file://lion/", + "href": "file:///pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pig", + "search": "", + "hash": "" + }, + { + "input": "//localhost//pig", + "base": "file://lion/", + "href": "file:///pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pig", + "search": "", + "hash": "" + }, + { + "input": "/..//localhost//pig", + "base": "file://lion/", + "href": "file://lion/localhost//pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "lion", + "hostname": "lion", + "port": "", + "pathname": "/localhost//pig", + "search": "", + "hash": "" + }, + { + "input": "file://", + "base": "file://ape/", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# File URLs with non-empty hosts", + { + "input": "/rooibos", + "base": "file://tea/", + "href": "file://tea/rooibos", + "protocol": "file:", + "username": "", + "password": "", + "host": "tea", + "hostname": "tea", + "port": "", + "pathname": "/rooibos", + "search": "", + "hash": "" + }, + { + "input": "/?chai", + "base": "file://tea/", + "href": "file://tea/?chai", + "protocol": "file:", + "username": "", + "password": "", + "host": "tea", + "hostname": "tea", + "port": "", + "pathname": "/", + "search": "?chai", + "hash": "" + }, + "# Windows drive letter handling with the 'file:' base URL", + { + "input": "C|", + "base": "file://host/dir/file", + "href": "file:///C:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|#", + "base": "file://host/dir/file", + "href": "file:///C:#", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|?", + "base": "file://host/dir/file", + "href": "file:///C:?", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|/", + "base": "file://host/dir/file", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "C|\n/", + "base": "file://host/dir/file", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "C|\\", + "base": "file://host/dir/file", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "C", + "base": "file://host/dir/file", + "href": "file://host/dir/C", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/dir/C", + "search": "", + "hash": "" + }, + { + "input": "C|a", + "base": "file://host/dir/file", + "href": "file://host/dir/C|a", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/dir/C|a", + "search": "", + "hash": "" + }, + "# Windows drive letter quirk in the file slash state", + { + "input": "/c:/foo/bar", + "base": "file:///c:/baz/qux", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/c|/foo/bar", + "base": "file:///c:/baz/qux", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "file:\\c:\\foo\\bar", + "base": "file:///c:/baz/qux", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/c:/foo/bar", + "base": "file://host/path", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + "# Windows drive letter quirk with not empty host", + { + "input": "file://example.net/C:/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://1.2.3.4/C:/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://[1::8]/C:/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + "# Windows drive letter quirk (no host)", + { + "input": "file:/C|/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://C|/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + "# file URLs without base URL by Rimas Misevičius", + { + "input": "file:", + "base": "about:blank", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:?q=v", + "base": "about:blank", + "href": "file:///?q=v", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "?q=v", + "hash": "" + }, + { + "input": "file:#frag", + "base": "about:blank", + "href": "file:///#frag", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "#frag" + }, + "# IPv6 tests", + { + "input": "http://[1:0::]", + "base": "http://example.net/", + "href": "http://[1::]/", + "origin": "http://[1::]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[1::]", + "hostname": "[1::]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[0:1:2:3:4:5:6:7:8]", + "base": "http://example.net/", + "failure": true + }, + { + "input": "https://[0::0::0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:.0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:0:]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1.00.0.0.0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1.290.0.0.0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1.23.23]", + "base": "about:blank", + "failure": true + }, + "# Empty host", + { + "input": "http://?", + "base": "about:blank", + "failure": true + }, + { + "input": "http://#", + "base": "about:blank", + "failure": true + }, + "Port overflow (2^32 + 81)", + { + "input": "http://f:4294967377/c", + "base": "http://example.org/", + "failure": true + }, + "Port overflow (2^64 + 81)", + { + "input": "http://f:18446744073709551697/c", + "base": "http://example.org/", + "failure": true + }, + "Port overflow (2^128 + 81)", + { + "input": "http://f:340282366920938463463374607431768211537/c", + "base": "http://example.org/", + "failure": true + }, + "# Non-special-URL path tests", + { + "input": "sc://ñ", + "base": "about:blank", + "href": "sc://%C3%B1", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "sc://ñ?x", + "base": "about:blank", + "href": "sc://%C3%B1?x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "?x", + "hash": "" + }, + { + "input": "sc://ñ#x", + "base": "about:blank", + "href": "sc://%C3%B1#x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "", + "hash": "#x" + }, + { + "input": "#x", + "base": "sc://ñ", + "href": "sc://%C3%B1#x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "", + "hash": "#x" + }, + { + "input": "?x", + "base": "sc://ñ", + "href": "sc://%C3%B1?x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "?x", + "hash": "" + }, + { + "input": "sc://?", + "base": "about:blank", + "href": "sc://?", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "sc://#", + "base": "about:blank", + "href": "sc://#", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "///", + "base": "sc://x/", + "href": "sc:///", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "////", + "base": "sc://x/", + "href": "sc:////", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "////x/", + "base": "sc://x/", + "href": "sc:////x/", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//x/", + "search": "", + "hash": "" + }, + { + "input": "tftp://foobar.com/someconfig;mode=netascii", + "base": "about:blank", + "href": "tftp://foobar.com/someconfig;mode=netascii", + "origin": "null", + "protocol": "tftp:", + "username": "", + "password": "", + "host": "foobar.com", + "hostname": "foobar.com", + "port": "", + "pathname": "/someconfig;mode=netascii", + "search": "", + "hash": "" + }, + { + "input": "telnet://user:pass@foobar.com:23/", + "base": "about:blank", + "href": "telnet://user:pass@foobar.com:23/", + "origin": "null", + "protocol": "telnet:", + "username": "user", + "password": "pass", + "host": "foobar.com:23", + "hostname": "foobar.com", + "port": "23", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ut2004://10.10.10.10:7777/Index.ut2", + "base": "about:blank", + "href": "ut2004://10.10.10.10:7777/Index.ut2", + "origin": "null", + "protocol": "ut2004:", + "username": "", + "password": "", + "host": "10.10.10.10:7777", + "hostname": "10.10.10.10", + "port": "7777", + "pathname": "/Index.ut2", + "search": "", + "hash": "" + }, + { + "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", + "base": "about:blank", + "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", + "origin": "null", + "protocol": "redis:", + "username": "foo", + "password": "bar", + "host": "somehost:6379", + "hostname": "somehost", + "port": "6379", + "pathname": "/0", + "search": "?baz=bam&qux=baz", + "hash": "" + }, + { + "input": "rsync://foo@host:911/sup", + "base": "about:blank", + "href": "rsync://foo@host:911/sup", + "origin": "null", + "protocol": "rsync:", + "username": "foo", + "password": "", + "host": "host:911", + "hostname": "host", + "port": "911", + "pathname": "/sup", + "search": "", + "hash": "" + }, + { + "input": "git://github.com/foo/bar.git", + "base": "about:blank", + "href": "git://github.com/foo/bar.git", + "origin": "null", + "protocol": "git:", + "username": "", + "password": "", + "host": "github.com", + "hostname": "github.com", + "port": "", + "pathname": "/foo/bar.git", + "search": "", + "hash": "" + }, + { + "input": "irc://myserver.com:6999/channel?passwd", + "base": "about:blank", + "href": "irc://myserver.com:6999/channel?passwd", + "origin": "null", + "protocol": "irc:", + "username": "", + "password": "", + "host": "myserver.com:6999", + "hostname": "myserver.com", + "port": "6999", + "pathname": "/channel", + "search": "?passwd", + "hash": "" + }, + { + "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT", + "base": "about:blank", + "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT", + "origin": "null", + "protocol": "dns:", + "username": "", + "password": "", + "host": "fw.example.org:9999", + "hostname": "fw.example.org", + "port": "9999", + "pathname": "/foo.bar.org", + "search": "?type=TXT", + "hash": "" + }, + { + "input": "ldap://localhost:389/ou=People,o=JNDITutorial", + "base": "about:blank", + "href": "ldap://localhost:389/ou=People,o=JNDITutorial", + "origin": "null", + "protocol": "ldap:", + "username": "", + "password": "", + "host": "localhost:389", + "hostname": "localhost", + "port": "389", + "pathname": "/ou=People,o=JNDITutorial", + "search": "", + "hash": "" + }, + { + "input": "git+https://github.com/foo/bar", + "base": "about:blank", + "href": "git+https://github.com/foo/bar", + "origin": "null", + "protocol": "git+https:", + "username": "", + "password": "", + "host": "github.com", + "hostname": "github.com", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "urn:ietf:rfc:2648", + "base": "about:blank", + "href": "urn:ietf:rfc:2648", + "origin": "null", + "protocol": "urn:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "ietf:rfc:2648", + "search": "", + "hash": "" + }, + { + "input": "tag:joe@example.org,2001:foo/bar", + "base": "about:blank", + "href": "tag:joe@example.org,2001:foo/bar", + "origin": "null", + "protocol": "tag:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "joe@example.org,2001:foo/bar", + "search": "", + "hash": "" + }, + "# percent encoded hosts in non-special-URLs", + { + "input": "non-special://%E2%80%A0/", + "base": "about:blank", + "href": "non-special://%E2%80%A0/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "%E2%80%A0", + "hostname": "%E2%80%A0", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://H%4fSt/path", + "base": "about:blank", + "href": "non-special://H%4fSt/path", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "H%4fSt", + "hostname": "H%4fSt", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + "# IPv6 in non-special-URLs", + { + "input": "non-special://[1:2:0:0:5:0:0:0]/", + "base": "about:blank", + "href": "non-special://[1:2:0:0:5::]/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "[1:2:0:0:5::]", + "hostname": "[1:2:0:0:5::]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://[1:2:0:0:0:0:0:3]/", + "base": "about:blank", + "href": "non-special://[1:2::3]/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "[1:2::3]", + "hostname": "[1:2::3]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://[1:2::3]:80/", + "base": "about:blank", + "href": "non-special://[1:2::3]:80/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "[1:2::3]:80", + "hostname": "[1:2::3]", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://[:80/", + "base": "about:blank", + "failure": true + }, + { + "input": "blob:https://example.com:443/", + "base": "about:blank", + "href": "blob:https://example.com:443/", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "https://example.com:443/", + "search": "", + "hash": "" + }, + { + "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", + "base": "about:blank", + "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf", + "search": "", + "hash": "" + }, + "Invalid IPv4 radix digits", + { + "input": "http://0177.0.0.0189", + "base": "about:blank", + "href": "http://0177.0.0.0189/", + "protocol": "http:", + "username": "", + "password": "", + "host": "0177.0.0.0189", + "hostname": "0177.0.0.0189", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://0x7f.0.0.0x7g", + "base": "about:blank", + "href": "http://0x7f.0.0.0x7g/", + "protocol": "http:", + "username": "", + "password": "", + "host": "0x7f.0.0.0x7g", + "hostname": "0x7f.0.0.0x7g", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://0X7F.0.0.0X7G", + "base": "about:blank", + "href": "http://0x7f.0.0.0x7g/", + "protocol": "http:", + "username": "", + "password": "", + "host": "0x7f.0.0.0x7g", + "hostname": "0x7f.0.0.0x7g", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Invalid IPv4 portion of IPv6 address", + { + "input": "http://[::127.0.0.0.1]", + "base": "about:blank", + "failure": true + }, + "Uncompressed IPv6 addresses with 0", + { + "input": "http://[0:1:0:1:0:1:0:1]", + "base": "about:blank", + "href": "http://[0:1:0:1:0:1:0:1]/", + "protocol": "http:", + "username": "", + "password": "", + "host": "[0:1:0:1:0:1:0:1]", + "hostname": "[0:1:0:1:0:1:0:1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[1:0:1:0:1:0:1:0]", + "base": "about:blank", + "href": "http://[1:0:1:0:1:0:1:0]/", + "protocol": "http:", + "username": "", + "password": "", + "host": "[1:0:1:0:1:0:1:0]", + "hostname": "[1:0:1:0:1:0:1:0]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Percent-encoded query and fragment", + { + "input": "http://example.org/test?\u0022", + "base": "about:blank", + "href": "http://example.org/test?%22", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%22", + "hash": "" + }, + { + "input": "http://example.org/test?\u0023", + "base": "about:blank", + "href": "http://example.org/test?#", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "", + "hash": "" + }, + { + "input": "http://example.org/test?\u003C", + "base": "about:blank", + "href": "http://example.org/test?%3C", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%3C", + "hash": "" + }, + { + "input": "http://example.org/test?\u003E", + "base": "about:blank", + "href": "http://example.org/test?%3E", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%3E", + "hash": "" + }, + { + "input": "http://example.org/test?\u2323", + "base": "about:blank", + "href": "http://example.org/test?%E2%8C%A3", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%E2%8C%A3", + "hash": "" + }, + { + "input": "http://example.org/test?%23%23", + "base": "about:blank", + "href": "http://example.org/test?%23%23", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%23%23", + "hash": "" + }, + { + "input": "http://example.org/test?%GH", + "base": "about:blank", + "href": "http://example.org/test?%GH", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%GH", + "hash": "" + }, + { + "input": "http://example.org/test?a#%EF", + "base": "about:blank", + "href": "http://example.org/test?a#%EF", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#%EF" + }, + { + "input": "http://example.org/test?a#%GH", + "base": "about:blank", + "href": "http://example.org/test?a#%GH", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#%GH" + }, + "Bad bases", + { + "input": "test-a.html", + "base": "a", + "failure": true + }, + { + "input": "test-a-slash.html", + "base": "a/", + "failure": true + }, + { + "input": "test-a-slash-slash.html", + "base": "a//", + "failure": true + }, + { + "input": "test-a-colon.html", + "base": "a:", + "failure": true + }, + { + "input": "test-a-colon-slash.html", + "base": "a:/", + "href": "a:/test-a-colon-slash.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test-a-colon-slash.html", + "search": "", + "hash": "" + }, + { + "input": "test-a-colon-slash-slash.html", + "base": "a://", + "href": "a:///test-a-colon-slash-slash.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test-a-colon-slash-slash.html", + "search": "", + "hash": "" + }, + { + "input": "test-a-colon-b.html", + "base": "a:b", + "failure": true + }, + { + "input": "test-a-colon-slash-b.html", + "base": "a:/b", + "href": "a:/test-a-colon-slash-b.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test-a-colon-slash-b.html", + "search": "", + "hash": "" + }, + { + "input": "test-a-colon-slash-slash-b.html", + "base": "a://b", + "href": "a://b/test-a-colon-slash-slash-b.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "b", + "hostname": "b", + "port": "", + "pathname": "/test-a-colon-slash-slash-b.html", + "search": "", + "hash": "" + }, + "Null code point in fragment", + { + "input": "http://example.org/test?a#b\u0000c", + "base": "about:blank", + "href": "http://example.org/test?a#bc", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#bc" + } +] diff --git a/test/fixtures/url-toascii.js b/test/fixtures/url-toascii.js new file mode 100644 index 00000000000000..59b76330f867f2 --- /dev/null +++ b/test/fixtures/url-toascii.js @@ -0,0 +1,157 @@ +'use strict'; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.json + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +module.exports = +[ + "This resource is focused on highlighting issues with UTS #46 ToASCII", + { + "comment": "Label with hyphens in 3rd and 4th position", + "input": "aa--", + "output": "aa--" + }, + { + "input": "a†--", + "output": "xn--a---kp0a" + }, + { + "input": "ab--c", + "output": "ab--c" + }, + { + "comment": "Label with leading hyphen", + "input": "-x", + "output": "-x" + }, + { + "input": "-†", + "output": "xn----xhn" + }, + { + "input": "-x.xn--nxa", + "output": "-x.xn--nxa" + }, + { + "input": "-x.β", + "output": "-x.xn--nxa" + }, + { + "comment": "Label with trailing hyphen", + "input": "x-.xn--nxa", + "output": "x-.xn--nxa" + }, + { + "input": "x-.β", + "output": "x-.xn--nxa" + }, + { + "comment": "Empty labels", + "input": "x..xn--nxa", + "output": "x..xn--nxa" + }, + { + "input": "x..β", + "output": "x..xn--nxa" + }, + { + "comment": "Invalid Punycode", + "input": "xn--a", + "output": null + }, + { + "input": "xn--a.xn--nxa", + "output": null + }, + { + "input": "xn--a.β", + "output": null + }, + { + "comment": "Valid Punycode", + "input": "xn--nxa.xn--nxa", + "output": "xn--nxa.xn--nxa" + }, + { + "comment": "Mixed", + "input": "xn--nxa.β", + "output": "xn--nxa.xn--nxa" + }, + { + "input": "ab--c.xn--nxa", + "output": "ab--c.xn--nxa" + }, + { + "input": "ab--c.β", + "output": "ab--c.xn--nxa" + }, + { + "comment": "CheckJoiners is true", + "input": "\u200D.example", + "output": null + }, + { + "input": "xn--1ug.example", + "output": null + }, + { + "comment": "CheckBidi is true", + "input": "يa", + "output": null + }, + { + "input": "xn--a-yoc", + "output": null + }, + { + "comment": "processing_option is Nontransitional_Processing", + "input": "ශ්‍රී", + "output": "xn--10cl1a0b660p" + }, + { + "input": "نامه‌ای", + "output": "xn--mgba3gch31f060k" + }, + { + "comment": "U+FFFD", + "input": "\uFFFD.com", + "output": null + }, + { + "comment": "U+FFFD character encoded in Punycode", + "input": "xn--zn7c.com", + "output": null + }, + { + "comment": "Label longer than 63 code points", + "input": "x01234567890123456789012345678901234567890123456789012345678901x", + "output": "x01234567890123456789012345678901234567890123456789012345678901x" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901†", + "output": "xn--x01234567890123456789012345678901234567890123456789012345678901-6963b" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa", + "output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901x.β", + "output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa" + }, + { + "comment": "Domain excluding TLD longer than 253 code points", + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x" + }, + { + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa" + }, + { + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.β", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa" + } +] diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index 0bcfead879c7ad..52e7ea4b3a007d 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -8,6 +8,7 @@ const assert = require('assert'); const dgram = require('dgram'); const fork = require('child_process').fork; const LOCAL_BROADCAST_HOST = '224.0.0.114'; +const LOCAL_HOST_IFADDR = '0.0.0.0'; const TIMEOUT = common.platformTimeout(5000); const messages = [ Buffer.from('First message to send'), @@ -136,6 +137,7 @@ if (process.argv[2] !== 'child') { sendSocket.setBroadcast(true); sendSocket.setMulticastTTL(1); sendSocket.setMulticastLoopback(true); + sendSocket.setMulticastInterface(LOCAL_HOST_IFADDR); }); sendSocket.on('close', function() { @@ -175,7 +177,7 @@ if (process.argv[2] === 'child') { }); listenSocket.on('listening', function() { - listenSocket.addMembership(LOCAL_BROADCAST_HOST); + listenSocket.addMembership(LOCAL_BROADCAST_HOST, LOCAL_HOST_IFADDR); listenSocket.on('message', function(buf, rinfo) { console.error('[CHILD] %s received "%s" from %j', process.pid, diff --git a/test/parallel/test-console-clear.js b/test/parallel/test-console-clear.js new file mode 100644 index 00000000000000..b6fc003165dc66 --- /dev/null +++ b/test/parallel/test-console-clear.js @@ -0,0 +1,22 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); + +const stdoutWrite = process.stdout.write; + +// The sequence for moving the cursor to 0,0 and clearing screen down +const check = '\u001b[1;1H\u001b[0J'; + +function doTest(isTTY, check) { + let buf = ''; + process.stdout.isTTY = isTTY; + process.stdout.write = (string) => buf += string; + console.clear(); + process.stdout.write = stdoutWrite; + assert.strictEqual(buf, check); +} + +// Fake TTY +doTest(true, check); +doTest(false, ''); diff --git a/test/parallel/test-console-count.js b/test/parallel/test-console-count.js new file mode 100644 index 00000000000000..64e2641f0a641d --- /dev/null +++ b/test/parallel/test-console-count.js @@ -0,0 +1,63 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); + +const stdoutWrite = process.stdout.write; + +let buf = ''; + +process.stdout.write = (string) => buf = string; + +console.count(); +assert.strictEqual(buf, 'default: 1\n'); + +// 'default' and undefined are equivalent +console.count('default'); +assert.strictEqual(buf, 'default: 2\n'); + +console.count('a'); +assert.strictEqual(buf, 'a: 1\n'); + +console.count('b'); +assert.strictEqual(buf, 'b: 1\n'); + +console.count('a'); +assert.strictEqual(buf, 'a: 2\n'); + +console.count(); +assert.strictEqual(buf, 'default: 3\n'); + +console.count({}); +assert.strictEqual(buf, '[object Object]: 1\n'); + +console.count(1); +assert.strictEqual(buf, '1: 1\n'); + +console.count(null); +assert.strictEqual(buf, 'null: 1\n'); + +console.count('null'); +assert.strictEqual(buf, 'null: 2\n'); + +console.countReset(); +console.count(); +assert.strictEqual(buf, 'default: 1\n'); + +console.countReset('a'); +console.count('a'); +assert.strictEqual(buf, 'a: 1\n'); + +// countReset('a') only reset the a counter +console.count(); +assert.strictEqual(buf, 'default: 2\n'); + +process.stdout.write = stdoutWrite; + +// Symbol labels do not work +assert.throws( + () => console.count(Symbol('test')), + /^TypeError: Cannot convert a Symbol value to a string$/); +assert.throws( + () => console.countReset(Symbol('test')), + /^TypeError: Cannot convert a Symbol value to a string$/); diff --git a/test/parallel/test-crypto-classes.js b/test/parallel/test-crypto-classes.js new file mode 100644 index 00000000000000..9f8ab65a02fcd0 --- /dev/null +++ b/test/parallel/test-crypto-classes.js @@ -0,0 +1,43 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} +const crypto = require('crypto'); + +// 'ClassName' : ['args', 'for', 'constructor'] +const TEST_CASES = { + 'Hash': ['sha1'], + 'Hmac': ['sha1', 'Node'], + 'Cipheriv': ['des-ede3-cbc', '0123456789abcd0123456789', '12345678'], + 'Decipheriv': ['des-ede3-cbc', '0123456789abcd0123456789', '12345678'], + 'Sign': ['RSA-SHA1'], + 'Verify': ['RSA-SHA1'], + 'DiffieHellman': [1024], + 'DiffieHellmanGroup': ['modp5'], + 'ECDH': ['prime256v1'], + 'Credentials': [] +}; + +if (!common.hasFipsCrypto) { + TEST_CASES.Cipher = ['aes192', 'secret']; + TEST_CASES.Decipher = ['aes192', 'secret']; + TEST_CASES.DiffieHellman = [256]; +} + +function entries(obj) { + const ownProps = Object.keys(obj); + let i = ownProps.length; + const resArray = new Array(i); // preallocate the Array + while (i--) + resArray[i] = [ownProps[i], obj[ownProps[i]]]; + + return resArray; +} + +for (const [clazz, args] of entries(TEST_CASES)) { + assert(crypto[`create${clazz}`](...args) instanceof crypto[clazz]); +} diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js index a664023e81c06b..386602e4a13f2d 100644 --- a/test/parallel/test-crypto-random.js +++ b/test/parallel/test-crypto-random.js @@ -28,6 +28,208 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/; }); }); +{ + const buf = Buffer.alloc(10); + const before = buf.toString('hex'); + const after = crypto.randomFillSync(buf).toString('hex'); + assert.notStrictEqual(before, after); +} + +{ + const buf = new Uint8Array(new Array(10).fill(0)); + const before = Buffer.from(buf).toString('hex'); + crypto.randomFillSync(buf); + const after = Buffer.from(buf).toString('hex'); + assert.notStrictEqual(before, after); +} + +{ + const buf = Buffer.alloc(10); + const before = buf.toString('hex'); + crypto.randomFill(buf, common.mustCall((err, buf) => { + assert.ifError(err); + const after = buf.toString('hex'); + assert.notStrictEqual(before, after); + })); +} + +{ + const buf = new Uint8Array(new Array(10).fill(0)); + const before = Buffer.from(buf).toString('hex'); + crypto.randomFill(buf, common.mustCall((err, buf) => { + assert.ifError(err); + const after = Buffer.from(buf).toString('hex'); + assert.notStrictEqual(before, after); + })); +} + +{ + const buf = Buffer.alloc(10); + const before = buf.toString('hex'); + crypto.randomFillSync(buf, 5, 5); + const after = buf.toString('hex'); + assert.notStrictEqual(before, after); + assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); +} + +{ + const buf = new Uint8Array(new Array(10).fill(0)); + const before = Buffer.from(buf).toString('hex'); + crypto.randomFillSync(buf, 5, 5); + const after = Buffer.from(buf).toString('hex'); + assert.notStrictEqual(before, after); + assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); +} + +{ + const buf = Buffer.alloc(10); + const before = buf.toString('hex'); + crypto.randomFillSync(buf, 5); + const after = buf.toString('hex'); + assert.notStrictEqual(before, after); + assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); +} + +{ + const buf = Buffer.alloc(10); + const before = buf.toString('hex'); + crypto.randomFill(buf, 5, 5, common.mustCall((err, buf) => { + assert.ifError(err); + const after = buf.toString('hex'); + assert.notStrictEqual(before, after); + assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); + })); +} + +{ + const buf = new Uint8Array(new Array(10).fill(0)); + const before = Buffer.from(buf).toString('hex'); + crypto.randomFill(buf, 5, 5, common.mustCall((err, buf) => { + assert.ifError(err); + const after = Buffer.from(buf).toString('hex'); + assert.notStrictEqual(before, after); + assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); + })); +} + +{ + const bufs = [ + Buffer.alloc(10), + new Uint8Array(new Array(10).fill(0)) + ]; + + for (const buf of bufs) { + const len = Buffer.byteLength(buf); + assert.strictEqual(len, 10, `Expected byteLength of 10, got ${len}`); + + assert.throws(() => { + crypto.randomFillSync(buf, 'test'); + }, /offset must be a number/); + + assert.throws(() => { + crypto.randomFillSync(buf, NaN); + }, /offset must be a number/); + + assert.throws(() => { + crypto.randomFill(buf, 'test', function() {}); + }, /offset must be a number/); + + assert.throws(() => { + crypto.randomFill(buf, NaN, function() {}); + }, /offset must be a number/); + + const max = require('buffer').kMaxLength + 1; + + assert.throws(() => { + crypto.randomFillSync(buf, 11); + }, /offset out of range/); + + assert.throws(() => { + crypto.randomFillSync(buf, max); + }, /offset out of range/); + + assert.throws(() => { + crypto.randomFill(buf, 11, function() {}); + }, /offset out of range/); + + assert.throws(() => { + crypto.randomFill(buf, max, function() {}); + }, /offset out of range/); + + assert.throws(() => { + crypto.randomFillSync(buf, 0, 'test'); + }, /size must be a number/); + + assert.throws(() => { + crypto.randomFillSync(buf, 0, NaN); + }, /size must be a number/); + + assert.throws(() => { + crypto.randomFill(buf, 0, 'test', function() {}); + }, /size must be a number/); + + assert.throws(() => { + crypto.randomFill(buf, 0, NaN, function() {}); + }, /size must be a number/); + + { + const size = (-1 >>> 0) + 1; + + assert.throws(() => { + crypto.randomFillSync(buf, 0, -10); + }, /size must be a uint32/); + + assert.throws(() => { + crypto.randomFillSync(buf, 0, size); + }, /size must be a uint32/); + + assert.throws(() => { + crypto.randomFill(buf, 0, -10, function() {}); + }, /size must be a uint32/); + + assert.throws(() => { + crypto.randomFill(buf, 0, size, function() {}); + }, /size must be a uint32/); + } + + assert.throws(() => { + crypto.randomFillSync(buf, -10); + }, /offset must be a uint32/); + + assert.throws(() => { + crypto.randomFill(buf, -10, function() {}); + }, /offset must be a uint32/); + + assert.throws(() => { + crypto.randomFillSync(buf, 1, 10); + }, /buffer too small/); + + assert.throws(() => { + crypto.randomFill(buf, 1, 10, function() {}); + }, /buffer too small/); + + assert.throws(() => { + crypto.randomFillSync(buf, 0, 12); + }, /buffer too small/); + + assert.throws(() => { + crypto.randomFill(buf, 0, 12, function() {}); + }, /buffer too small/); + + { + // Offset is too big + const offset = (-1 >>> 0) + 1; + assert.throws(() => { + crypto.randomFillSync(buf, offset, 10); + }, /offset must be a uint32/); + + assert.throws(() => { + crypto.randomFill(buf, offset, 10, function() {}); + }, /offset must be a uint32/); + } + } +} + // #5126, "FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() // length exceeds max acceptable value" assert.throws(function() { diff --git a/test/parallel/test-dgram-multicast-set-interface-lo.js b/test/parallel/test-dgram-multicast-set-interface-lo.js new file mode 100644 index 00000000000000..740b175d69be8a --- /dev/null +++ b/test/parallel/test-dgram-multicast-set-interface-lo.js @@ -0,0 +1,293 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const util = require('util'); + +if (common.inFreeBSDJail) { + common.skip('in a FreeBSD jail'); + return; +} + +// All SunOS systems must be able to pass this manual test before the +// following barrier can be removed: +// $ socat UDP-RECVFROM:12356,ip-add-membership=224.0.0.115:127.0.0.1,fork \ +// EXEC:hostname & +// $ echo hi |socat STDIO \ +// UDP4-DATAGRAM:224.0.0.115:12356,ip-multicast-if=127.0.0.1 + +if (common.isSunOS) { + common.skip('SunOs is not correctly delivering to loopback multicast.'); + return; +} + +const networkInterfaces = require('os').networkInterfaces(); +const Buffer = require('buffer').Buffer; +const fork = require('child_process').fork; +const MULTICASTS = { + IPv4: ['224.0.0.115', '224.0.0.116', '224.0.0.117'], + IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117'] +}; +const LOOPBACK = { IPv4: '127.0.0.1', IPv6: '::1' }; +const ANY = { IPv4: '0.0.0.0', IPv6: '::' }; +const FAM = 'IPv4'; + +// Windows wont bind on multicasts so its filtering is by port. +const PORTS = {}; +for (let i = 0; i < MULTICASTS[FAM].length; i++) { + PORTS[MULTICASTS[FAM][i]] = common.PORT + (common.isWindows ? i : 0); +} + +const UDP = { IPv4: 'udp4', IPv6: 'udp6' }; + +const TIMEOUT = common.platformTimeout(5000); +const NOW = Date.now(); +const TMPL = (tail) => `${NOW} - ${tail}`; + +// Take the first non-internal interface as the other interface to isolate +// from loopback. Ideally, this should check for whether or not this interface +// and the loopback have the MULTICAST flag. +const interfaceAddress = ((networkInterfaces) => { + for (const name in networkInterfaces) { + for (const localInterface of networkInterfaces[name]) { + if (!localInterface.internal && localInterface.family === FAM) { + let interfaceAddress = localInterface.address; + // On Windows, IPv6 would need: `%${localInterface.scopeid}` + if (FAM === 'IPv6') + interfaceAddress += `${interfaceAddress}%${name}`; + return interfaceAddress; + } + } + } +})(networkInterfaces); + +assert.ok(interfaceAddress); + +const messages = [ + { tail: 'First message to send', mcast: MULTICASTS[FAM][0], rcv: true }, + { tail: 'Second message to send', mcast: MULTICASTS[FAM][0], rcv: true }, + { tail: 'Third message to send', mcast: MULTICASTS[FAM][1], rcv: true, + newAddr: interfaceAddress }, + { tail: 'Fourth message to send', mcast: MULTICASTS[FAM][2] }, + { tail: 'Fifth message to send', mcast: MULTICASTS[FAM][1], rcv: true }, + { tail: 'Sixth message to send', mcast: MULTICASTS[FAM][2], rcv: true, + newAddr: LOOPBACK[FAM] } +]; + + +if (process.argv[2] !== 'child') { + const IFACES = [ANY[FAM], interfaceAddress, LOOPBACK[FAM]]; + const workers = {}; + const listeners = MULTICASTS[FAM].length * 2; + let listening = 0; + let dead = 0; + let i = 0; + let done = 0; + let timer = null; + // Exit the test if it doesn't succeed within the TIMEOUT. + timer = setTimeout(function() { + console.error('[PARENT] Responses were not received within %d ms.', + TIMEOUT); + console.error('[PARENT] Skip'); + + killChildren(workers); + common.skip('Check filter policy'); + + process.exit(1); + }, TIMEOUT); + + // Launch the child processes. + for (let i = 0; i < listeners; i++) { + const IFACE = IFACES[i % IFACES.length]; + const MULTICAST = MULTICASTS[FAM][i % MULTICASTS[FAM].length]; + + const messagesNeeded = messages.filter((m) => m.rcv && + m.mcast === MULTICAST) + .map((m) => TMPL(m.tail)); + const worker = fork(process.argv[1], + ['child', + IFACE, + MULTICAST, + messagesNeeded.length, + NOW]); + workers[worker.pid] = worker; + + worker.messagesReceived = []; + worker.messagesNeeded = messagesNeeded; + + // Handle the death of workers. + worker.on('exit', function(code, signal) { + // Don't consider this a true death if the worker has finished + // successfully or if the exit code is 0. + if (worker.isDone || code === 0) { + return; + } + + dead += 1; + console.error('[PARENT] Worker %d died. %d dead of %d', + worker.pid, + dead, + listeners); + + if (dead === listeners) { + console.error('[PARENT] All workers have died.'); + console.error('[PARENT] Fail'); + + killChildren(workers); + + process.exit(1); + } + }); + + worker.on('message', function(msg) { + if (msg.listening) { + listening += 1; + + if (listening === listeners) { + // All child process are listening, so start sending. + sendSocket.sendNext(); + } + } else if (msg.message) { + worker.messagesReceived.push(msg.message); + + if (worker.messagesReceived.length === worker.messagesNeeded.length) { + done += 1; + worker.isDone = true; + console.error('[PARENT] %d received %d messages total.', + worker.pid, + worker.messagesReceived.length); + } + + if (done === listeners) { + console.error('[PARENT] All workers have received the ' + + 'required number of ' + + 'messages. Will now compare.'); + + Object.keys(workers).forEach(function(pid) { + const worker = workers[pid]; + + let count = 0; + + worker.messagesReceived.forEach(function(buf) { + for (let i = 0; i < worker.messagesNeeded.length; ++i) { + if (buf.toString() === worker.messagesNeeded[i]) { + count++; + break; + } + } + }); + + console.error('[PARENT] %d received %d matching messages.', + worker.pid, + count); + + assert.strictEqual(count, worker.messagesNeeded.length, + 'A worker received ' + + 'an invalid multicast message'); + }); + + clearTimeout(timer); + console.error('[PARENT] Success'); + killChildren(workers); + } + } + }); + } + + const sendSocket = dgram.createSocket({ + type: UDP[FAM], + reuseAddr: true + }); + + // Don't bind the address explicitly when sending and start with + // the OSes default multicast interface selection. + sendSocket.bind(common.PORT, ANY[FAM]); + sendSocket.on('listening', function() { + console.error(`outgoing iface ${interfaceAddress}`); + }); + + sendSocket.on('close', function() { + console.error('[PARENT] sendSocket closed'); + }); + + sendSocket.sendNext = function() { + const msg = messages[i++]; + + if (!msg) { + sendSocket.close(); + return; + } + console.error(TMPL(NOW, msg.tail)); + const buf = Buffer.from(TMPL(msg.tail)); + if (msg.newAddr) { + console.error(`changing outgoing multicast ${msg.newAddr}`); + sendSocket.setMulticastInterface(msg.newAddr); + } + sendSocket.send( + buf, + 0, + buf.length, + PORTS[msg.mcast], + msg.mcast, + function(err) { + assert.ifError(err); + console.error('[PARENT] sent %s to %s:%s', + util.inspect(buf.toString()), + msg.mcast, PORTS[msg.mcast]); + + process.nextTick(sendSocket.sendNext); + } + ); + }; + + function killChildren(children) { + for (const i in children) + children[i].kill(); + } +} + +if (process.argv[2] === 'child') { + const IFACE = process.argv[3]; + const MULTICAST = process.argv[4]; + const NEEDEDMSGS = Number(process.argv[5]); + const SESSION = Number(process.argv[6]); + const receivedMessages = []; + + console.error(`pid ${process.pid} iface ${IFACE} MULTICAST ${MULTICAST}`); + const listenSocket = dgram.createSocket({ + type: UDP[FAM], + reuseAddr: true + }); + + listenSocket.on('message', function(buf, rinfo) { + // Examine udp messages only when they were sent by the parent. + if (!buf.toString().startsWith(SESSION)) return; + + console.error('[CHILD] %s received %s from %j', + process.pid, + util.inspect(buf.toString()), + rinfo); + + receivedMessages.push(buf); + + let closecb; + + if (receivedMessages.length === NEEDEDMSGS) { + listenSocket.close(); + closecb = () => process.exit(); + } + + process.send({ message: buf.toString() }, closecb); + }); + + + listenSocket.on('listening', function() { + listenSocket.addMembership(MULTICAST, IFACE); + process.send({ listening: true }); + }); + + if (common.isWindows) + listenSocket.bind(PORTS[MULTICAST], ANY[FAM]); + else + listenSocket.bind(common.PORT, MULTICAST); +} diff --git a/test/parallel/test-dgram-multicast-set-interface.js b/test/parallel/test-dgram-multicast-set-interface.js new file mode 100644 index 00000000000000..c065683f53c7fd --- /dev/null +++ b/test/parallel/test-dgram-multicast-set-interface.js @@ -0,0 +1,120 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +{ + const socket = dgram.createSocket('udp4'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Explicitly request default system selection + socket.setMulticastInterface('0.0.0.0'); + + socket.close(); + })); +} + +{ + const socket = dgram.createSocket('udp4'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + socket.close(common.mustCall(() => { + assert.throws(() => { socket.setMulticastInterface('0.0.0.0'); }, + /Not running/); + })); + })); +} + +{ + const socket = dgram.createSocket('udp4'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Try to set with an invalid interfaceAddress (wrong address class) + try { + socket.setMulticastInterface('::'); + throw new Error('Not detected.'); + } catch (e) { + console.error(`setMulticastInterface: wrong family error is: ${e}`); + } + + socket.close(); + })); +} + +{ + const socket = dgram.createSocket('udp4'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Try to set with an invalid interfaceAddress (wrong Type) + assert.throws(() => { + socket.setMulticastInterface(1); + }, /TypeError/); + + socket.close(); + })); +} + +{ + const socket = dgram.createSocket('udp4'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Try to set with an invalid interfaceAddress (non-unicast) + assert.throws(() => { + socket.setMulticastInterface('224.0.0.2'); + }, /Error/); + + socket.close(); + })); +} + +// If IPv6 is not supported, skip the rest of the test. However, don't call +// common.skip(), which calls process.exit() while there is outstanding +// common.mustCall() activity. +if (!common.hasIPv6) + return; + +{ + const socket = dgram.createSocket('udp6'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Try to set with an invalid interfaceAddress ('undefined') + assert.throws(() => { + socket.setMulticastInterface(String(undefined)); + }, /EINVAL/); + + socket.close(); + })); +} + +{ + const socket = dgram.createSocket('udp6'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Try to set with an invalid interfaceAddress ('') + assert.throws(() => { + socket.setMulticastInterface(''); + }, /EINVAL/); + + socket.close(); + })); +} + +{ + const socket = dgram.createSocket('udp6'); + + socket.bind(0); + socket.on('listening', common.mustCall(() => { + // Using lo0 for OsX, on all other OSes, an invalid Scope gets + // turned into #0 (default selection) which is also acceptable. + socket.setMulticastInterface('::%lo0'); + + socket.close(); + })); +} diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index f0995a75c05fdd..05fd2c522d807f 100644 --- a/test/parallel/test-domain-crypto.js +++ b/test/parallel/test-domain-crypto.js @@ -15,6 +15,8 @@ global.domain = require('domain'); // should not throw a 'TypeError: undefined is not a function' exception crypto.randomBytes(8); crypto.randomBytes(8, common.mustCall()); +const buf = Buffer.alloc(8); +crypto.randomFillSync(buf); crypto.pseudoRandomBytes(8); crypto.pseudoRandomBytes(8, common.mustCall()); crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.mustCall()); diff --git a/test/parallel/test-http-keepalive-override.js b/test/parallel/test-http-keepalive-override.js new file mode 100644 index 00000000000000..d25fc319747ad2 --- /dev/null +++ b/test/parallel/test-http-keepalive-override.js @@ -0,0 +1,67 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const http = require('http'); + +const server = http.createServer((req, res) => { + res.end('ok'); +}).listen(0, common.mustCall(() => { + const agent = http.Agent({ + keepAlive: true, + maxSockets: 5, + maxFreeSockets: 2 + }); + + const keepSocketAlive = agent.keepSocketAlive; + const reuseSocket = agent.reuseSocket; + + let called = 0; + let expectedSocket; + agent.keepSocketAlive = common.mustCall((socket) => { + assert(socket); + + called++; + if (called === 1) { + return false; + } else if (called === 2) { + expectedSocket = socket; + return keepSocketAlive.call(agent, socket); + } + + assert.strictEqual(socket, expectedSocket); + return false; + }, 3); + + agent.reuseSocket = common.mustCall((socket, req) => { + assert.strictEqual(socket, expectedSocket); + assert(req); + + return reuseSocket.call(agent, socket, req); + }, 1); + + function req(callback) { + http.request({ + method: 'GET', + path: '/', + agent, + port: server.address().port + }, common.mustCall((res) => { + res.resume(); + res.once('end', common.mustCall(() => { + setImmediate(callback); + })); + })).end(); + } + + // Should destroy socket instead of keeping it alive + req(common.mustCall(() => { + // Should keep socket alive + req(common.mustCall(() => { + // Should reuse the socket + req(common.mustCall(() => { + server.close(); + })); + })); + })); +})); diff --git a/test/parallel/test-icu-punycode.js b/test/parallel/test-icu-punycode.js index cf83ac66206806..7abcae461774c0 100644 --- a/test/parallel/test-icu-punycode.js +++ b/test/parallel/test-icu-punycode.js @@ -1,70 +1,46 @@ 'use strict'; - const common = require('../common'); -const icu = getPunycode(); + +if (!common.hasIntl) + common.skip('missing Intl'); + +const icu = process.binding('icu'); const assert = require('assert'); -function getPunycode() { - try { - return process.binding('icu'); - } catch (err) { - return undefined; +const tests = require('../fixtures/url-idna.js'); +const wptToASCIITests = require('../fixtures/url-toascii.js'); + +{ + for (const [i, { ascii, unicode }] of tests.entries()) { + assert.strictEqual(ascii, icu.toASCII(unicode), `toASCII(${i + 1})`); + assert.strictEqual(unicode, icu.toUnicode(ascii), `toUnicode(${i + 1})`); + assert.strictEqual(ascii, icu.toASCII(icu.toUnicode(ascii)), + `toASCII(toUnicode(${i + 1}))`); + assert.strictEqual(unicode, icu.toUnicode(icu.toASCII(unicode)), + `toUnicode(toASCII(${i + 1}))`); } } -if (!icu) - common.skip('icu punycode tests because ICU is not present.'); +{ + const errMessage = /^Error: Cannot convert name to ASCII$/; -// Credit for list: http://www.i18nguy.com/markup/idna-examples.html -const tests = [ - 'افغانستا.icom.museum', - 'الجزائر.icom.museum', - 'österreich.icom.museum', - 'বাংলাদেশ.icom.museum', - 'беларусь.icom.museum', - 'belgië.icom.museum', - 'българия.icom.museum', - 'تشادر.icom.museum', - '中国.icom.museum', - 'القمر.icom.museum', - 'κυπρος.icom.museum', - 'českárepublika.icom.museum', - 'مصر.icom.museum', - 'ελλάδα.icom.museum', - 'magyarország.icom.museum', - 'ísland.icom.museum', - 'भारत.icom.museum', - 'ايران.icom.museum', - 'éire.icom.museum', - 'איקו״ם.ישראל.museum', - '日本.icom.museum', - 'الأردن.icom.museum', - 'қазақстан.icom.museum', - '한국.icom.museum', - 'кыргызстан.icom.museum', - 'ລາວ.icom.museum', - 'لبنان.icom.museum', - 'македонија.icom.museum', - 'موريتانيا.icom.museum', - 'méxico.icom.museum', - 'монголулс.icom.museum', - 'المغرب.icom.museum', - 'नेपाल.icom.museum', - 'عمان.icom.museum', - 'قطر.icom.museum', - 'românia.icom.museum', - 'россия.иком.museum', - 'србијаицрнагора.иком.museum', - 'இலங்கை.icom.museum', - 'españa.icom.museum', - 'ไทย.icom.museum', - 'تونس.icom.museum', - 'türkiye.icom.museum', - 'украина.icom.museum', - 'việtnam.icom.museum' -]; - -// Testing the roundtrip -tests.forEach((i) => { - assert.strictEqual(i, icu.toUnicode(icu.toASCII(i))); -}); + for (const [i, test] of wptToASCIITests.entries()) { + if (typeof test === 'string') + continue; // skip comments + const { comment, input, output } = test; + let caseComment = `case ${i + 1}`; + if (comment) + caseComment += ` (${comment})`; + if (output === null) { + assert.throws(() => icu.toASCII(input), + errMessage, `ToASCII ${caseComment}`); + assert.doesNotThrow(() => icu.toASCII(input, true), + `ToASCII ${caseComment} in lenient mode`); + } else { + assert.strictEqual(icu.toASCII(input), output, `ToASCII ${caseComment}`); + assert.strictEqual(icu.toASCII(input, true), output, + `ToASCII ${caseComment} in lenient mode`); + } + assert.doesNotThrow(() => icu.toUnicode(input), `ToUnicode ${caseComment}`); + } +} diff --git a/test/parallel/test-intl-v8BreakIterator.js b/test/parallel/test-intl-v8BreakIterator.js index 03e0712ba3ece2..7ccdb70f141a8b 100644 --- a/test/parallel/test-intl-v8BreakIterator.js +++ b/test/parallel/test-intl-v8BreakIterator.js @@ -2,8 +2,9 @@ const common = require('../common'); const assert = require('assert'); -if (global.Intl === undefined || Intl.v8BreakIterator === undefined) +if (!common.hasIntl || Intl.v8BreakIterator === undefined) { common.skip('no Intl'); +} try { new Intl.v8BreakIterator(); diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index a5b76538a2e722..907f56f03ac83f 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -8,9 +8,6 @@ if (enablei18n === undefined) { enablei18n = 0; } -// is the Intl object present? -const haveIntl = (global.Intl !== undefined); - // Returns true if no specific locale ids were configured (i.e. "all") // Else, returns true if loc is in the configured list // Else, returns false @@ -19,7 +16,7 @@ function haveLocale(loc) { return locs.includes(loc); } -if (!haveIntl) { +if (!common.hasIntl) { const erMsg = `"Intl" object is NOT present but v8_enable_i18n_support is ${enablei18n}`; assert.strictEqual(enablei18n, 0, erMsg); diff --git a/test/parallel/test-module-builtin.js b/test/parallel/test-module-builtin.js new file mode 100644 index 00000000000000..3897d71ecf4405 --- /dev/null +++ b/test/parallel/test-module-builtin.js @@ -0,0 +1,14 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const { builtinModules } = require('module'); + +// Includes modules in lib/ (even deprecated ones) +assert(builtinModules.includes('http')); +assert(builtinModules.includes('sys')); + +// Does not include internal modules +assert.deepStrictEqual( + builtinModules.filter((mod) => mod.startsWith('internal/')), + [] +); diff --git a/test/parallel/test-net-pingpong.js b/test/parallel/test-net-pingpong.js index b2f756c1ba7147..1bcf5992124342 100644 --- a/test/parallel/test-net-pingpong.js +++ b/test/parallel/test-net-pingpong.js @@ -16,10 +16,13 @@ function pingPongTest(port, host) { function onSocket(socket) { assert.strictEqual(socket.server, server); - server.getConnections(common.mustCall(function(err, connections) { - assert.ifError(err); - assert.strictEqual(connections, 1); - })); + assert.strictEqual( + server, + server.getConnections(common.mustCall(function(err, connections) { + assert.ifError(err); + assert.strictEqual(connections, 1); + })) + ); socket.setNoDelay(); socket.timeout = 0; diff --git a/test/parallel/test-openssl-ca-options.js b/test/parallel/test-openssl-ca-options.js new file mode 100644 index 00000000000000..b51b0ecf698035 --- /dev/null +++ b/test/parallel/test-openssl-ca-options.js @@ -0,0 +1,30 @@ +'use strict'; +// This test checks the usage of --use-bundled-ca and --use-openssl-ca arguments +// to verify that both are not used at the same time. +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const os = require('os'); +const childProcess = require('child_process'); +const result = childProcess.spawnSync( + process.execPath, + [ '--use-bundled-ca', '--use-openssl-ca', '-p', 'process.version' ], + { encoding: 'utf8' } +); + +assert.strictEqual(result.stderr, `${process.execPath +}: either --use-openssl-ca or --use-bundled-ca can be used, not both${os.EOL}` +); +assert.strictEqual(result.status, 9); + +const useBundledCA = childProcess.spawnSync(process.execPath, [ + '--use-bundled-ca', + '-p', 'process.version']); +assert.strictEqual(useBundledCA.status, 0); + +const useOpenSSLCA = childProcess.spawnSync(process.execPath, [ + '--use-openssl-ca', + '-p', 'process.version']); +assert.strictEqual(useOpenSSLCA.status, 0); diff --git a/test/parallel/test-process-config.js b/test/parallel/test-process-config.js index 1700eed9640b03..9fd869dceba03c 100644 --- a/test/parallel/test-process-config.js +++ b/test/parallel/test-process-config.js @@ -24,7 +24,9 @@ if (!fs.existsSync(configPath)) { let config = fs.readFileSync(configPath, 'utf8'); // Clean up comment at the first line. -config = config.split('\n').slice(1).join('\n').replace(/'/g, '"'); +config = config.split('\n').slice(1).join('\n'); +config = config.replace(/"/g, '\\"'); +config = config.replace(/'/g, '"'); config = JSON.parse(config, function(key, value) { if (value === 'true') return true; if (value === 'false') return false; diff --git a/test/parallel/test-process-ppid.js b/test/parallel/test-process-ppid.js new file mode 100644 index 00000000000000..d78ef3a2dd9ae7 --- /dev/null +++ b/test/parallel/test-process-ppid.js @@ -0,0 +1,16 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const cp = require('child_process'); + +if (process.argv[2] === 'child') { + // The following console.log() call is part of the test's functionality. + console.log(process.ppid); +} else { + const child = cp.spawnSync(process.execPath, [__filename, 'child']); + + assert.strictEqual(child.status, 0); + assert.strictEqual(child.signal, null); + assert.strictEqual(+child.stdout.toString().trim(), process.pid); + assert.strictEqual(child.stderr.toString().trim(), ''); +} diff --git a/test/parallel/test-process-versions.js b/test/parallel/test-process-versions.js index 27311f7eda84e3..b0377afd4a1899 100644 --- a/test/parallel/test-process-versions.js +++ b/test/parallel/test-process-versions.js @@ -9,7 +9,7 @@ if (common.hasCrypto) { expected_keys.push('openssl'); } -if (typeof Intl !== 'undefined') { +if (common.hasIntl) { expected_keys.push('icu'); } diff --git a/test/parallel/test-promises-unhandled-proxy-rejections.js b/test/parallel/test-promises-unhandled-proxy-rejections.js new file mode 100644 index 00000000000000..9c3f364de2e53b --- /dev/null +++ b/test/parallel/test-promises-unhandled-proxy-rejections.js @@ -0,0 +1,31 @@ +'use strict'; +const common = require('../common'); + +const expectedPromiseWarning = 'Unhandled promise rejection (rejection id: ' + + '1): [object Object]'; + +function throwErr() { + throw new Error('Error from proxy'); +} + +const thorny = new Proxy({}, { + getPrototypeOf: throwErr, + setPrototypeOf: throwErr, + isExtensible: throwErr, + preventExtensions: throwErr, + getOwnPropertyDescriptor: throwErr, + defineProperty: throwErr, + has: throwErr, + get: throwErr, + set: throwErr, + deleteProperty: throwErr, + ownKeys: throwErr, + apply: throwErr, + construct: throwErr +}); + +common.expectWarning('UnhandledPromiseRejectionWarning', + expectedPromiseWarning); + +// ensure this doesn't crash +Promise.reject(thorny); diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 1179259c79d026..d29d816a425976 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -212,6 +212,56 @@ testMe.complete('require(\'n', common.mustCall(function(error, data) { })); } +// Test tab completion for require() relative to the current directory +{ + putIn.run(['.clear']); + + const cwd = process.cwd(); + process.chdir(__dirname); + + ['require(\'.', 'require(".'].forEach((input) => { + testMe.complete(input, common.mustCall((err, data) => { + assert.strictEqual(err, null); + assert.strictEqual(data.length, 2); + assert.strictEqual(data[1], '.'); + assert.strictEqual(data[0].length, 2); + assert.ok(data[0].includes('./')); + assert.ok(data[0].includes('../')); + })); + }); + + ['require(\'..', 'require("..'].forEach((input) => { + testMe.complete(input, common.mustCall((err, data) => { + assert.strictEqual(err, null); + assert.deepStrictEqual(data, [['../'], '..']); + })); + }); + + ['./', './test-'].forEach((path) => { + [`require('${path}`, `require("${path}`].forEach((input) => { + testMe.complete(input, common.mustCall((err, data) => { + assert.strictEqual(err, null); + assert.strictEqual(data.length, 2); + assert.strictEqual(data[1], path); + assert.ok(data[0].includes('./test-repl-tab-complete')); + })); + }); + }); + + ['../parallel/', '../parallel/test-'].forEach((path) => { + [`require('${path}`, `require("${path}`].forEach((input) => { + testMe.complete(input, common.mustCall((err, data) => { + assert.strictEqual(err, null); + assert.strictEqual(data.length, 2); + assert.strictEqual(data[1], path); + assert.ok(data[0].includes('../parallel/test-repl-tab-complete')); + })); + }); + }); + + process.chdir(cwd); +} + // Make sure tab completion works on context properties putIn.run(['.clear']); @@ -294,7 +344,7 @@ const testNonGlobal = repl.start({ const builtins = [['Infinity', '', 'Int16Array', 'Int32Array', 'Int8Array'], 'I']; -if (typeof Intl === 'object') { +if (common.hasIntl) { builtins[0].push('Intl'); } testNonGlobal.complete('I', common.mustCall((error, data) => { diff --git a/test/parallel/test-socket-write-after-fin.js b/test/parallel/test-socket-write-after-fin.js index c8ff56871734af..2551d3f54f651f 100644 --- a/test/parallel/test-socket-write-after-fin.js +++ b/test/parallel/test-socket-write-after-fin.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); const net = require('net'); -const expected = 'hello1hello2hello3\nTHUNDERMUSCLE!'; +const expected = 'hello1hello2hello3\nbye'; const server = net.createServer({ allowHalfOpen: true @@ -35,5 +35,6 @@ server.listen(0, common.mustCall(function() { sock.write('hello1'); sock.write('hello2'); sock.write('hello3\n'); - sock.end('THUNDERMUSCLE!'); + assert.strictEqual(sock.end('bye'), sock); + })); diff --git a/test/parallel/test-url-domain-ascii-unicode.js b/test/parallel/test-url-domain-ascii-unicode.js new file mode 100644 index 00000000000000..49259a7ab0f4c4 --- /dev/null +++ b/test/parallel/test-url-domain-ascii-unicode.js @@ -0,0 +1,31 @@ +'use strict'; + +const common = require('../common'); +if (!common.hasIntl) + common.skip('missing Intl'); + +const strictEqual = require('assert').strictEqual; +const url = require('url'); + +const domainToASCII = url.domainToASCII; +const domainToUnicode = url.domainToUnicode; + +const domainWithASCII = [ + ['ıíd', 'xn--d-iga7r'], + ['يٴ', 'xn--mhb8f'], + ['www.ϧƽəʐ.com', 'www.xn--cja62apfr6c.com'], + ['новини.com', 'xn--b1amarcd.com'], + ['名がドメイン.com', 'xn--v8jxj3d1dzdz08w.com'], + ['افغانستا.icom.museum', 'xn--mgbaal8b0b9b2b.icom.museum'], + ['الجزائر.icom.fake', 'xn--lgbbat1ad8j.icom.fake'], + ['भारत.org', 'xn--h2brj9c.org'] +]; + +domainWithASCII.forEach((pair) => { + const domain = pair[0]; + const ascii = pair[1]; + const domainConvertedToASCII = domainToASCII(domain); + strictEqual(domainConvertedToASCII, ascii); + const asciiConvertedToUnicode = domainToUnicode(ascii); + strictEqual(asciiConvertedToUnicode, domain); +}); diff --git a/test/parallel/test-whatwg-url-constructor.js b/test/parallel/test-whatwg-url-constructor.js new file mode 100644 index 00000000000000..16bcac74cc6bcd --- /dev/null +++ b/test/parallel/test-whatwg-url-constructor.js @@ -0,0 +1,143 @@ +'use strict'; +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const fixtures = require('../common/fixtures'); +const { URL, URLSearchParams } = require('url'); +const { test, assert_equals, assert_true, assert_throws } = + require('../common/wpt'); + +const request = { + response: require(fixtures.path('url-tests')) +}; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-constructor.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +function runURLConstructorTests() { + // var setup = async_test("Loading data…") + // setup.step(function() { + // var request = new XMLHttpRequest() + // request.open("GET", "urltestdata.json") + // request.send() + // request.responseType = "json" + // request.onload = setup.step_func(function() { + runURLTests(request.response) + // setup.done() + // }) + // }) +} + +function bURL(url, base) { + return new URL(url, base || "about:blank") +} + + +function runURLTests(urltests) { + for(var i = 0, l = urltests.length; i < l; i++) { + var expected = urltests[i] + if (typeof expected === "string") continue // skip comments + + test(function() { + if (expected.failure) { + assert_throws(new TypeError(), function() { + bURL(expected.input, expected.base) + }) + return + } + + var url = bURL(expected.input, expected.base) + assert_equals(url.href, expected.href, "href") + assert_equals(url.protocol, expected.protocol, "protocol") + assert_equals(url.username, expected.username, "username") + assert_equals(url.password, expected.password, "password") + assert_equals(url.host, expected.host, "host") + assert_equals(url.hostname, expected.hostname, "hostname") + assert_equals(url.port, expected.port, "port") + assert_equals(url.pathname, expected.pathname, "pathname") + assert_equals(url.search, expected.search, "search") + if ("searchParams" in expected) { + assert_true("searchParams" in url) + assert_equals(url.searchParams.toString(), expected.searchParams, "searchParams") + } + assert_equals(url.hash, expected.hash, "hash") + }, "Parsing: <" + expected.input + "> against <" + expected.base + ">") + } +} + +function runURLSearchParamTests() { + test(function() { + var url = bURL('http://example.org/?a=b') + assert_true("searchParams" in url) + var searchParams = url.searchParams + assert_true(url.searchParams === searchParams, 'Object identity should hold.') + }, 'URL.searchParams getter') + + test(function() { + var url = bURL('http://example.org/?a=b') + assert_true("searchParams" in url) + var searchParams = url.searchParams + assert_equals(searchParams.toString(), 'a=b') + + searchParams.set('a', 'b') + assert_equals(url.searchParams.toString(), 'a=b') + assert_equals(url.search, '?a=b') + url.search = '' + assert_equals(url.searchParams.toString(), '') + assert_equals(url.search, '') + assert_equals(searchParams.toString(), '') + }, 'URL.searchParams updating, clearing') + + test(function() { + 'use strict' + var urlString = 'http://example.org' + var url = bURL(urlString) + assert_throws(TypeError(), function() { url.searchParams = new URLSearchParams(urlString) }) + }, 'URL.searchParams setter, invalid values') + + test(function() { + var url = bURL('http://example.org/file?a=b&c=d') + assert_true("searchParams" in url) + var searchParams = url.searchParams + assert_equals(url.search, '?a=b&c=d') + assert_equals(searchParams.toString(), 'a=b&c=d') + + // Test that setting 'search' propagates to the URL object's query object. + url.search = 'e=f&g=h' + assert_equals(url.search, '?e=f&g=h') + assert_equals(searchParams.toString(), 'e=f&g=h') + + // ..and same but with a leading '?'. + url.search = '?e=f&g=h' + assert_equals(url.search, '?e=f&g=h') + assert_equals(searchParams.toString(), 'e=f&g=h') + + // And in the other direction, altering searchParams propagates + // back to 'search'. + searchParams.append('i', ' j ') + assert_equals(url.search, '?e=f&g=h&i=+j+') + assert_equals(url.searchParams.toString(), 'e=f&g=h&i=+j+') + assert_equals(searchParams.get('i'), ' j ') + + searchParams.set('e', 'updated') + assert_equals(url.search, '?e=updated&g=h&i=+j+') + assert_equals(searchParams.get('e'), 'updated') + + var url2 = bURL('http://example.org/file??a=b&c=d') + assert_equals(url2.search, '??a=b&c=d') + assert_equals(url2.searchParams.toString(), '%3Fa=b&c=d') + + url2.href = 'http://example.org/file??a=b' + assert_equals(url2.search, '??a=b') + assert_equals(url2.searchParams.toString(), '%3Fa=b') + }, 'URL.searchParams and URL.search setters, update propagation') +} +runURLSearchParamTests() +runURLConstructorTests() +/* eslint-enable */ diff --git a/test/parallel/test-whatwg-url-domainto.js b/test/parallel/test-whatwg-url-domainto.js new file mode 100644 index 00000000000000..f8029d8b5d66a4 --- /dev/null +++ b/test/parallel/test-whatwg-url-domainto.js @@ -0,0 +1,51 @@ +'use strict'; +const common = require('../common'); + +if (!common.hasIntl) + common.skip('missing Intl'); + +const assert = require('assert'); +const { domainToASCII, domainToUnicode } = require('url'); + +// Tests below are not from WPT. +const tests = require('../fixtures/url-idna.js'); +const wptToASCIITests = require('../fixtures/url-toascii.js'); + +{ + assert.throws(() => domainToASCII(), /^TypeError: The "domain" argument must be specified$/); + assert.throws(() => domainToUnicode(), /^TypeError: The "domain" argument must be specified$/); + assert.strictEqual(domainToASCII(undefined), 'undefined'); + assert.strictEqual(domainToUnicode(undefined), 'undefined'); +} + +{ + for (const [i, { ascii, unicode }] of tests.entries()) { + assert.strictEqual(ascii, domainToASCII(unicode), + `domainToASCII(${i + 1})`); + assert.strictEqual(unicode, domainToUnicode(ascii), + `domainToUnicode(${i + 1})`); + assert.strictEqual(ascii, domainToASCII(domainToUnicode(ascii)), + `domainToASCII(domainToUnicode(${i + 1}))`); + assert.strictEqual(unicode, domainToUnicode(domainToASCII(unicode)), + `domainToUnicode(domainToASCII(${i + 1}))`); + } +} + +{ + for (const [i, test] of wptToASCIITests.entries()) { + if (typeof test === 'string') + continue; // skip comments + const { comment, input, output } = test; + let caseComment = `Case ${i + 1}`; + if (comment) + caseComment += ` (${comment})`; + if (output === null) { + assert.strictEqual(domainToASCII(input), '', caseComment); + assert.strictEqual(domainToUnicode(input), '', caseComment); + } else { + assert.strictEqual(domainToASCII(input), output, caseComment); + const roundtripped = domainToASCII(domainToUnicode(input)); + assert.strictEqual(roundtripped, output, caseComment); + } + } +} diff --git a/test/parallel/test-whatwg-url-historical.js b/test/parallel/test-whatwg-url-historical.js new file mode 100644 index 00000000000000..466949cd322d37 --- /dev/null +++ b/test/parallel/test-whatwg-url-historical.js @@ -0,0 +1,46 @@ +'use strict'; +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const URL = require('url').URL; +const { test, assert_equals, assert_throws } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/historical.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +// var objects = [ +// [function() { return window.location }, "location object"], +// [function() { return document.createElement("a") }, "a element"], +// [function() { return document.createElement("area") }, "area element"], +// ]; + +// objects.forEach(function(o) { +// test(function() { +// var object = o[0](); +// assert_false("searchParams" in object, +// o[1] + " should not have a searchParams attribute"); +// }, "searchParams on " + o[1]); +// }); + +test(function() { + var url = new URL("./foo", "http://www.example.org"); + assert_equals(url.href, "http://www.example.org/foo"); + assert_throws(new TypeError(), function() { + url.href = "./bar"; + }); +}, "Setting URL's href attribute and base URLs"); + +test(function() { + assert_equals(URL.domainToASCII, undefined); +}, "URL.domainToASCII should be undefined"); + +test(function() { + assert_equals(URL.domainToUnicode, undefined); +}, "URL.domainToUnicode should be undefined"); +/* eslint-enable */ diff --git a/test/parallel/test-whatwg-url-inspect.js b/test/parallel/test-whatwg-url-inspect.js new file mode 100644 index 00000000000000..5758b39b8af83d --- /dev/null +++ b/test/parallel/test-whatwg-url-inspect.js @@ -0,0 +1,66 @@ +'use strict'; + +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const util = require('util'); +const URL = require('url').URL; +const assert = require('assert'); + +// Tests below are not from WPT. +const url = new URL('https://username:password@host.name:8080/path/name/?que=ry#hash'); + +assert.strictEqual( + util.inspect(url), + `URL { + href: 'https://username:password@host.name:8080/path/name/?que=ry#hash', + origin: 'https://host.name:8080', + protocol: 'https:', + username: 'username', + password: 'password', + host: 'host.name:8080', + hostname: 'host.name', + port: '8080', + pathname: '/path/name/', + search: '?que=ry', + searchParams: URLSearchParams { 'que' => 'ry' }, + hash: '#hash' }`); + +assert.strictEqual( + util.inspect(url, { showHidden: true }), + `URL { + href: 'https://username:password@host.name:8080/path/name/?que=ry#hash', + origin: 'https://host.name:8080', + protocol: 'https:', + username: 'username', + password: 'password', + host: 'host.name:8080', + hostname: 'host.name', + port: '8080', + pathname: '/path/name/', + search: '?que=ry', + searchParams: URLSearchParams { 'que' => 'ry' }, + hash: '#hash', + cannotBeBase: false, + special: true, + [Symbol(context)]:\x20 + URLContext { + flags: 2032, + scheme: 'https:', + username: 'username', + password: 'password', + host: 'host.name', + port: 8080, + path: [ 'path', 'name', '', [length]: 3 ], + query: 'que=ry', + fragment: 'hash' } }`); + +assert.strictEqual( + util.inspect({ a: url }, { depth: 0 }), + '{ a: [Object] }'); + +class MyURL extends URL {} +assert(util.inspect(new MyURL(url.href)).startsWith('MyURL {')); diff --git a/test/parallel/test-whatwg-url-origin.js b/test/parallel/test-whatwg-url-origin.js new file mode 100644 index 00000000000000..8a5ad6d3154f8f --- /dev/null +++ b/test/parallel/test-whatwg-url-origin.js @@ -0,0 +1,52 @@ +'use strict'; +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const fixtures = require('../common/fixtures'); +const URL = require('url').URL; +const { test, assert_equals } = require('../common/wpt'); + +const request = { + response: require(fixtures.path('url-tests')) +}; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-origin.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +function runURLOriginTests() { + // var setup = async_test("Loading data…") + // setup.step(function() { + // var request = new XMLHttpRequest() + // request.open("GET", "urltestdata.json") + // request.send() + // request.responseType = "json" + // request.onload = setup.step_func(function() { + runURLTests(request.response) + // setup.done() + // }) + // }) +} + +function bURL(url, base) { + return new URL(url, base || "about:blank") +} + +function runURLTests(urltests) { + for(var i = 0, l = urltests.length; i < l; i++) { + var expected = urltests[i] + if (typeof expected === "string" || !("origin" in expected)) continue + test(function() { + var url = bURL(expected.input, expected.base) + assert_equals(url.origin, expected.origin, "origin") + }, "Origin parsing: <" + expected.input + "> against <" + expected.base + ">") + } +} + +runURLOriginTests() +/* eslint-enable */ diff --git a/test/parallel/test-whatwg-url-parsing.js b/test/parallel/test-whatwg-url-parsing.js new file mode 100644 index 00000000000000..104f25ff4380bb --- /dev/null +++ b/test/parallel/test-whatwg-url-parsing.js @@ -0,0 +1,62 @@ +'use strict'; + +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const URL = require('url').URL; +const assert = require('assert'); +const fixtures = require('../common/fixtures'); + +// Tests below are not from WPT. +const tests = require(fixtures.path('url-tests')); +const failureTests = tests.filter((test) => test.failure).concat([ + { input: '' }, + { input: 'test' }, + { input: undefined }, + { input: 0 }, + { input: true }, + { input: false }, + { input: null }, + { input: new Date() }, + { input: new RegExp() }, + { input: () => {} } +]); + +const expectedError = (err) => /^TypeError: Invalid URL: /.test(err.toString()); + +for (const test of failureTests) { + assert.throws( + () => new URL(test.input, test.base), + (error) => { + if (!expectedError(error)) + return false; + + // The input could be processed, so we don't do strict matching here + const match = (`${error}`).match(/Invalid URL: (.*)$/); + if (!match) { + return false; + } + return error.input === match[1]; + }); +} + +const additional_tests = + require(fixtures.path('url-tests-additional.js')); + +for (const test of additional_tests) { + const url = new URL(test.url); + if (test.href) assert.strictEqual(url.href, test.href); + if (test.origin) assert.strictEqual(url.origin, test.origin); + if (test.protocol) assert.strictEqual(url.protocol, test.protocol); + if (test.username) assert.strictEqual(url.username, test.username); + if (test.password) assert.strictEqual(url.password, test.password); + if (test.hostname) assert.strictEqual(url.hostname, test.hostname); + if (test.host) assert.strictEqual(url.host, test.host); + if (test.port !== undefined) assert.strictEqual(url.port, test.port); + if (test.pathname) assert.strictEqual(url.pathname, test.pathname); + if (test.search) assert.strictEqual(url.search, test.search); + if (test.hash) assert.strictEqual(url.hash, test.hash); +} diff --git a/test/parallel/test-whatwg-url-properties.js b/test/parallel/test-whatwg-url-properties.js new file mode 100644 index 00000000000000..d6caae511aed47 --- /dev/null +++ b/test/parallel/test-whatwg-url-properties.js @@ -0,0 +1,162 @@ +// Flags: --expose-internals +'use strict'; + +require('../common'); +const URL = require('url').URL; +const assert = require('assert'); +const urlToOptions = require('internal/url').urlToOptions; + +// Tests below are not from WPT. +const url = new URL('http://user:pass@foo.bar.com:21/aaa/zzz?l=24#test'); +const oldParams = url.searchParams; // for test of [SameObject] + +// To retrieve enumerable but not necessarily own properties, +// we need to use the for-in loop. +const props = []; +for (const prop in url) { + props.push(prop); +} + +// See: https://url.spec.whatwg.org/#api +// https://heycam.github.io/webidl/#es-attributes +// https://heycam.github.io/webidl/#es-stringifier +const expected = ['toString', + 'href', 'origin', 'protocol', + 'username', 'password', 'host', 'hostname', 'port', + 'pathname', 'search', 'searchParams', 'hash', 'toJSON']; + +assert.deepStrictEqual(props, expected); + +// href is writable (not readonly) and is stringifier +assert.strictEqual(url.toString(), url.href); +url.href = 'http://user:pass@foo.bar.com:21/aaa/zzz?l=25#test'; +assert.strictEqual(url.href, + 'http://user:pass@foo.bar.com:21/aaa/zzz?l=25#test'); +assert.strictEqual(url.toString(), url.href); +// Return true because it's configurable, but because the properties +// are defined on the prototype per the spec, the deletion has no effect +assert.strictEqual((delete url.href), true); +assert.strictEqual(url.href, + 'http://user:pass@foo.bar.com:21/aaa/zzz?l=25#test'); +assert.strictEqual(url.searchParams, oldParams); // [SameObject] + +// searchParams is readonly. Under strict mode setting a +// non-writable property should throw. +// Note: this error message is subject to change in V8 updates +assert.throws( + () => url.origin = 'http://foo.bar.com:22', + /^TypeError: Cannot set property origin of \[object URL\] which has only a getter$/ +); +assert.strictEqual(url.origin, 'http://foo.bar.com:21'); +assert.strictEqual(url.toString(), + 'http://user:pass@foo.bar.com:21/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.origin), true); +assert.strictEqual(url.origin, 'http://foo.bar.com:21'); + +// The following properties should be writable (not readonly) +url.protocol = 'https:'; +assert.strictEqual(url.protocol, 'https:'); +assert.strictEqual(url.toString(), + 'https://user:pass@foo.bar.com:21/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.protocol), true); +assert.strictEqual(url.protocol, 'https:'); + +url.username = 'user2'; +assert.strictEqual(url.username, 'user2'); +assert.strictEqual(url.toString(), + 'https://user2:pass@foo.bar.com:21/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.username), true); +assert.strictEqual(url.username, 'user2'); + +url.password = 'pass2'; +assert.strictEqual(url.password, 'pass2'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.com:21/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.password), true); +assert.strictEqual(url.password, 'pass2'); + +url.host = 'foo.bar.net:22'; +assert.strictEqual(url.host, 'foo.bar.net:22'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.net:22/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.host), true); +assert.strictEqual(url.host, 'foo.bar.net:22'); + +url.hostname = 'foo.bar.org'; +assert.strictEqual(url.hostname, 'foo.bar.org'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.org:22/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.hostname), true); +assert.strictEqual(url.hostname, 'foo.bar.org'); + +url.port = '23'; +assert.strictEqual(url.port, '23'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.org:23/aaa/zzz?l=25#test'); +assert.strictEqual((delete url.port), true); +assert.strictEqual(url.port, '23'); + +url.pathname = '/aaa/bbb'; +assert.strictEqual(url.pathname, '/aaa/bbb'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.org:23/aaa/bbb?l=25#test'); +assert.strictEqual((delete url.pathname), true); +assert.strictEqual(url.pathname, '/aaa/bbb'); + +url.search = '?k=99'; +assert.strictEqual(url.search, '?k=99'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.org:23/aaa/bbb?k=99#test'); +assert.strictEqual((delete url.search), true); +assert.strictEqual(url.search, '?k=99'); + +url.hash = '#abcd'; +assert.strictEqual(url.hash, '#abcd'); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.org:23/aaa/bbb?k=99#abcd'); +assert.strictEqual((delete url.hash), true); +assert.strictEqual(url.hash, '#abcd'); + +// searchParams is readonly. Under strict mode setting a +// non-writable property should throw. +// Note: this error message is subject to change in V8 updates +assert.throws( + () => url.searchParams = '?k=88', + /^TypeError: Cannot set property searchParams of \[object URL\] which has only a getter$/ +); +assert.strictEqual(url.searchParams, oldParams); +assert.strictEqual(url.toString(), + 'https://user2:pass2@foo.bar.org:23/aaa/bbb?k=99#abcd'); +assert.strictEqual((delete url.searchParams), true); +assert.strictEqual(url.searchParams, oldParams); + +// Test urlToOptions +{ + const opts = + urlToOptions(new URL('http://user:pass@foo.bar.com:21/aaa/zzz?l=24#test')); + assert.strictEqual(opts instanceof URL, false); + assert.strictEqual(opts.protocol, 'http:'); + assert.strictEqual(opts.auth, 'user:pass'); + assert.strictEqual(opts.hostname, 'foo.bar.com'); + assert.strictEqual(opts.port, 21); + assert.strictEqual(opts.path, '/aaa/zzz?l=24'); + assert.strictEqual(opts.pathname, '/aaa/zzz'); + assert.strictEqual(opts.search, '?l=24'); + assert.strictEqual(opts.hash, '#test'); +} + +// Test special origins +[ + { expected: 'https://whatwg.org', + url: 'blob:https://whatwg.org/d0360e2f-caee-469f-9a2f-87d5b0456f6f' }, + { expected: 'ftp://example.org', url: 'ftp://example.org/foo' }, + { expected: 'gopher://gopher.quux.org', url: 'gopher://gopher.quux.org/1/' }, + { expected: 'http://example.org', url: 'http://example.org/foo' }, + { expected: 'https://example.org', url: 'https://example.org/foo' }, + { expected: 'ws://example.org', url: 'ws://example.org/foo' }, + { expected: 'wss://example.org', url: 'wss://example.org/foo' }, + { expected: 'null', url: 'file:///tmp/mock/path' }, + { expected: 'null', url: 'npm://nodejs/rules' } +].forEach((test) => { + assert.strictEqual(new URL(test.url).origin, test.expected); +}); diff --git a/test/parallel/test-whatwg-url-searchparams-append.js b/test/parallel/test-whatwg-url-searchparams-append.js new file mode 100644 index 00000000000000..6571f570588339 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-append.js @@ -0,0 +1,73 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { test, assert_equals, assert_true } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-append.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams(); + params.append('a', 'b'); + assert_equals(params + '', 'a=b'); + params.append('a', 'b'); + assert_equals(params + '', 'a=b&a=b'); + params.append('a', 'c'); + assert_equals(params + '', 'a=b&a=b&a=c'); +}, 'Append same name'); +test(function() { + var params = new URLSearchParams(); + params.append('', ''); + assert_equals(params + '', '='); + params.append('', ''); + assert_equals(params + '', '=&='); +}, 'Append empty strings'); +test(function() { + var params = new URLSearchParams(); + params.append(null, null); + assert_equals(params + '', 'null=null'); + params.append(null, null); + assert_equals(params + '', 'null=null&null=null'); +}, 'Append null'); +test(function() { + var params = new URLSearchParams(); + params.append('first', 1); + params.append('second', 2); + params.append('third', ''); + params.append('first', 10); + assert_true(params.has('first'), 'Search params object has name "first"'); + assert_equals(params.get('first'), '1', 'Search params object has name "first" with value "1"'); + assert_equals(params.get('second'), '2', 'Search params object has name "second" with value "2"'); + assert_equals(params.get('third'), '', 'Search params object has name "third" with value ""'); + params.append('first', 10); + assert_equals(params.get('first'), '1', 'Search params object has name "first" with value "1"'); +}, 'Append multiple'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.append.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); + assert.throws(() => { + params.append('a'); + }, /^TypeError: The "name" and "value" arguments must be specified$/); + + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + assert.throws(() => params.set(obj, 'b'), /^Error: toString$/); + assert.throws(() => params.set('a', obj), /^Error: toString$/); + assert.throws(() => params.set(sym, 'b'), + /^TypeError: Cannot convert a Symbol value to a string$/); + assert.throws(() => params.set('a', sym), + /^TypeError: Cannot convert a Symbol value to a string$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-constructor.js b/test/parallel/test-whatwg-url-searchparams-constructor.js new file mode 100644 index 00000000000000..a3e15875276087 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-constructor.js @@ -0,0 +1,248 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { + test, assert_equals, assert_true, + assert_false, assert_throws, assert_array_equals +} = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/54c3502d7b/url/urlsearchparams-constructor.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +var params; // Strict mode fix for WPT. +test(function() { + var params = new URLSearchParams(); + assert_equals(params + '', ''); + params = new URLSearchParams(''); + assert_equals(params + '', ''); + params = new URLSearchParams('a=b'); + assert_equals(params + '', 'a=b'); + params = new URLSearchParams(params); + assert_equals(params + '', 'a=b'); +}, 'Basic URLSearchParams construction'); + +test(function() { + var params = new URLSearchParams() + assert_equals(params.toString(), "") +}, "URLSearchParams constructor, no arguments") + +// test(() => { +// params = new URLSearchParams(DOMException.prototype); +// assert_equals(params.toString(), "INDEX_SIZE_ERR=1&DOMSTRING_SIZE_ERR=2&HIERARCHY_REQUEST_ERR=3&WRONG_DOCUMENT_ERR=4&INVALID_CHARACTER_ERR=5&NO_DATA_ALLOWED_ERR=6&NO_MODIFICATION_ALLOWED_ERR=7&NOT_FOUND_ERR=8&NOT_SUPPORTED_ERR=9&INUSE_ATTRIBUTE_ERR=10&INVALID_STATE_ERR=11&SYNTAX_ERR=12&INVALID_MODIFICATION_ERR=13&NAMESPACE_ERR=14&INVALID_ACCESS_ERR=15&VALIDATION_ERR=16&TYPE_MISMATCH_ERR=17&SECURITY_ERR=18&NETWORK_ERR=19&ABORT_ERR=20&URL_MISMATCH_ERR=21"A_EXCEEDED_ERR=22&TIMEOUT_ERR=23&INVALID_NODE_TYPE_ERR=24&DATA_CLONE_ERR=25") +// }, "URLSearchParams constructor, DOMException.prototype as argument") + +test(() => { + params = new URLSearchParams(''); + assert_true(params != null, 'constructor returned non-null value.'); + assert_equals(params.__proto__, URLSearchParams.prototype, 'expected URLSearchParams.prototype as prototype.'); +}, "URLSearchParams constructor, empty string as argument") + +test(() => { + params = new URLSearchParams({}); + assert_equals(params + '', ""); +}, 'URLSearchParams constructor, {} as argument'); + +test(function() { + var params = new URLSearchParams('a=b'); + assert_true(params != null, 'constructor returned non-null value.'); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_false(params.has('b'), 'Search params object has not got name "b"'); + var params = new URLSearchParams('a=b&c'); + assert_true(params != null, 'constructor returned non-null value.'); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_true(params.has('c'), 'Search params object has name "c"'); + var params = new URLSearchParams('&a&&& &&&&&a+b=& c&m%c3%b8%c3%b8'); + assert_true(params != null, 'constructor returned non-null value.'); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_true(params.has('a b'), 'Search params object has name "a b"'); + assert_true(params.has(' '), 'Search params object has name " "'); + assert_false(params.has('c'), 'Search params object did not have the name "c"'); + assert_true(params.has(' c'), 'Search params object has name " c"'); + assert_true(params.has('møø'), 'Search params object has name "møø"'); +}, 'URLSearchParams constructor, string.'); + +test(function() { + var seed = new URLSearchParams('a=b&c=d'); + var params = new URLSearchParams(seed); + assert_true(params != null, 'constructor returned non-null value.'); + assert_equals(params.get('a'), 'b'); + assert_equals(params.get('c'), 'd'); + assert_false(params.has('d')); + // The name-value pairs are copied when created; later updates + // should not be observable. + seed.append('e', 'f'); + assert_false(params.has('e')); + params.append('g', 'h'); + assert_false(seed.has('g')); +}, 'URLSearchParams constructor, object.'); + +test(function() { + var params = new URLSearchParams('a=b+c'); + assert_equals(params.get('a'), 'b c'); + params = new URLSearchParams('a+b=c'); + assert_equals(params.get('a b'), 'c'); +}, 'Parse +'); + +test(function() { + const testValue = '+15555555555'; + const params = new URLSearchParams(); + params.set('query', testValue); + var newParams = new URLSearchParams(params.toString()); + + assert_equals(params.toString(), 'query=%2B15555555555'); + assert_equals(params.get('query'), testValue); + assert_equals(newParams.get('query'), testValue); +}, 'Parse encoded +'); + +test(function() { + var params = new URLSearchParams('a=b c'); + assert_equals(params.get('a'), 'b c'); + params = new URLSearchParams('a b=c'); + assert_equals(params.get('a b'), 'c'); +}, 'Parse space'); + +test(function() { + var params = new URLSearchParams('a=b%20c'); + assert_equals(params.get('a'), 'b c'); + params = new URLSearchParams('a%20b=c'); + assert_equals(params.get('a b'), 'c'); +}, 'Parse %20'); + +test(function() { + var params = new URLSearchParams('a=b\0c'); + assert_equals(params.get('a'), 'b\0c'); + params = new URLSearchParams('a\0b=c'); + assert_equals(params.get('a\0b'), 'c'); +}, 'Parse \\0'); + +test(function() { + var params = new URLSearchParams('a=b%00c'); + assert_equals(params.get('a'), 'b\0c'); + params = new URLSearchParams('a%00b=c'); + assert_equals(params.get('a\0b'), 'c'); +}, 'Parse %00'); + +test(function() { + var params = new URLSearchParams('a=b\u2384'); + assert_equals(params.get('a'), 'b\u2384'); + params = new URLSearchParams('a\u2384b=c'); + assert_equals(params.get('a\u2384b'), 'c'); +}, 'Parse \u2384'); // Unicode Character 'COMPOSITION SYMBOL' (U+2384) + +test(function() { + var params = new URLSearchParams('a=b%e2%8e%84'); + assert_equals(params.get('a'), 'b\u2384'); + params = new URLSearchParams('a%e2%8e%84b=c'); + assert_equals(params.get('a\u2384b'), 'c'); +}, 'Parse %e2%8e%84'); // Unicode Character 'COMPOSITION SYMBOL' (U+2384) + +test(function() { + var params = new URLSearchParams('a=b\uD83D\uDCA9c'); + assert_equals(params.get('a'), 'b\uD83D\uDCA9c'); + params = new URLSearchParams('a\uD83D\uDCA9b=c'); + assert_equals(params.get('a\uD83D\uDCA9b'), 'c'); +}, 'Parse \uD83D\uDCA9'); // Unicode Character 'PILE OF POO' (U+1F4A9) + +test(function() { + var params = new URLSearchParams('a=b%f0%9f%92%a9c'); + assert_equals(params.get('a'), 'b\uD83D\uDCA9c'); + params = new URLSearchParams('a%f0%9f%92%a9b=c'); + assert_equals(params.get('a\uD83D\uDCA9b'), 'c'); +}, 'Parse %f0%9f%92%a9'); // Unicode Character 'PILE OF POO' (U+1F4A9) + +test(function() { + var params = new URLSearchParams([]); + assert_true(params != null, 'constructor returned non-null value.'); + params = new URLSearchParams([['a', 'b'], ['c', 'd']]); + assert_equals(params.get("a"), "b"); + assert_equals(params.get("c"), "d"); + assert_throws(new TypeError(), function() { new URLSearchParams([[1]]); }); + assert_throws(new TypeError(), function() { new URLSearchParams([[1,2,3]]); }); +}, "Constructor with sequence of sequences of strings"); + +[ + { "input": {"+": "%C2"}, "output": [["+", "%C2"]], "name": "object with +" }, + { "input": {c: "x", a: "?"}, "output": [["c", "x"], ["a", "?"]], "name": "object with two keys" }, + { "input": [["c", "x"], ["a", "?"]], "output": [["c", "x"], ["a", "?"]], "name": "array with two keys" }, + { "input": {"a\0b": "42", "c\uD83D": "23", "d\u1234": "foo"}, "output": [["a\0b", "42"], ["c\uFFFD", "23"], ["d\u1234", "foo"]], "name": "object with NULL, non-ASCII, and surrogate keys" } +].forEach((val) => { + test(() => { + let params = new URLSearchParams(val.input), + i = 0 + for (let param of params) { + assert_array_equals(param, val.output[i]) + i++ + } + }, "Construct with " + val.name) +}) + +test(() => { + params = new URLSearchParams() + params[Symbol.iterator] = function *() { + yield ["a", "b"] + } + let params2 = new URLSearchParams(params) + assert_equals(params2.get("a"), "b") +}, "Custom [Symbol.iterator]") +/* eslint-enable */ + +// Tests below are not from WPT. +function makeIterableFunc(array) { + return Object.assign(() => {}, { + [Symbol.iterator]() { + return array[Symbol.iterator](); + } + }); +} + +{ + const iterableError = /^TypeError: Query pairs must be iterable$/; + const tupleError = + /^TypeError: Each query pair must be an iterable \[name, value] tuple$/; + + let params; + params = new URLSearchParams(undefined); + assert.strictEqual(params.toString(), ''); + params = new URLSearchParams(null); + assert.strictEqual(params.toString(), ''); + params = new URLSearchParams( + makeIterableFunc([['key', 'val'], ['key2', 'val2']]) + ); + assert.strictEqual(params.toString(), 'key=val&key2=val2'); + params = new URLSearchParams( + makeIterableFunc([['key', 'val'], ['key2', 'val2']].map(makeIterableFunc)) + ); + assert.strictEqual(params.toString(), 'key=val&key2=val2'); + assert.throws(() => new URLSearchParams([[1]]), tupleError); + assert.throws(() => new URLSearchParams([[1, 2, 3]]), tupleError); + assert.throws(() => new URLSearchParams({ [Symbol.iterator]: 42 }), + iterableError); + assert.throws(() => new URLSearchParams([{}]), tupleError); + assert.throws(() => new URLSearchParams(['a']), tupleError); + assert.throws(() => new URLSearchParams([null]), tupleError); + assert.throws(() => new URLSearchParams([{ [Symbol.iterator]: 42 }]), + tupleError); +} + +{ + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + const toStringError = /^Error: toString$/; + const symbolError = /^TypeError: Cannot convert a Symbol value to a string$/; + + assert.throws(() => new URLSearchParams({ a: obj }), toStringError); + assert.throws(() => new URLSearchParams([['a', obj]]), toStringError); + assert.throws(() => new URLSearchParams(sym), symbolError); + assert.throws(() => new URLSearchParams({ [sym]: 'a' }), symbolError); + assert.throws(() => new URLSearchParams({ a: sym }), symbolError); + assert.throws(() => new URLSearchParams([[sym, 'a']]), symbolError); + assert.throws(() => new URLSearchParams([['a', sym]]), symbolError); +} diff --git a/test/parallel/test-whatwg-url-searchparams-delete.js b/test/parallel/test-whatwg-url-searchparams-delete.js new file mode 100644 index 00000000000000..bd52a13e9174b3 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-delete.js @@ -0,0 +1,92 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const { URL, URLSearchParams } = require('url'); +const { test, assert_equals, assert_true, assert_false } = + require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/70a0898763/url/urlsearchparams-delete.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams('a=b&c=d'); + params.delete('a'); + assert_equals(params + '', 'c=d'); + params = new URLSearchParams('a=a&b=b&a=a&c=c'); + params.delete('a'); + assert_equals(params + '', 'b=b&c=c'); + params = new URLSearchParams('a=a&=&b=b&c=c'); + params.delete(''); + assert_equals(params + '', 'a=a&b=b&c=c'); + params = new URLSearchParams('a=a&null=null&b=b'); + params.delete(null); + assert_equals(params + '', 'a=a&b=b'); + params = new URLSearchParams('a=a&undefined=undefined&b=b'); + params.delete(undefined); + assert_equals(params + '', 'a=a&b=b'); +}, 'Delete basics'); + +test(function() { + var params = new URLSearchParams(); + params.append('first', 1); + assert_true(params.has('first'), 'Search params object has name "first"'); + assert_equals(params.get('first'), '1', 'Search params object has name "first" with value "1"'); + params.delete('first'); + assert_false(params.has('first'), 'Search params object has no "first" name'); + params.append('first', 1); + params.append('first', 10); + params.delete('first'); + assert_false(params.has('first'), 'Search params object has no "first" name'); +}, 'Deleting appended multiple'); + +test(function() { + var url = new URL('http://example.com/?param1¶m2'); + url.searchParams.delete('param1'); + url.searchParams.delete('param2'); + assert_equals(url.href, 'http://example.com/', 'url.href does not have ?'); + assert_equals(url.search, '', 'url.search does not have ?'); +}, 'Deleting all params removes ? from URL'); + +test(function() { + var url = new URL('http://example.com/?'); + url.searchParams.delete('param1'); + assert_equals(url.href, 'http://example.com/', 'url.href does not have ?'); + assert_equals(url.search, '', 'url.search does not have ?'); +}, 'Removing non-existent param removes ? from URL'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.delete.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); + assert.throws(() => { + params.delete(); + }, /^TypeError: The "name" argument must be specified$/); + + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + assert.throws(() => params.delete(obj), /^Error: toString$/); + assert.throws(() => params.delete(sym), + /^TypeError: Cannot convert a Symbol value to a string$/); +} + +// https://github.com/nodejs/node/issues/10480 +// Emptying searchParams should correctly update url's query +{ + const url = new URL('http://domain?var=1&var=2&var=3'); + for (const param of url.searchParams.keys()) { + url.searchParams.delete(param); + } + assert.strictEqual(url.searchParams.toString(), ''); + assert.strictEqual(url.search, ''); + assert.strictEqual(url.href, 'http://domain/'); +} diff --git a/test/parallel/test-whatwg-url-searchparams-entries.js b/test/parallel/test-whatwg-url-searchparams-entries.js new file mode 100644 index 00000000000000..4e73b92b517fd9 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-entries.js @@ -0,0 +1,34 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; + +// Tests below are not from WPT. +const params = new URLSearchParams('a=b&c=d'); +const entries = params.entries(); +assert.strictEqual(typeof entries[Symbol.iterator], 'function'); +assert.strictEqual(entries[Symbol.iterator](), entries); +assert.deepStrictEqual(entries.next(), { + value: ['a', 'b'], + done: false +}); +assert.deepStrictEqual(entries.next(), { + value: ['c', 'd'], + done: false +}); +assert.deepStrictEqual(entries.next(), { + value: undefined, + done: true +}); +assert.deepStrictEqual(entries.next(), { + value: undefined, + done: true +}); + +assert.throws(() => { + entries.next.call(undefined); +}, /^TypeError: Value of "this" must be of type URLSearchParamsIterator$/); +assert.throws(() => { + params.entries.call(undefined); +}, /^TypeError: Value of "this" must be of type URLSearchParams$/); diff --git a/test/parallel/test-whatwg-url-searchparams-foreach.js b/test/parallel/test-whatwg-url-searchparams-foreach.js new file mode 100644 index 00000000000000..06f21723a6cd2f --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-foreach.js @@ -0,0 +1,56 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const { URL, URLSearchParams } = require('url'); +const { test, assert_array_equals, assert_unreached } = + require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/a8b2b1e/url/urlsearchparams-foreach.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +var i; // Strict mode fix for WPT. +test(function() { + var params = new URLSearchParams('a=1&b=2&c=3'); + var keys = []; + var values = []; + params.forEach(function(value, key) { + keys.push(key); + values.push(value); + }); + assert_array_equals(keys, ['a', 'b', 'c']); + assert_array_equals(values, ['1', '2', '3']); +}, "ForEach Check"); + +test(function() { + let a = new URL("http://a.b/c?a=1&b=2&c=3&d=4"); + let b = a.searchParams; + var c = []; + for (i of b) { + a.search = "x=1&y=2&z=3"; + c.push(i); + } + assert_array_equals(c[0], ["a","1"]); + assert_array_equals(c[1], ["y","2"]); + assert_array_equals(c[2], ["z","3"]); +}, "For-of Check"); + +test(function() { + let a = new URL("http://a.b/c"); + let b = a.searchParams; + for (i of b) { + assert_unreached(i); + } +}, "empty"); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.forEach.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-get.js b/test/parallel/test-whatwg-url-searchparams-get.js new file mode 100644 index 00000000000000..b096a69a6071a0 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-get.js @@ -0,0 +1,55 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { test, assert_equals, assert_true } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-get.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams('a=b&c=d'); + assert_equals(params.get('a'), 'b'); + assert_equals(params.get('c'), 'd'); + assert_equals(params.get('e'), null); + params = new URLSearchParams('a=b&c=d&a=e'); + assert_equals(params.get('a'), 'b'); + params = new URLSearchParams('=b&c=d'); + assert_equals(params.get(''), 'b'); + params = new URLSearchParams('a=&c=d&a=e'); + assert_equals(params.get('a'), ''); +}, 'Get basics'); + +test(function() { + var params = new URLSearchParams('first=second&third&&'); + assert_true(params != null, 'constructor returned non-null value.'); + assert_true(params.has('first'), 'Search params object has name "first"'); + assert_equals(params.get('first'), 'second', 'Search params object has name "first" with value "second"'); + assert_equals(params.get('third'), '', 'Search params object has name "third" with the empty value.'); + assert_equals(params.get('fourth'), null, 'Search params object has no "fourth" name and value.'); +}, 'More get() basics'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.get.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); + assert.throws(() => { + params.get(); + }, /^TypeError: The "name" argument must be specified$/); + + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + assert.throws(() => params.get(obj), /^Error: toString$/); + assert.throws(() => params.get(sym), + /^TypeError: Cannot convert a Symbol value to a string$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-getall.js b/test/parallel/test-whatwg-url-searchparams-getall.js new file mode 100644 index 00000000000000..acf5108459cf61 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-getall.js @@ -0,0 +1,60 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { test, assert_equals, assert_true, assert_array_equals } = + require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-getall.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams('a=b&c=d'); + assert_array_equals(params.getAll('a'), ['b']); + assert_array_equals(params.getAll('c'), ['d']); + assert_array_equals(params.getAll('e'), []); + params = new URLSearchParams('a=b&c=d&a=e'); + assert_array_equals(params.getAll('a'), ['b', 'e']); + params = new URLSearchParams('=b&c=d'); + assert_array_equals(params.getAll(''), ['b']); + params = new URLSearchParams('a=&c=d&a=e'); + assert_array_equals(params.getAll('a'), ['', 'e']); +}, 'getAll() basics'); + +test(function() { + var params = new URLSearchParams('a=1&a=2&a=3&a'); + assert_true(params.has('a'), 'Search params object has name "a"'); + var matches = params.getAll('a'); + assert_true(matches && matches.length == 4, 'Search params object has values for name "a"'); + assert_array_equals(matches, ['1', '2', '3', ''], 'Search params object has expected name "a" values'); + params.set('a', 'one'); + assert_equals(params.get('a'), 'one', 'Search params object has name "a" with value "one"'); + var matches = params.getAll('a'); + assert_true(matches && matches.length == 1, 'Search params object has values for name "a"'); + assert_array_equals(matches, ['one'], 'Search params object has expected name "a" values'); +}, 'getAll() multiples'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.getAll.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); + assert.throws(() => { + params.getAll(); + }, /^TypeError: The "name" argument must be specified$/); + + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + assert.throws(() => params.getAll(obj), /^Error: toString$/); + assert.throws(() => params.getAll(sym), + /^TypeError: Cannot convert a Symbol value to a string$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-has.js b/test/parallel/test-whatwg-url-searchparams-has.js new file mode 100644 index 00000000000000..0fdd88af64c5af --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-has.js @@ -0,0 +1,58 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { test, assert_false, assert_true } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-has.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams('a=b&c=d'); + assert_true(params.has('a')); + assert_true(params.has('c')); + assert_false(params.has('e')); + params = new URLSearchParams('a=b&c=d&a=e'); + assert_true(params.has('a')); + params = new URLSearchParams('=b&c=d'); + assert_true(params.has('')); + params = new URLSearchParams('null=a'); + assert_true(params.has(null)); +}, 'Has basics'); + +test(function() { + var params = new URLSearchParams('a=b&c=d&&'); + params.append('first', 1); + params.append('first', 2); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_true(params.has('c'), 'Search params object has name "c"'); + assert_true(params.has('first'), 'Search params object has name "first"'); + assert_false(params.has('d'), 'Search params object has no name "d"'); + params.delete('first'); + assert_false(params.has('first'), 'Search params object has no name "first"'); +}, 'has() following delete()'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.has.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); + assert.throws(() => { + params.has(); + }, /^TypeError: The "name" argument must be specified$/); + + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + assert.throws(() => params.has(obj), /^Error: toString$/); + assert.throws(() => params.has(sym), + /^TypeError: Cannot convert a Symbol value to a string$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-inspect.js b/test/parallel/test-whatwg-url-searchparams-inspect.js new file mode 100644 index 00000000000000..163fa185ede58d --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-inspect.js @@ -0,0 +1,29 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const util = require('util'); +const URLSearchParams = require('url').URLSearchParams; + +// Tests below are not from WPT. +const sp = new URLSearchParams('?a=a&b=b&b=c'); +assert.strictEqual(util.inspect(sp), + "URLSearchParams { 'a' => 'a', 'b' => 'b', 'b' => 'c' }"); +assert.strictEqual(util.inspect(sp.keys()), + "URLSearchParamsIterator { 'a', 'b', 'b' }"); +assert.strictEqual(util.inspect(sp.values()), + "URLSearchParamsIterator { 'a', 'b', 'c' }"); +assert.strictEqual(util.inspect(sp.keys(), { breakLength: 1 }), + "URLSearchParamsIterator {\n 'a',\n 'b',\n 'b' }"); + +const iterator = sp.entries(); +assert.strictEqual(util.inspect(iterator), + "URLSearchParamsIterator { [ 'a', 'a' ], [ 'b', 'b' ], " + + "[ 'b', 'c' ] }"); +iterator.next(); +assert.strictEqual(util.inspect(iterator), + "URLSearchParamsIterator { [ 'b', 'b' ], [ 'b', 'c' ] }"); +iterator.next(); +iterator.next(); +assert.strictEqual(util.inspect(iterator), + 'URLSearchParamsIterator { }'); diff --git a/test/parallel/test-whatwg-url-searchparams-keys.js b/test/parallel/test-whatwg-url-searchparams-keys.js new file mode 100644 index 00000000000000..af044a260874ac --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-keys.js @@ -0,0 +1,35 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; + +// Tests below are not from WPT. +const params = new URLSearchParams('a=b&c=d'); +const keys = params.keys(); + +assert.strictEqual(typeof keys[Symbol.iterator], 'function'); +assert.strictEqual(keys[Symbol.iterator](), keys); +assert.deepStrictEqual(keys.next(), { + value: 'a', + done: false +}); +assert.deepStrictEqual(keys.next(), { + value: 'c', + done: false +}); +assert.deepStrictEqual(keys.next(), { + value: undefined, + done: true +}); +assert.deepStrictEqual(keys.next(), { + value: undefined, + done: true +}); + +assert.throws(() => { + keys.next.call(undefined); +}, /^TypeError: Value of "this" must be of type URLSearchParamsIterator$/); +assert.throws(() => { + params.keys.call(undefined); +}, /^TypeError: Value of "this" must be of type URLSearchParams$/); diff --git a/test/parallel/test-whatwg-url-searchparams-set.js b/test/parallel/test-whatwg-url-searchparams-set.js new file mode 100644 index 00000000000000..8a6c31bbe66487 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-set.js @@ -0,0 +1,59 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { test, assert_equals, assert_true } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-set.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams('a=b&c=d'); + params.set('a', 'B'); + assert_equals(params + '', 'a=B&c=d'); + params = new URLSearchParams('a=b&c=d&a=e'); + params.set('a', 'B'); + assert_equals(params + '', 'a=B&c=d') + params.set('e', 'f'); + assert_equals(params + '', 'a=B&c=d&e=f') +}, 'Set basics'); + +test(function() { + var params = new URLSearchParams('a=1&a=2&a=3'); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_equals(params.get('a'), '1', 'Search params object has name "a" with value "1"'); + params.set('first', 4); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_equals(params.get('a'), '1', 'Search params object has name "a" with value "1"'); + params.set('a', 4); + assert_true(params.has('a'), 'Search params object has name "a"'); + assert_equals(params.get('a'), '4', 'Search params object has name "a" with value "4"'); +}, 'URLSearchParams.set'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.set.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); + assert.throws(() => { + params.set('a'); + }, /^TypeError: The "name" and "value" arguments must be specified$/); + + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + assert.throws(() => params.append(obj, 'b'), /^Error: toString$/); + assert.throws(() => params.append('a', obj), /^Error: toString$/); + assert.throws(() => params.append(sym, 'b'), + /^TypeError: Cannot convert a Symbol value to a string$/); + assert.throws(() => params.append('a', sym), + /^TypeError: Cannot convert a Symbol value to a string$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-sort.js b/test/parallel/test-whatwg-url-searchparams-sort.js new file mode 100644 index 00000000000000..1122f08dcc0434 --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-sort.js @@ -0,0 +1,105 @@ +'use strict'; + +require('../common'); +const { URL, URLSearchParams } = require('url'); +const { test, assert_equals, assert_array_equals } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/70a0898763/url/urlsearchparams-sort.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +[ + { + "input": "z=b&a=b&z=a&a=a", + "output": [["a", "b"], ["a", "a"], ["z", "b"], ["z", "a"]] + }, + { + "input": "\uFFFD=x&\uFFFC&\uFFFD=a", + "output": [["\uFFFC", ""], ["\uFFFD", "x"], ["\uFFFD", "a"]] + }, + { + "input": "ffi&🌈", // 🌈 > code point, but < code unit because two code units + "output": [["🌈", ""], ["ffi", ""]] + }, + { + "input": "é&e\uFFFD&e\u0301", + "output": [["e\u0301", ""], ["e\uFFFD", ""], ["é", ""]] + }, + { + "input": "z=z&a=a&z=y&a=b&z=x&a=c&z=w&a=d&z=v&a=e&z=u&a=f&z=t&a=g", + "output": [["a", "a"], ["a", "b"], ["a", "c"], ["a", "d"], ["a", "e"], ["a", "f"], ["a", "g"], ["z", "z"], ["z", "y"], ["z", "x"], ["z", "w"], ["z", "v"], ["z", "u"], ["z", "t"]] + } +].forEach((val) => { + test(() => { + let params = new URLSearchParams(val.input), + i = 0 + params.sort() + for(let param of params) { + assert_array_equals(param, val.output[i]) + i++ + } + }, `Parse and sort: ${val.input}`) + + test(() => { + let url = new URL(`?${val.input}`, "https://example/") + url.searchParams.sort() + let params = new URLSearchParams(url.search), + i = 0 + for(let param of params) { + assert_array_equals(param, val.output[i]) + i++ + } + }, `URL parse and sort: ${val.input}`) +}) + +test(function() { + const url = new URL("http://example.com/?") + url.searchParams.sort() + assert_equals(url.href, "http://example.com/") + assert_equals(url.search, "") +}, "Sorting non-existent params removes ? from URL") +/* eslint-enable */ + +// Tests below are not from WPT. + +// Test bottom-up iterative stable merge sort +const tests = [{ input: '', output: [] }]; +const pairs = []; +for (let i = 10; i < 100; i++) { + pairs.push([`a${i}`, 'b']); + tests[0].output.push([`a${i}`, 'b']); +} +tests[0].input = pairs.sort(() => Math.random() > 0.5) + .map((pair) => pair.join('=')).join('&'); + +tests.push( + { + 'input': 'z=a&=b&c=d', + 'output': [['', 'b'], ['c', 'd'], ['z', 'a']] + } +); + +tests.forEach((val) => { + test(() => { + const params = new URLSearchParams(val.input); + let i = 0; + params.sort(); + for (const param of params) { + assert_array_equals(param, val.output[i]); + i++; + } + }, `Parse and sort: ${val.input}`); + + test(() => { + const url = new URL(`?${val.input}`, 'https://example/'); + url.searchParams.sort(); + const params = new URLSearchParams(url.search); + let i = 0; + for (const param of params) { + assert_array_equals(param, val.output[i]); + i++; + } + }, `URL parse and sort: ${val.input}`); +}); diff --git a/test/parallel/test-whatwg-url-searchparams-stringifier.js b/test/parallel/test-whatwg-url-searchparams-stringifier.js new file mode 100644 index 00000000000000..c355a2c9a9c29c --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-stringifier.js @@ -0,0 +1,132 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; +const { test, assert_equals } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(function() { + var params = new URLSearchParams(); + params.append('a', 'b c'); + assert_equals(params + '', 'a=b+c'); + params.delete('a'); + params.append('a b', 'c'); + assert_equals(params + '', 'a+b=c'); +}, 'Serialize space'); + +test(function() { + var params = new URLSearchParams(); + params.append('a', ''); + assert_equals(params + '', 'a='); + params.append('a', ''); + assert_equals(params + '', 'a=&a='); + params.append('', 'b'); + assert_equals(params + '', 'a=&a=&=b'); + params.append('', ''); + assert_equals(params + '', 'a=&a=&=b&='); + params.append('', ''); + assert_equals(params + '', 'a=&a=&=b&=&='); +}, 'Serialize empty value'); + +test(function() { + var params = new URLSearchParams(); + params.append('', 'b'); + assert_equals(params + '', '=b'); + params.append('', 'b'); + assert_equals(params + '', '=b&=b'); +}, 'Serialize empty name'); + +test(function() { + var params = new URLSearchParams(); + params.append('', ''); + assert_equals(params + '', '='); + params.append('', ''); + assert_equals(params + '', '=&='); +}, 'Serialize empty name and value'); + +test(function() { + var params = new URLSearchParams(); + params.append('a', 'b+c'); + assert_equals(params + '', 'a=b%2Bc'); + params.delete('a'); + params.append('a+b', 'c'); + assert_equals(params + '', 'a%2Bb=c'); +}, 'Serialize +'); + +test(function() { + var params = new URLSearchParams(); + params.append('=', 'a'); + assert_equals(params + '', '%3D=a'); + params.append('b', '='); + assert_equals(params + '', '%3D=a&b=%3D'); +}, 'Serialize ='); + +test(function() { + var params = new URLSearchParams(); + params.append('&', 'a'); + assert_equals(params + '', '%26=a'); + params.append('b', '&'); + assert_equals(params + '', '%26=a&b=%26'); +}, 'Serialize &'); + +test(function() { + var params = new URLSearchParams(); + params.append('a', '*-._'); + assert_equals(params + '', 'a=*-._'); + params.delete('a'); + params.append('*-._', 'c'); + assert_equals(params + '', '*-._=c'); +}, 'Serialize *-._'); + +test(function() { + var params = new URLSearchParams(); + params.append('a', 'b%c'); + assert_equals(params + '', 'a=b%25c'); + params.delete('a'); + params.append('a%b', 'c'); + assert_equals(params + '', 'a%25b=c'); +}, 'Serialize %'); + +test(function() { + var params = new URLSearchParams(); + params.append('a', 'b\0c'); + assert_equals(params + '', 'a=b%00c'); + params.delete('a'); + params.append('a\0b', 'c'); + assert_equals(params + '', 'a%00b=c'); +}, 'Serialize \\0'); + +test(function() { + var params = new URLSearchParams(); + params.append('a', 'b\uD83D\uDCA9c'); + assert_equals(params + '', 'a=b%F0%9F%92%A9c'); + params.delete('a'); + params.append('a\uD83D\uDCA9b', 'c'); + assert_equals(params + '', 'a%F0%9F%92%A9b=c'); +}, 'Serialize \uD83D\uDCA9'); // Unicode Character 'PILE OF POO' (U+1F4A9) + +test(function() { + var params; + params = new URLSearchParams('a=b&c=d&&e&&'); + assert_equals(params.toString(), 'a=b&c=d&e='); + params = new URLSearchParams('a = b &a=b&c=d%20'); + assert_equals(params.toString(), 'a+=+b+&a=b&c=d+'); + // The lone '=' _does_ survive the roundtrip. + params = new URLSearchParams('a=&a=b'); + assert_equals(params.toString(), 'a=&a=b'); +}, 'URLSearchParams.toString'); +/* eslint-enable */ + +// Tests below are not from WPT. +{ + const params = new URLSearchParams(); + assert.throws(() => { + params.toString.call(undefined); + }, /^TypeError: Value of "this" must be of type URLSearchParams$/); +} diff --git a/test/parallel/test-whatwg-url-searchparams-values.js b/test/parallel/test-whatwg-url-searchparams-values.js new file mode 100644 index 00000000000000..2775231b8bda5d --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams-values.js @@ -0,0 +1,35 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URLSearchParams = require('url').URLSearchParams; + +// Tests below are not from WPT. +const params = new URLSearchParams('a=b&c=d'); +const values = params.values(); + +assert.strictEqual(typeof values[Symbol.iterator], 'function'); +assert.strictEqual(values[Symbol.iterator](), values); +assert.deepStrictEqual(values.next(), { + value: 'b', + done: false +}); +assert.deepStrictEqual(values.next(), { + value: 'd', + done: false +}); +assert.deepStrictEqual(values.next(), { + value: undefined, + done: true +}); +assert.deepStrictEqual(values.next(), { + value: undefined, + done: true +}); + +assert.throws(() => { + values.next.call(undefined); +}, /^TypeError: Value of "this" must be of type URLSearchParamsIterator$/); +assert.throws(() => { + params.values.call(undefined); +}, /^TypeError: Value of "this" must be of type URLSearchParams$/); diff --git a/test/parallel/test-whatwg-url-searchparams.js b/test/parallel/test-whatwg-url-searchparams.js new file mode 100644 index 00000000000000..b6861273e71a0e --- /dev/null +++ b/test/parallel/test-whatwg-url-searchparams.js @@ -0,0 +1,106 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const { URL, URLSearchParams } = require('url'); +const fixtures = require('../common/fixtures'); + +// Tests below are not from WPT. +const serialized = 'a=a&a=1&a=true&a=undefined&a=null&a=%EF%BF%BD' + + '&a=%EF%BF%BD&a=%F0%9F%98%80&a=%EF%BF%BD%EF%BF%BD' + + '&a=%5Bobject+Object%5D'; +const values = ['a', 1, true, undefined, null, '\uD83D', '\uDE00', + '\uD83D\uDE00', '\uDE00\uD83D', {}]; +const normalizedValues = ['a', '1', 'true', 'undefined', 'null', '\uFFFD', + '\uFFFD', '\uD83D\uDE00', '\uFFFD\uFFFD', + '[object Object]']; + +const m = new URL('http://example.org'); +const sp = m.searchParams; + +assert(sp); +assert.strictEqual(sp.toString(), ''); +assert.strictEqual(m.search, ''); + +assert(!sp.has('a')); +values.forEach((i) => sp.set('a', i)); +assert(sp.has('a')); +assert.strictEqual(sp.get('a'), '[object Object]'); +sp.delete('a'); +assert(!sp.has('a')); + +m.search = ''; +assert.strictEqual(sp.toString(), ''); + +values.forEach((i) => sp.append('a', i)); +assert(sp.has('a')); +assert.strictEqual(sp.getAll('a').length, values.length); +assert.strictEqual(sp.get('a'), 'a'); + +assert.strictEqual(sp.toString(), serialized); + +assert.strictEqual(m.search, `?${serialized}`); + +assert.strictEqual(sp[Symbol.iterator], sp.entries); + +let key, val; +let n = 0; +for ([key, val] of sp) { + assert.strictEqual(key, 'a', n); + assert.strictEqual(val, normalizedValues[n], n); + n++; +} +n = 0; +for (key of sp.keys()) { + assert.strictEqual(key, 'a', n); + n++; +} +n = 0; +for (val of sp.values()) { + assert.strictEqual(val, normalizedValues[n], n); + n++; +} +n = 0; +sp.forEach(function(val, key, obj) { + assert.strictEqual(this, undefined, n); + assert.strictEqual(key, 'a', n); + assert.strictEqual(val, normalizedValues[n], n); + assert.strictEqual(obj, sp, n); + n++; +}); +sp.forEach(function() { + assert.strictEqual(this, m); +}, m); + +{ + const callbackErr = /^TypeError: Callback must be a function$/; + assert.throws(() => sp.forEach(), callbackErr); + assert.throws(() => sp.forEach(1), callbackErr); +} + +m.search = '?a=a&b=b'; +assert.strictEqual(sp.toString(), 'a=a&b=b'); + +const tests = require(fixtures.path('url-searchparams.js')); + +for (const [input, expected, parsed] of tests) { + if (input[0] !== '?') { + const sp = new URLSearchParams(input); + assert.strictEqual(String(sp), expected); + assert.deepStrictEqual(Array.from(sp), parsed); + + m.search = input; + assert.strictEqual(String(m.searchParams), expected); + assert.deepStrictEqual(Array.from(m.searchParams), parsed); + } + + { + const sp = new URLSearchParams(`?${input}`); + assert.strictEqual(String(sp), expected); + assert.deepStrictEqual(Array.from(sp), parsed); + + m.search = `?${input}`; + assert.strictEqual(String(m.searchParams), expected); + assert.deepStrictEqual(Array.from(m.searchParams), parsed); + } +} diff --git a/test/parallel/test-whatwg-url-setters.js b/test/parallel/test-whatwg-url-setters.js new file mode 100644 index 00000000000000..9a25de59e7e55f --- /dev/null +++ b/test/parallel/test-whatwg-url-setters.js @@ -0,0 +1,126 @@ +'use strict'; + +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const assert = require('assert'); +const URL = require('url').URL; +const { test, assert_equals } = require('../common/wpt'); +const fixtures = require('../common/fixtures'); + +const additionalTestCases = + require(fixtures.path('url-setter-tests-additional.js')); + +const request = { + response: require(fixtures.path('url-setter-tests')) +}; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-setters.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +function startURLSettersTests() { +// var setup = async_test("Loading data…") +// setup.step(function() { +// var request = new XMLHttpRequest() +// request.open("GET", "setters_tests.json") +// request.send() +// request.responseType = "json" +// request.onload = setup.step_func(function() { + runURLSettersTests(request.response) +// setup.done() +// }) +// }) +} + +function runURLSettersTests(all_test_cases) { + for (var attribute_to_be_set in all_test_cases) { + if (attribute_to_be_set == "comment") { + continue; + } + var test_cases = all_test_cases[attribute_to_be_set]; + for(var i = 0, l = test_cases.length; i < l; i++) { + var test_case = test_cases[i]; + var name = `Setting <${test_case.href}>.${attribute_to_be_set}` + + ` = '${test_case.new_value}'`; + if ("comment" in test_case) { + name += ` ${test_case.comment}`; + } + test(function() { + var url = new URL(test_case.href); + url[attribute_to_be_set] = test_case.new_value; + for (var attribute in test_case.expected) { + assert_equals(url[attribute], test_case.expected[attribute]) + } + }, `URL: ${name}`); + // test(function() { + // var url = document.createElement("a"); + // url.href = test_case.href; + // url[attribute_to_be_set] = test_case.new_value; + // for (var attribute in test_case.expected) { + // assert_equals(url[attribute], test_case.expected[attribute]) + // } + // }, ": " + name) + // test(function() { + // var url = document.createElement("area"); + // url.href = test_case.href; + // url[attribute_to_be_set] = test_case.new_value; + // for (var attribute in test_case.expected) { + // assert_equals(url[attribute], test_case.expected[attribute]) + // } + // }, ": " + name) + } + } +} + +startURLSettersTests() +/* eslint-enable */ + +// Tests below are not from WPT. + +{ + for (const attributeToBeSet in additionalTestCases) { + if (attributeToBeSet === 'comment') { + continue; + } + const testCases = additionalTestCases[attributeToBeSet]; + for (const testCase of testCases) { + let name = `Setting <${testCase.href}>.${attributeToBeSet}` + + ` = "${testCase.new_value}"`; + if ('comment' in testCase) { + name += ` ${testCase.comment}`; + } + test(function() { + const url = new URL(testCase.href); + url[attributeToBeSet] = testCase.new_value; + for (const attribute in testCase.expected) { + assert_equals(url[attribute], testCase.expected[attribute]); + } + }, `URL: ${name}`); + } + } +} + +{ + const url = new URL('http://example.com/'); + const obj = { + toString() { throw new Error('toString'); }, + valueOf() { throw new Error('valueOf'); } + }; + const sym = Symbol(); + for (const name of Reflect.ownKeys(Object.getPrototypeOf(url))) { + if (Object.getOwnPropertyDescriptor(Object.getPrototypeOf(url), name).set) { + assert.throws(() => url[name] = obj, + /^Error: toString$/, + `url.${name} = { toString() { throw ... } }`); + assert.throws(() => url[name] = sym, + /^TypeError: Cannot convert a Symbol value to a string$/, + `url.${name} = ${String(sym)}`); + } + } +} diff --git a/test/parallel/test-whatwg-url-toascii.js b/test/parallel/test-whatwg-url-toascii.js new file mode 100644 index 00000000000000..c85b092c1d250c --- /dev/null +++ b/test/parallel/test-whatwg-url-toascii.js @@ -0,0 +1,85 @@ +'use strict'; +const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + +const fixtures = require('../common/fixtures'); +const { URL } = require('url'); +const { test, assert_equals, assert_throws } = require('../common/wpt'); + +const request = { + response: require(fixtures.path('url-toascii')) +}; + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.window.js + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +// async_test(t => { +// const request = new XMLHttpRequest() +// request.open("GET", "toascii.json") +// request.send() +// request.responseType = "json" +// request.onload = t.step_func_done(() => { + runTests(request.response) +// }) +// }, "Loading data…") + +function makeURL(type, input) { + input = "https://" + input + "/x" + if(type === "url") { + return new URL(input) + } else { + const url = document.createElement(type) + url.href = input + return url + } +} + +function runTests(tests) { + for(var i = 0, l = tests.length; i < l; i++) { + let hostTest = tests[i] + if (typeof hostTest === "string") { + continue // skip comments + } + const typeName = { "url": "URL", "a": "", "area": "" } + // ;["url", "a", "area"].forEach((type) => { + ;["url"].forEach((type) => { + test(() => { + if(hostTest.output !== null) { + const url = makeURL("url", hostTest.input) + assert_equals(url.host, hostTest.output) + assert_equals(url.hostname, hostTest.output) + assert_equals(url.pathname, "/x") + assert_equals(url.href, "https://" + hostTest.output + "/x") + } else { + if(type === "url") { + assert_throws(new TypeError, () => makeURL("url", hostTest.input)) + } else { + const url = makeURL(type, hostTest.input) + assert_equals(url.host, "") + assert_equals(url.hostname, "") + assert_equals(url.pathname, "") + assert_equals(url.href, "https://" + hostTest.input + "/x") + } + } + }, hostTest.input + " (using " + typeName[type] + ")") + ;["host", "hostname"].forEach((val) => { + test(() => { + const url = makeURL(type, "x") + url[val] = hostTest.input + if(hostTest.output !== null) { + assert_equals(url[val], hostTest.output) + } else { + assert_equals(url[val], "x") + } + }, hostTest.input + " (using " + typeName[type] + "." + val + ")") + }) + }) + } +} +/* eslint-enable */ diff --git a/test/parallel/test-whatwg-url-tojson.js b/test/parallel/test-whatwg-url-tojson.js new file mode 100644 index 00000000000000..8e9a30c7e017e4 --- /dev/null +++ b/test/parallel/test-whatwg-url-tojson.js @@ -0,0 +1,17 @@ +'use strict'; + +require('../common'); +const URL = require('url').URL; +const { test, assert_equals } = require('../common/wpt'); + +/* The following tests are copied from WPT. Modifications to them should be + upstreamed first. Refs: + https://github.com/w3c/web-platform-tests/blob/02585db/url/url-tojson.html + License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html +*/ +/* eslint-disable */ +test(() => { + const a = new URL("https://example.com/") + assert_equals(JSON.stringify(a), "\"https://example.com/\"") +}) +/* eslint-enable */ diff --git a/test/parallel/test-whatwg-url-tostringtag.js b/test/parallel/test-whatwg-url-tostringtag.js new file mode 100644 index 00000000000000..689056fd238dda --- /dev/null +++ b/test/parallel/test-whatwg-url-tostringtag.js @@ -0,0 +1,32 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const URL = require('url').URL; + +// Tests below are not from WPT. +const toString = Object.prototype.toString; + +const url = new URL('http://example.org'); +const sp = url.searchParams; +const spIterator = sp.entries(); + +const test = [ + [url, 'URL'], + [sp, 'URLSearchParams'], + [spIterator, 'URLSearchParamsIterator'], + // Web IDL spec says we have to return 'URLPrototype', but it is too + // expensive to implement; therefore, use Chrome's behavior for now, until + // spec is changed. + [Object.getPrototypeOf(url), 'URL'], + [Object.getPrototypeOf(sp), 'URLSearchParams'], + [Object.getPrototypeOf(spIterator), 'URLSearchParamsIterator'], +]; + +test.forEach(([obj, expected]) => { + assert.strictEqual(obj[Symbol.toStringTag], expected, + `${obj[Symbol.toStringTag]} !== ${expected}`); + const str = toString.call(obj); + assert.strictEqual(str, `[object ${expected}]`, + `${str} !== [object ${expected}]`); +}); diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index c2bca80641152e..ee50d48f61d45e 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -38,6 +38,8 @@ const typeMap = { 'http.IncomingMessage': 'http.html#http_class_http_incomingmessage', 'http.Server': 'http.html#http_class_http_server', 'http.ServerResponse': 'http.html#http_class_http_serverresponse', + 'URL': 'url.html#url_the_whatwg_url_api', + 'URLSearchParams': 'url.html#url_class_urlsearchparams' }; const arrayPart = /(?:\[])+$/; diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp index 9f6780efd18957..d5082853470982 100644 --- a/tools/icu/icu-generic.gyp +++ b/tools/icu/icu-generic.gyp @@ -83,6 +83,7 @@ 'VCCLCompilerTool': { 'RuntimeTypeInfo': 'true', 'ExceptionHandling': '1', + 'AdditionalOptions': [ '/source-charset:utf-8' ], }, }, 'configurations': { diff --git a/tools/macos-installer/pkgbuild/npm/scripts/postinstall b/tools/macos-installer/pkgbuild/npm/scripts/postinstall new file mode 100755 index 00000000000000..285ce81e58a34e --- /dev/null +++ b/tools/macos-installer/pkgbuild/npm/scripts/postinstall @@ -0,0 +1,5 @@ +#!/bin/sh + +cd /usr/local/bin || exit 1 +ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm +ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx diff --git a/tools/macos-installer/pkgbuild/npm/scripts/preinstall b/tools/macos-installer/pkgbuild/npm/scripts/preinstall new file mode 100755 index 00000000000000..848da677b4d825 --- /dev/null +++ b/tools/macos-installer/pkgbuild/npm/scripts/preinstall @@ -0,0 +1,5 @@ +#!/bin/sh + +[[ -d /usr/local/lib/node_modules/npm ]] \ + && rm -rf /usr/local/lib/node_modules/npm +exit 0 diff --git a/tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl b/tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl new file mode 100644 index 00000000000000..1157d9720816fe --- /dev/null +++ b/tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl @@ -0,0 +1,23 @@ + + + + + +

    + + diff --git a/tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl b/tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl new file mode 100644 index 00000000000000..3790894e39727d --- /dev/null +++ b/tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl @@ -0,0 +1,19 @@ + + + + + +
    +

    This package will install:

    +
      +
    • Node.js {nodeversion} to /usr/local/bin/node
    • +
    • npm {npmversion} to /usr/local/bin/npm
    • +
    +
    + + diff --git a/tools/macos-installer/productbuild/distribution.xml.tmpl b/tools/macos-installer/productbuild/distribution.xml.tmpl new file mode 100644 index 00000000000000..0b9d84701bb01a --- /dev/null +++ b/tools/macos-installer/productbuild/distribution.xml.tmpl @@ -0,0 +1,23 @@ + + + Node.js + + + + + + + + + + + + + + + node-{nodeversion}.pkg + + + + npm-{npmversion}.pkg + diff --git a/tools/osx-pkg.pmdoc/01local-contents.xml b/tools/osx-pkg.pmdoc/01local-contents.xml deleted file mode 100644 index ccbb4189961b0a..00000000000000 --- a/tools/osx-pkg.pmdoc/01local-contents.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/osx-pkg.pmdoc/01local.xml b/tools/osx-pkg.pmdoc/01local.xml deleted file mode 100644 index 537b35508bb714..00000000000000 --- a/tools/osx-pkg.pmdoc/01local.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - org.nodejs.node.pkg - 1.0 - - - - ../out/dist-osx/usr/local/ - /usr/local - - - - - installTo.isRelativeType - installTo - locationType - relocatable - installFrom.path - installTo.isAbsoluteType - identifier - parent - installTo.path - installFrom.isRelativeType - - diff --git a/tools/osx-pkg.pmdoc/02npm-contents.xml b/tools/osx-pkg.pmdoc/02npm-contents.xml deleted file mode 100644 index ccbb4189961b0a..00000000000000 --- a/tools/osx-pkg.pmdoc/02npm-contents.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/osx-pkg.pmdoc/02npm.xml b/tools/osx-pkg.pmdoc/02npm.xml deleted file mode 100644 index fca97e5c27dd11..00000000000000 --- a/tools/osx-pkg.pmdoc/02npm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - org.nodejs.npm.pkg - 1.0 - - - - ../deps/npm - /usr/local/lib/node_modules/npm - - - - - installTo.path - installFrom.isRelativeType - installTo - scripts.postinstall.isRelativeType - parent - installTo.isAbsoluteType - - - osx-pkg-postinstall.sh - - diff --git a/tools/osx-pkg.pmdoc/index.xml.tmpl b/tools/osx-pkg.pmdoc/index.xml.tmpl deleted file mode 100644 index e3b14b2112d694..00000000000000 --- a/tools/osx-pkg.pmdoc/index.xml.tmpl +++ /dev/null @@ -1,55 +0,0 @@ - - - Node.js - /Users/nodejs/Desktop/node.pkg - org.nodejs - - - - - - - - - - - - - - - - - - - ../doc/osx_installer_logo.png - ../LICENSE - - - - - - 01local.xml - 02npm.xml - properties.title - properties.userDomain - properties.anywhereDomain - properties.systemDomain -