Skip to content

Commit 8ef8808

Browse files
authored
Merge pull request #386 from w3c/sideshowbarker/surrogate-replacment-in-preprocessing-drop
Don’t do surrogate replacement when preprocessing input stream
2 parents b7153af + 62d8c80 commit 8ef8808

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

org/w3c/css/util/UnescapeFilterReader.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ public int read()
3131
if (c == 0) { // U+0000 NULL
3232
return 0xfffd; // U+FFFD REPLACEMENT CHARACTER
3333
}
34-
if (c >= 0xd800 && c <= 0xdfff) { // surrogate
35-
return 0xfffd;
36-
}
3734

3835
// now specific case of CSS unicode escape for ascii values [A-Za-z0-9].
3936
if (c != '\\') {
@@ -108,8 +105,6 @@ public int read(char[] cbuf, int off, int len) throws IOException {
108105
chars[j++] = 0x000a;
109106
} else if (chars[i] == 0) {
110107
chars[j++] = 0xfffd;
111-
} else if (chars[i] >= 0xd800 && chars[i] <= 0xdfff) {
112-
chars[j++] = 0xfffd;
113108
}
114109
// escaping
115110

0 commit comments

Comments
 (0)