You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/07/16 12:33:25 UTC

[commons-net] branch master updated: Use a JRE built-in Charset instead of a magic string

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git


The following commit(s) were added to refs/heads/master by this push:
     new 876d6976 Use a JRE built-in Charset instead of a magic string
876d6976 is described below

commit 876d69767fa313e05453c1b3a22db5f9022ac6cc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 16 08:33:21 2023 -0400

    Use a JRE built-in Charset instead of a magic string
---
 src/main/java/org/apache/commons/net/imap/IMAP.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/net/imap/IMAP.java b/src/main/java/org/apache/commons/net/imap/IMAP.java
index 69fbcb43..02f055cf 100644
--- a/src/main/java/org/apache/commons/net/imap/IMAP.java
+++ b/src/main/java/org/apache/commons/net/imap/IMAP.java
@@ -23,6 +23,7 @@ import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -66,7 +67,8 @@ public class IMAP extends SocketClient {
     /**
      * The default control socket encoding.
      */
-    protected static final String __DEFAULT_ENCODING = "ISO-8859-1";
+    protected static final String __DEFAULT_ENCODING = StandardCharsets.ISO_8859_1.name();
+
     /**
      * <p>
      * Implementation of IMAPChunkListener that returns {@code true} but otherwise does nothing.