We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9de27fa commit f0eb6bdCopy full SHA for f0eb6bd
src/main/java/org/jsoup/helper/HttpConnection.java
@@ -1145,11 +1145,13 @@ private static boolean looksLikeUtf8(byte[] input) {
1145
}
1146
1147
int end;
1148
+ boolean foundNonAscii = false;
1149
for (int j = input.length; i < j; ++i) {
1150
int o = input[i];
1151
if ((o & 0x80) == 0) {
1152
continue; // ASCII
1153
1154
+ foundNonAscii = true;
1155
1156
// UTF-8 leading:
1157
if ((o & 0xE0) == 0xC0) {
@@ -1173,7 +1175,7 @@ private static boolean looksLikeUtf8(byte[] input) {
1173
1175
1174
1176
1177
- return true;
1178
+ return foundNonAscii;
1179
1180
1181
private @Nullable static String setOutputContentType(final Connection.Request req) {
0 commit comments