Skip to content

Commit

Permalink
use StandardCharsets.UTF_8 const (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Mar 14, 2023
1 parent 3a572f5 commit 7fe79e9
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -6,7 +6,7 @@
import java.io.ObjectOutputStream;
import java.net.URI;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Objects;

/**
Expand Down Expand Up @@ -290,7 +290,7 @@ protected String _truncate(byte[] b, int[] offsets, int maxSnippetLen) {
_truncateOffsets(offsets, b.length);
final int start = offsets[0];
final int length = Math.min(offsets[1], maxSnippetLen);
return new String(b, start, length, Charset.forName("UTF-8"));
return new String(b, start, length, StandardCharsets.UTF_8);
}

// Method that is given alleged start/offset pair and needs to adjust
Expand Down

0 comments on commit 7fe79e9

Please sign in to comment.