Skip to content

Commit

Permalink
Cleanup UTF BOM recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
jhy committed Jul 9, 2021
1 parent 87085a8 commit cedf83c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/jsoup/helper/HttpConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,10 @@ private static String fixHeaderEncoding(String val) {
private static boolean looksLikeUtf8(byte[] input) {
int i = 0;
// BOM:
if (input.length >= 3 && (input[0] & 0xFF) == 0xEF
&& (input[1] & 0xFF) == 0xBB & (input[2] & 0xFF) == 0xBF) {
if (input.length >= 3
&& (input[0] & 0xFF) == 0xEF
&& (input[1] & 0xFF) == 0xBB
&& (input[2] & 0xFF) == 0xBF) {
i = 3;
}

Expand Down

0 comments on commit cedf83c

Please sign in to comment.