1 | if (inputLength-- > 0)↵ | | 1 | if (inputLength-- > 0)↵
|
2 | {↵ | | 2 | {↵
|
3 | ch = input.charAt(inputPos++); ↵ | | 3 | ch = input.charAt(inputPos++); ↵
|
4 | if (XMLChar.isLowSurrogate(ch))↵ | | 4 | if (XMLChar.isLowSurrogate(ch))↵
|
5 | {↵ | | 5 | {↵
|
6 | if (mappableLimit == MAX_UTF_MAPPABLE_CODEPOINT)↵ | | 6 | if (mappableLimit == MAX_UTF_MAPPABLE_CODEPOINT)↵
|
7 | {↵ | | 7 | {↵
|
8 | // Every codepoint is supported! ↵ | | 8 | // Every codepoint is supported! ↵
|
9 | value[outputPos++] = high;↵ | | 9 | value[outputPos++] = high;↵
|
10 | value[outputPos++] = ch;↵ | | 10 | value[outputPos++] = ch;↵
|
11 | }↵ | | 11 | }↵
|
12 | else↵ | | 12 | else↵
|
13 | {↵ | | 13 | {↵
|
14 | // Produce the supplemental character as an entity↵ | | 14 | // Produce the supplemental character as an entity↵
|
15 | outputPos = replaceChars(outputPos, ("" + Integer.toHexString(XMLChar.supplemental(high, ch)) + ";").toCharArray(), inputLength);↵ | | 15 | outputPos = replaceChars(outputPos, ("" + Integer.toHexString(XMLChar.supplemental(high, ch)) + ";").toCharArray(), inputLength);↵
|
16 | changed = true;↵ | | 16 | changed = true;↵
|
17 | }↵ | | 17 | }↵
|
18 | break;↵ | | 18 | break;↵
|
19 | }↵ | | 19 | }↵
|
20 | throw new RuntimeException("An invalid low surrogate character (Unicode: 0x" + Integer.toHexString(ch) + ") was found in the element content:" + input);↵ | | 20 | throw new RuntimeException("An invalid low surrogate character (Unicode: 0x" + Integer.toHexString(ch) + ") was found in the element content:" + input);↵
|
21 | }↵ | | 21 | }↵
|
22 | else↵ | | 22 | else↵
|
23 | {↵ | | 23 | {↵
|
24 | throw new RuntimeException("An unpaired high surrogate character (Unicode: 0x" + Integer.toHexString(ch) + ") was found in the element content:" + input);↵ | | 24 | throw new RuntimeException("An unpaired high surrogate character (Unicode: 0x" + Integer.toHexString(ch) + ") was found in the element content:" + input);↵
|
25 | } | | 25 | }
|