[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [onionoo/release] Use StandardCharsets.US_ASCII instead of "US-ASCII".



commit 4521ad33ba8a7eddfc3ee999aeb1bb46ef0fd859
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Wed Nov 20 12:14:53 2019 +0100

    Use StandardCharsets.US_ASCII instead of "US-ASCII".
---
 src/main/java/org/torproject/metrics/onionoo/docs/DocumentStore.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/torproject/metrics/onionoo/docs/DocumentStore.java b/src/main/java/org/torproject/metrics/onionoo/docs/DocumentStore.java
index 2963db2..78c0baa 100644
--- a/src/main/java/org/torproject/metrics/onionoo/docs/DocumentStore.java
+++ b/src/main/java/org/torproject/metrics/onionoo/docs/DocumentStore.java
@@ -20,6 +20,7 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -482,7 +483,7 @@ public class DocumentStore {
         /* Document file is empty. */
         return null;
       }
-      documentString = new String(allData, "US-ASCII");
+      documentString = new String(allData, StandardCharsets.US_ASCII);
       this.retrievedFiles++;
       this.retrievedBytes += documentString.length();
     } catch (IOException e) {
@@ -765,7 +766,7 @@ public class DocumentStore {
       throws IOException {
     try (BufferedOutputStream bos = new BufferedOutputStream(
         new FileOutputStream(file))) {
-      bos.write(content.getBytes("US-ASCII"));
+      bos.write(content.getBytes(StandardCharsets.US_ASCII));
     }
   }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits