Commit 6806a4a6 authored by Emmanuel Bourg's avatar Emmanuel Bourg

New upstream version 60.1

parent 01adefd1
This diff is collapsed.
......@@ -4,8 +4,9 @@
#* Copyright (C) 2009-2016, International Business Machines Corporation and *
#* others. All Rights Reserved. *
#*******************************************************************************
api.report.version = 59
api.report.prev.version = 58
release.file.ver = 59_1
api.doc.version = 59.1
api.report.version = 60
api.report.prev.version = 59
release.file.ver = 60_1
api.doc.version = 60.1
maven.pom.ver = 60.1
This diff is collapsed.
This diff is collapsed.
......@@ -4,6 +4,6 @@
#* Copyright (C) 2010-2016, International Business Machines Corporation and *
#* others. All Rights Reserved. *
#*******************************************************************************
icu4j.plugin.impl.version.string=59.1.0
icu4j.plugin.impl.version.string=60.1.0
copyright.eclipse=(C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html#License
icu4j.data.version.number=59
icu4j.data.version.number=60
......@@ -9,7 +9,7 @@
<body lang="EN-US">
<h2>About This Content</h2>
<p>April 11, 2017</p>
<p>September 28, 2017</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
......@@ -32,7 +32,7 @@ did not receive this Content directly from the Eclipse Foundation, the following
for informational purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><strong>ICU4J 59.1.0 plug-in</strong></p>
<p><strong>ICU4J 60.1.0 plug-in</strong></p>
<p>The plug-in includes software (&quot;ICU4J&quot;) developed by Unicode Inc. and others.
Your use of ICU4J is subject to the terms and conditions of the ICU license. A copy of the
......
......@@ -9,7 +9,7 @@
<body lang="EN-US">
<h2>About This Content</h2>
<p>April 11, 2017</p>
<p>September 28, 2017</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
......@@ -32,7 +32,7 @@ did not receive this Content directly from the Eclipse Foundation, the following
for informational purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><strong>ICU4J 59.1.0 base plug-in</strong></p>
<p><strong>ICU4J 60.1.0 base plug-in</strong></p>
<p>The plug-in includes software (&quot;ICU4J&quot;) developed by Unicode Inc. and others.
Your use of ICU4J is subject to the terms and conditions of the ICU license. A copy of the
......
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
package com.ibm.icu.charset;
/**
* Partial Java port of ICU4C unicode/utf8.h and ustr_imp.h.
*/
class UTF8 {
/**
* Counts the trail bytes for a UTF-8 lead byte.
* Returns 0 for 0..0xc1 as well as for 0xf5..0xff.
*
* @param leadByte The first byte of a UTF-8 sequence. Must be 0..0xff.
* @return 0..3
*/
static int countTrailBytes(byte leadByte) {
if (leadByte < (byte)0xe0) {
return leadByte < (byte)0xc2 ? 0 : 1;
} else if (leadByte < (byte)0xf0) {
return 2;
} else {
return leadByte <= (byte)0xf4 ? 3 : 0;
}
}
/**
* Counts the bytes of any whole valid sequence for a UTF-8 lead byte.
* Returns 1 for ASCII 0..0x7f.
* Returns 0 for 0x80..0xc1 as well as for 0xf5..0xff.
*
* @param leadByte The first byte of a UTF-8 sequence. Must be 0..0xff.
* @return 0..4
*/
static int countBytes(byte leadByte) {
if (leadByte >= 0) {
return 1;
} else if (leadByte < (byte)0xe0) {
return leadByte < (byte)0xc2 ? 0 : 2;
} else if (leadByte < (byte)0xf0) {
return 3;
} else {
return leadByte <= (byte)0xf4 ? 4 : 0;
}
}
/**
* Internal bit vector for 3-byte UTF-8 validity check, for use in {@link #isValidLead3AndT1}.
* Each bit indicates whether one lead byte + first trail byte pair starts a valid sequence.
* Lead byte E0..EF bits 3..0 are used as data int index,
* first trail byte bits 7..5 are used as bit index into that int.
*
* @see #isValidLead3AndT1
*/
private static final int[] U8_LEAD3_T1_BITS = {
0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x10, 0x30, 0x30
};
/**
* Internal 3-byte UTF-8 validity check.
*
* @param lead E0..EF
* @param t1 00..FF
* @return true if lead byte E0..EF and first trail byte 00..FF start a valid sequence.
*/
static boolean isValidLead3AndT1(int lead, byte t1) {
return (U8_LEAD3_T1_BITS[lead & 0xf] & (1 << ((t1 & 0xff) >> 5))) != 0;
}
/**
* Internal bit vector for 4-byte UTF-8 validity check, for use in {@link #isValidLead4AndT1}.
* Each bit indicates whether one lead byte + first trail byte pair starts a valid sequence.
* Lead byte F0..F4 bits 2..0 are used as data int index,
* first trail byte bits 7..4 are used as bit index into that int.
*
* @see #isValidLead4AndT1
*/
private static final int[] U8_LEAD4_T1_BITS = {
0x0e00, 0x0f00, 0x0f00, 0x0f00, 0x0100
};
/**
* Internal 4-byte UTF-8 validity check.
*
* @param lead F0..F4
* @param t1 00..FF
* @return true if lead byte F0..F4 and first trail byte 00..FF start a valid sequence.
*/
static boolean isValidLead4AndT1(int lead, byte t1) {
return (U8_LEAD4_T1_BITS[lead & 7] & (1 << ((t1 & 0xff) >> 4))) != 0;
}
/**
* Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x7f)?
*
* @param c 8-bit code unit (byte)
* @return true if c is an ASCII byte
*/
static boolean isSingle(byte c) {
return c >= 0;
}
/**
* Is this code unit (byte) a UTF-8 lead byte?
*
* @param c 8-bit code unit (byte)
* @return true if c is a lead byte
*/
static boolean isLead(byte c) {
return ((c - 0xc2) & 0xff) <= 0x32; // 0x32=0xf4-0xc2
}
/**
* Is this code unit (byte) a UTF-8 trail byte? (0x80..0xBF)
*
* @param c 8-bit code unit (byte)
* @return true if c is a trail byte
*/
static boolean isTrail(byte c) {
return c < (byte)0xc0;
}
/**
* How many code units (bytes) are used for the UTF-8 encoding
* of this Unicode code point?
*
* @param c 32-bit code point
* @return 1..4, or 0 if c is a surrogate or not a Unicode code point
*/
static int length(int c) {
if (c >= 0) {
if (c <= 0x7f) {
return 1;
} else if (c <= 0x7ff) {
return 2;
} else if (c <= 0xd7ff) {
return 3;
} else if (c <= 0xffff) {
return c >= 0xe000 ? 3 : 0;
} else if (c <= 0x10ffff) {
return 4;
}
}
return 0;
}
/**
* 4: The maximum number of UTF-8 code units (bytes) per Unicode code point (U+0000..U+10ffff).
*/
static int MAX_LENGTH = 4;
/**
* Is t a valid UTF-8 trail byte?
*
* @param prev Must be the preceding lead byte if i==1 and length>=3;
* otherwise ignored.
* @param t The i-th byte following the lead byte.
* @param i The index (1..3) of byte t in the byte sequence. 0<i<length
* @param length The length (2..4) of the byte sequence according to the lead byte.
* @return true if t is a valid trail byte in this context.
*/
static boolean isValidTrail(int prev, byte t, int i, int length) {
// The first trail byte after a 3- or 4-byte lead byte
// needs to be validated together with its lead byte.
if (length <= 2 || i > 1) {
return isTrail(t);
} else if (length == 3) {
return isValidLead3AndT1(prev, t);
} else { // length == 4
return isValidLead4AndT1(prev, t);
}
}
}
......@@ -8,7 +8,7 @@
others. All Rights Reserved.
-->
<title>C:ICU4J .charset Package Overview</title>
<title>ICU4J .com.ibm.icu.charset Package Overview</title>
</head>
<body bgcolor="white">
......
......@@ -125,25 +125,25 @@ public final class CollationFCD {
8,0,9,0xa,0,0,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0x10,
0x11,0x12,0x13,0,0,0,0x14,0x15,0,0x16,0x17,0,0,0x16,0x18,0,
0,0x16,0x18,0,0,0x16,0x18,0,0,0x16,0x18,0,0,0,0x18,0,
0,0,0x19,0,0,0x16,0x18,0,0,0,0x18,0,0,0,0x1a,0,
0,0x1b,0x1c,0,0,0x1d,0x1c,0,0x1d,0x1e,0,0x1f,0x20,0,0x21,0,
0,0x22,0,0,0x18,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x23,0,0,0,0,0,
0,0,0x19,0,0,0x16,0x18,0,0,0x1a,0x18,0,0,0,0x1b,0,
0,0x1c,0x1d,0,0,0x1e,0x1d,0,0x1e,0x1f,0,0x20,0x21,0,0x22,0,
0,0x23,0,0,0x18,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x24,0,0,0,0,0,
0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0x37,0x38,0,0,0x39,0,0,0,0,0,0,0,0,
0x21,0,0,0,0,0,0x2a,0x3a,0,0x3b,0x3c,0,0,0x3c,0x3d,0,
0,0,0,0,0,0x3e,0x3f,0x40,0,0,0,0,0,0,0,0x18,
0,0,0,0x38,0x39,0,0,0x3a,0,0,0,0,0,0,0,0,
0x22,0,0,0,0,0,0x2b,0x3b,0,0x3c,0x3d,0,0,0x3d,0x3e,0,
0,0,0,0,0,0x3f,0x40,0x41,0,0,0,0,0,0,0,0x18,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
......@@ -227,7 +227,7 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x41,0x42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x42,0x43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
......@@ -244,7 +244,7 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x43,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x44,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
......@@ -256,25 +256,25 @@ public final class CollationFCD {
0x1c,0x1d,0x1e,0x1f,0,0,0x20,0x21,0x22,0x23,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,
......@@ -358,7 +358,7 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x71,0x72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x72,0x73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
......@@ -375,27 +375,27 @@ public final class CollationFCD {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x3d,0x73,0x74,0,0,0,0,0,