deps: ICU 59.1 bump
* No feature changes. * Bug fixes. * Details: http://site.icu-project.org/download/59 Fixes: https://github.com/nodejs/node/issues/12077 PR-URL: https://github.com/nodejs/node/pull/12486 Refs: https://github.com/nodejs/node/issues/7844 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
parent
147048a0d3
commit
5d0a770c12
2
LICENSE
2
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
|
||||
|
4
configure
vendored
4
configure
vendored
@ -1043,8 +1043,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/59.1/icu4c-59_1-src.zip',
|
||||
'md5': '29a41f9bb576b06c7eef0487a84a7674',
|
||||
},
|
||||
]
|
||||
def icu_download(path):
|
||||
|
2
deps/icu-small/LICENSE
vendored
2
deps/icu-small/LICENSE
vendored
@ -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
|
||||
|
4
deps/icu-small/README-SMALL-ICU.txt
vendored
4
deps/icu-small/README-SMALL-ICU.txt
vendored
@ -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 59 source files with the following exception(s):
|
||||
* deps/icu-small/source/data/in/icudt59l.dat : Reduced-size data file
|
||||
|
||||
|
||||
To rebuild this directory, see ../../tools/icu/README.md
|
||||
|
4
deps/icu-small/source/common/appendable.cpp
vendored
4
deps/icu-small/source/common/appendable.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
4
deps/icu-small/source/common/bmpset.cpp
vendored
4
deps/icu-small/source/common/bmpset.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
4
deps/icu-small/source/common/bmpset.h
vendored
4
deps/icu-small/source/common/bmpset.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/brkeng.cpp
vendored
2
deps/icu-small/source/common/brkeng.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
************************************************************************************
|
||||
|
2
deps/icu-small/source/common/brkeng.h
vendored
2
deps/icu-small/source/common/brkeng.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/**
|
||||
************************************************************************************
|
||||
|
2
deps/icu-small/source/common/brkiter.cpp
vendored
2
deps/icu-small/source/common/brkiter.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
2
deps/icu-small/source/common/bytestream.cpp
vendored
2
deps/icu-small/source/common/bytestream.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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.
|
||||
|
4
deps/icu-small/source/common/bytestrie.cpp
vendored
4
deps/icu-small/source/common/bytestrie.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
6
deps/icu-small/source/common/caniter.cpp
vendored
6
deps/icu-small/source/common/caniter.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/chariter.cpp
vendored
2
deps/icu-small/source/common/chariter.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
5
deps/icu-small/source/common/charstr.cpp
vendored
5
deps/icu-small/source/common/charstr.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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"
|
||||
|
2
deps/icu-small/source/common/charstr.h
vendored
2
deps/icu-small/source/common/charstr.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
2
deps/icu-small/source/common/cmemory.h
vendored
2
deps/icu-small/source/common/cmemory.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
4
deps/icu-small/source/common/cpputils.h
vendored
4
deps/icu-small/source/common/cpputils.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*/
|
||||
|
2
deps/icu-small/source/common/cstr.cpp
vendored
2
deps/icu-small/source/common/cstr.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
2
deps/icu-small/source/common/cstr.h
vendored
2
deps/icu-small/source/common/cstr.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
2
deps/icu-small/source/common/cstring.h
vendored
2
deps/icu-small/source/common/cstring.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
4
deps/icu-small/source/common/cwchar.h
vendored
4
deps/icu-small/source/common/cwchar.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
21
deps/icu-small/source/common/dictbe.cpp
vendored
21
deps/icu-small/source/common/dictbe.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/**
|
||||
*******************************************************************************
|
||||
@ -1385,12 +1385,25 @@ 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;
|
||||
}
|
||||
|
||||
// inString goes out of scope
|
||||
|
2
deps/icu-small/source/common/dictbe.h
vendored
2
deps/icu-small/source/common/dictbe.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/**
|
||||
*******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
2
deps/icu-small/source/common/dtintrv.cpp
vendored
2
deps/icu-small/source/common/dtintrv.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
346
deps/icu-small/source/common/edits.cpp
vendored
Normal file
346
deps/icu-small/source/common/edits.cpp
vendored
Normal file
@ -0,0 +1,346 @@
|
||||
// © 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;
|
||||
|
||||
// 0wwwcccccccccccc with w=1..6 records ccc+1 replacements of w:w text units.
|
||||
// No length change.
|
||||
const int32_t MAX_SHORT_WIDTH = 6;
|
||||
const int32_t MAX_SHORT_CHANGE_LENGTH = 0xfff;
|
||||
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
|
||||
|
||||
Edits::~Edits() {
|
||||
if(array != stackArray) {
|
||||
uprv_free(array);
|
||||
}
|
||||
}
|
||||
|
||||
void Edits::reset() {
|
||||
length = delta = 0;
|
||||
}
|
||||
|
||||
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 == newLength && 0 < oldLength && oldLength <= MAX_SHORT_WIDTH) {
|
||||
// Replacement of short oldLength text units by same-length new text.
|
||||
// Merge into previous short-replacement record, if any.
|
||||
int32_t last = lastUnit();
|
||||
if(MAX_UNCHANGED < last && last < MAX_SHORT_CHANGE &&
|
||||
(last >> 12) == oldLength && (last & 0xfff) < MAX_SHORT_CHANGE_LENGTH) {
|
||||
setLastUnit(last + 1);
|
||||
return;
|
||||
}
|
||||
append(oldLength << 12);
|
||||
return;
|
||||
}
|
||||
|
||||
if(oldLength < 0 || newLength < 0) {
|
||||
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
if (oldLength == 0 && newLength == 0) {
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
if (array != stackArray) {
|
||||
uprv_free(array);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
UBool Edits::hasChanges() const {
|
||||
if (delta != 0) {
|
||||
return TRUE;
|
||||
}
|
||||
for (int32_t i = 0; i < length; ++i) {
|
||||
if (array[i] > MAX_UNCHANGED) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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),
|
||||
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::updateIndexes() {
|
||||
srcIndex += oldLength_;
|
||||
if (changed) {
|
||||
replIndex += newLength_;
|
||||
}
|
||||
destIndex += newLength_;
|
||||
}
|
||||
|
||||
UBool Edits::Iterator::noNext() {
|
||||
// No change beyond the string.
|
||||
changed = FALSE;
|
||||
oldLength_ = newLength_ = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
||||
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.
|
||||
updateIndexes();
|
||||
if (remaining > 0) {
|
||||
// Fine-grained iterator: Continue a sequence of equal-length changes.
|
||||
--remaining;
|
||||
return TRUE;
|
||||
}
|
||||
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) {
|
||||
updateIndexes();
|
||||
if (index >= length) {
|
||||
return noNext();
|
||||
}
|
||||
// already fetched u > MAX_UNCHANGED at index
|
||||
++index;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
changed = TRUE;
|
||||
if (u <= MAX_SHORT_CHANGE) {
|
||||
if (coarse) {
|
||||
int32_t w = u >> 12;
|
||||
int32_t len = (u & 0xfff) + 1;
|
||||
oldLength_ = newLength_ = len * w;
|
||||
} else {
|
||||
// Split a sequence of equal-length changes that was compressed into one unit.
|
||||
oldLength_ = newLength_ = u >> 12;
|
||||
remaining = u & 0xfff;
|
||||
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 w = u >> 12;
|
||||
int32_t len = (u & 0xfff) + 1;
|
||||
len = len * w;
|
||||
oldLength_ += len;
|
||||
newLength_ += len;
|
||||
} else {
|
||||
U_ASSERT(u <= 0x7fff);
|
||||
int32_t oldLen = readLength((u >> 6) & 0x3f);
|
||||
int32_t newLen = readLength(u & 0x3f);
|
||||
oldLength_ += oldLen;
|
||||
newLength_ += newLen;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UBool Edits::Iterator::findSourceIndex(int32_t i, UErrorCode &errorCode) {
|
||||
if (U_FAILURE(errorCode) || i < 0) { return FALSE; }
|
||||
if (i < srcIndex) {
|
||||
// Reset the iterator to the start.
|
||||
index = remaining = oldLength_ = newLength_ = srcIndex = replIndex = destIndex = 0;
|
||||
} else if (i < (srcIndex + oldLength_)) {
|
||||
// The index is in the current span.
|
||||
return TRUE;
|
||||
}
|
||||
while (next(FALSE, errorCode)) {
|
||||
if (i < (srcIndex + oldLength_)) {
|
||||
// The index is in the current span.
|
||||
return TRUE;
|
||||
}
|
||||
if (remaining > 0) {
|
||||
// Is the index in one of the remaining compressed edits?
|
||||
// srcIndex is the start of the current span, before the remaining ones.
|
||||
int32_t len = (remaining + 1) * oldLength_;
|
||||
if (i < (srcIndex + len)) {
|
||||
int32_t n = (i - srcIndex) / oldLength_; // 1 <= n <= remaining
|
||||
len = n * oldLength_;
|
||||
srcIndex += len;
|
||||
replIndex += len;
|
||||
destIndex += len;
|
||||
remaining -= n;
|
||||
return TRUE;
|
||||
}
|
||||
// Make next() skip all of these edits at once.
|
||||
oldLength_ = newLength_ = len;
|
||||
remaining = 0;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
4
deps/icu-small/source/common/errorcode.cpp
vendored
4
deps/icu-small/source/common/errorcode.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
4
deps/icu-small/source/common/filteredbrk.cpp
vendored
4
deps/icu-small/source/common/filteredbrk.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/hash.h
vendored
2
deps/icu-small/source/common/hash.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
2
deps/icu-small/source/common/icuplug.cpp
vendored
2
deps/icu-small/source/common/icuplug.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
2
deps/icu-small/source/common/icuplugimp.h
vendored
2
deps/icu-small/source/common/icuplugimp.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
deps/icu-small/source/common/listformatter.cpp
vendored
128
deps/icu-small/source/common/listformatter.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
||||
@ -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);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
@ -232,6 +232,7 @@ Normalizer2::getInstance(const char *packageName,
|
||||
}
|
||||
}
|
||||
if(allModes==NULL) {
|
||||
ucln_common_registerCleanup(UCLN_COMMON_LOADED_NORMALIZER2, uprv_loaded_normalizer2_cleanup);
|
||||
LocalPointer<Norm2AllModes> localAllModes(
|
||||
Norm2AllModes::createInstance(packageName, name, errorCode));
|
||||
if(U_SUCCESS(errorCode)) {
|
||||
|
2
deps/icu-small/source/common/localsvc.h
vendored
2
deps/icu-small/source/common/localsvc.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
***************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/locbased.cpp
vendored
2
deps/icu-small/source/common/locbased.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
2
deps/icu-small/source/common/locbased.h
vendored
2
deps/icu-small/source/common/locbased.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
3
deps/icu-small/source/common/locdspnm.cpp
vendored
3
deps/icu-small/source/common/locdspnm.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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"
|
||||
|
3
deps/icu-small/source/common/locid.cpp
vendored
3
deps/icu-small/source/common/locid.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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"
|
||||
|
5
deps/icu-small/source/common/loclikely.cpp
vendored
5
deps/icu-small/source/common/loclikely.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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"
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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 <windows.h>
|
||||
#include <winnls.h>
|
||||
#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) {
|
||||
@ -213,6 +216,7 @@ ILCID_POSIX_SUBTABLE(ca) {
|
||||
ILCID_POSIX_ELEMENT_ARRAY(0x0483, co, co_FR)
|
||||
ILCID_POSIX_ELEMENT_ARRAY(0x045c, chr,chr_US)
|
||||
|
||||
// ICU has chosen different names for these.
|
||||
ILCID_POSIX_SUBTABLE(ckb) {
|
||||
{0x92, "ckb"},
|
||||
{0x7c92, "ckb_Arab"},
|
||||
@ -225,6 +229,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 +244,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 +262,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_VI"}, /* Virgin Islands AKA Caribbean Islands (en_CB). On Windows8+ This is 0x1000 or dynamically assigned */
|
||||
{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. */
|
||||
{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 +304,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 +317,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) */
|
||||
@ -501,8 +509,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 */
|
||||
@ -591,6 +600,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"}
|
||||
};
|
||||
@ -730,6 +742,8 @@ ILCID_POSIX_ELEMENT_ARRAY(0x0434, xh, xh_ZA)
|
||||
ILCID_POSIX_ELEMENT_ARRAY(0x043d, yi, yi)
|
||||
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 +767,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 +1006,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 +1032,56 @@ 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
|
||||
// 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
|
||||
char locName[LOCALE_NAME_MAX_LENGTH]; // ICU name can't be longer than Windows name
|
||||
|
||||
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);
|
||||
@ -1101,15 +1129,101 @@ 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
|
||||
int32_t bcp47Len = 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<wchar_t>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#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;
|
5
deps/icu-small/source/common/locmap.h
vendored
5
deps/icu-small/source/common/locmap.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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 */
|
||||
|
4
deps/icu-small/source/common/locresdata.cpp
vendored
4
deps/icu-small/source/common/locresdata.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/locutil.cpp
vendored
2
deps/icu-small/source/common/locutil.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
2
deps/icu-small/source/common/locutil.h
vendored
2
deps/icu-small/source/common/locutil.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/**
|
||||
*******************************************************************************
|
||||
|
4
deps/icu-small/source/common/messageimpl.h
vendored
4
deps/icu-small/source/common/messageimpl.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/msvcres.h
vendored
2
deps/icu-small/source/common/msvcres.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/mutex.h
vendored
2
deps/icu-small/source/common/mutex.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/norm2allmodes.h
vendored
2
deps/icu-small/source/common/norm2allmodes.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
4
deps/icu-small/source/common/normalizer2.cpp
vendored
4
deps/icu-small/source/common/normalizer2.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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.h
|
||||
* encoding: US-ASCII
|
||||
* encoding: UTF-8
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
@ -176,7 +176,7 @@ public:
|
||||
lastCC=0;
|
||||
}
|
||||
void copyReorderableSuffixTo(UnicodeString &s) const {
|
||||
s.setTo(reorderStart, (int32_t)(limit-reorderStart));
|
||||
s.setTo(ConstChar16Ptr(reorderStart), (int32_t)(limit-reorderStart));
|
||||
}
|
||||
private:
|
||||
/*
|
||||
|
12
deps/icu-small/source/common/normlzr.cpp
vendored
12
deps/icu-small/source/common/normlzr.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*************************************************************************
|
||||
@ -23,6 +23,12 @@
|
||||
#include "normalizer2impl.h"
|
||||
#include "uprops.h" // for uniset_getUnicode32Instance()
|
||||
|
||||
#if defined(_ARM64_) && defined(move32)
|
||||
// System can define move32 intrinsics, but the char iters define move32 method
|
||||
// using same undef trick in headers, so undef here to re-enable the method.
|
||||
#undef move32
|
||||
#endif
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Normalizer)
|
||||
@ -40,7 +46,7 @@ Normalizer::Normalizer(const UnicodeString& str, UNormalizationMode mode) :
|
||||
init();
|
||||
}
|
||||
|
||||
Normalizer::Normalizer(const UChar *str, int32_t length, UNormalizationMode mode) :
|
||||
Normalizer::Normalizer(ConstChar16Ptr str, int32_t length, UNormalizationMode mode) :
|
||||
UObject(), fFilteredNorm2(NULL), fNorm2(NULL), fUMode(mode), fOptions(0),
|
||||
text(new UCharCharacterIterator(str, length)),
|
||||
currentIndex(0), nextIndex(0),
|
||||
@ -435,7 +441,7 @@ Normalizer::setText(const CharacterIterator& newText,
|
||||
}
|
||||
|
||||
void
|
||||
Normalizer::setText(const UChar* newText,
|
||||
Normalizer::setText(ConstChar16Ptr newText,
|
||||
int32_t length,
|
||||
UErrorCode &status)
|
||||
{
|
||||
|
2
deps/icu-small/source/common/parsepos.cpp
vendored
2
deps/icu-small/source/common/parsepos.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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: patternprops.cpp
|
||||
* encoding: US-ASCII
|
||||
* encoding: UTF-8
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
|
4
deps/icu-small/source/common/patternprops.h
vendored
4
deps/icu-small/source/common/patternprops.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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: patternprops.h
|
||||
* encoding: US-ASCII
|
||||
* encoding: UTF-8
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
|
2
deps/icu-small/source/common/pluralmap.cpp
vendored
2
deps/icu-small/source/common/pluralmap.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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 Corporation and
|
||||
|
2
deps/icu-small/source/common/pluralmap.h
vendored
2
deps/icu-small/source/common/pluralmap.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
|
2
deps/icu-small/source/common/propname.cpp
vendored
2
deps/icu-small/source/common/propname.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
2
deps/icu-small/source/common/propname.h
vendored
2
deps/icu-small/source/common/propname.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
2
deps/icu-small/source/common/propname_data.h
vendored
2
deps/icu-small/source/common/propname_data.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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.c
|
||||
* encoding: US-ASCII
|
||||
* encoding: UTF-8
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
@ -499,6 +499,8 @@ upvec_compactToUTrie2Handler(void *context,
|
||||
UChar32 start, UChar32 end,
|
||||
int32_t rowIndex, uint32_t *row, int32_t columns,
|
||||
UErrorCode *pErrorCode) {
|
||||
(void)row;
|
||||
(void)columns;
|
||||
UPVecToUTrie2Context *toUTrie2=(UPVecToUTrie2Context *)context;
|
||||
if(start<UPVEC_FIRST_SPECIAL_CP) {
|
||||
utrie2_setRange32(toUTrie2->trie, start, end, (uint32_t)rowIndex, TRUE, pErrorCode);
|
4
deps/icu-small/source/common/propsvec.h
vendored
4
deps/icu-small/source/common/propsvec.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
4
deps/icu-small/source/common/punycode.cpp
vendored
4
deps/icu-small/source/common/punycode.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
4
deps/icu-small/source/common/punycode.h
vendored
4
deps/icu-small/source/common/punycode.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
286
deps/icu-small/source/common/putil.cpp
vendored
286
deps/icu-small/source/common/putil.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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 <time.h>
|
||||
|
||||
#if !U_PLATFORM_USES_ONLY_WIN32_API
|
||||
#include <sys/time.h>
|
||||
#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 <windows.h>
|
||||
# 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 <Windows.Globalization.h>
|
||||
#include <windows.system.userprofile.h>
|
||||
#include <wrl\wrappers\corewrappers.h>
|
||||
#include <wrl\client.h>
|
||||
|
||||
using namespace ABI::Windows::Foundation;
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Microsoft::WRL::Wrappers;
|
||||
#endif
|
||||
#elif U_PLATFORM == U_PF_OS400
|
||||
# include <float.h>
|
||||
# include <qusec.h> /* error code structure */
|
||||
@ -104,20 +135,6 @@
|
||||
# include <sys/neutrino.h>
|
||||
#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 <time.h>
|
||||
|
||||
#if !U_PLATFORM_USES_ONLY_WIN32_API
|
||||
#include <sys/time.h>
|
||||
#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,7 +668,7 @@ 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
|
||||
@ -1008,16 +1025,65 @@ 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<IInspectable> calendar;
|
||||
HRESULT hr = RoActivateInstance(
|
||||
HStringReference(RuntimeClass_Windows_Globalization_Calendar).Get(),
|
||||
&calendar);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
ComPtr<ABI::Windows::Globalization::ITimeZoneOnCalendar> timezone;
|
||||
hr = calendar.As(&timezone);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
HString timezoneString;
|
||||
hr = timezone->GetTimeZone(timezoneString.GetAddressOf());
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
int32_t length = 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)
|
||||
{
|
||||
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
|
||||
@ -1162,7 +1228,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 char *gCorrectedPOSIXLocale = NULL; /* Sometimes heap allocated */
|
||||
static bool gCorrectedPOSIXLocaleHeapAllocated = false;
|
||||
#endif
|
||||
|
||||
static UBool U_CALLCONV putil_cleanup(void)
|
||||
@ -1183,9 +1250,10 @@ static UBool U_CALLCONV putil_cleanup(void)
|
||||
#endif
|
||||
|
||||
#if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API
|
||||
if (gCorrectedPOSIXLocale) {
|
||||
if (gCorrectedPOSIXLocale && gCorrectedPOSIXLocaleHeapAllocated) {
|
||||
uprv_free(gCorrectedPOSIXLocale);
|
||||
gCorrectedPOSIXLocale = NULL;
|
||||
gCorrectedPOSIXLocaleHeapAllocated = false;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
@ -1297,7 +1365,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 +1396,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);
|
||||
@ -1366,7 +1462,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 +1704,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 +1720,115 @@ 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<char *>(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<ABI::Windows::Foundation::Collections::IVectorView<HSTRING>> languageList;
|
||||
|
||||
ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> 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<ABI::Windows::System::UserProfile::IGlobalizationPreferencesStatics> 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<char>(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
|
||||
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 +2115,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];
|
||||
|
10
deps/icu-small/source/common/putilimp.h
vendored
10
deps/icu-small/source/common/putilimp.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
******************************************************************************
|
||||
@ -87,7 +87,7 @@ typedef size_t uintptr_t;
|
||||
|
||||
#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 +106,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
|
||||
@ -141,7 +144,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
|
||||
|
2
deps/icu-small/source/common/rbbi.cpp
vendored
2
deps/icu-small/source/common/rbbi.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
***************************************************************************
|
||||
|
2
deps/icu-small/source/common/rbbidata.cpp
vendored
2
deps/icu-small/source/common/rbbidata.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
***************************************************************************
|
||||
|
4
deps/icu-small/source/common/rbbidata.h
vendored
4
deps/icu-small/source/common/rbbidata.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/rbbinode.cpp
vendored
2
deps/icu-small/source/common/rbbinode.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
***************************************************************************
|
||||
|
2
deps/icu-small/source/common/rbbinode.h
vendored
2
deps/icu-small/source/common/rbbinode.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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:
|
||||
|
2
deps/icu-small/source/common/rbbirb.cpp
vendored
2
deps/icu-small/source/common/rbbirb.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/rbbirb.h
vendored
2
deps/icu-small/source/common/rbbirb.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/rbbirpt.h
vendored
2
deps/icu-small/source/common/rbbirpt.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
//---------------------------------------------------------------------------------
|
||||
//
|
||||
|
9
deps/icu-small/source/common/rbbiscan.cpp
vendored
9
deps/icu-small/source/common/rbbiscan.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
@ -1179,13 +1179,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;
|
||||
|
2
deps/icu-small/source/common/rbbiscan.h
vendored
2
deps/icu-small/source/common/rbbiscan.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/rbbisetb.cpp
vendored
2
deps/icu-small/source/common/rbbisetb.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/rbbisetb.h
vendored
2
deps/icu-small/source/common/rbbisetb.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/rbbistbl.cpp
vendored
2
deps/icu-small/source/common/rbbistbl.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/rbbitblb.cpp
vendored
2
deps/icu-small/source/common/rbbitblb.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
2
deps/icu-small/source/common/rbbitblb.h
vendored
2
deps/icu-small/source/common/rbbitblb.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
|
2
deps/icu-small/source/common/resbund.cpp
vendored
2
deps/icu-small/source/common/resbund.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
4
deps/icu-small/source/common/resbund_cnv.cpp
vendored
4
deps/icu-small/source/common/resbund_cnv.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 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
|
||||
*
|
||||
|
2
deps/icu-small/source/common/resource.cpp
vendored
2
deps/icu-small/source/common/resource.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
2
deps/icu-small/source/common/resource.h
vendored
2
deps/icu-small/source/common/resource.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
*******************************************************************************
|
||||
|
2
deps/icu-small/source/common/ruleiter.cpp
vendored
2
deps/icu-small/source/common/ruleiter.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
2
deps/icu-small/source/common/ruleiter.h
vendored
2
deps/icu-small/source/common/ruleiter.h
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
// © 2016 and later: Unicode, Inc. and others.
|
||||
// License & terms of use: http://www.unicode.org/copyright.html
|
||||
/*
|
||||
**********************************************************************
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user