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

[tor-commits] [metrics-web/master] Preserve UTF-8 encoding of table data.



commit 50ae3c4579709fca8e95bfcab136a21de5acfe70
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Wed Feb 7 17:35:02 2018 +0100

    Preserve UTF-8 encoding of table data.
    
    Fixes #25167.
---
 src/main/java/org/torproject/metrics/web/RObjectGenerator.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/metrics/web/RObjectGenerator.java b/src/main/java/org/torproject/metrics/web/RObjectGenerator.java
index 06177bf..c7d0041 100644
--- a/src/main/java/org/torproject/metrics/web/RObjectGenerator.java
+++ b/src/main/java/org/torproject/metrics/web/RObjectGenerator.java
@@ -14,6 +14,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -222,7 +223,7 @@ public class RObjectGenerator implements ServletContextListener {
     /* Write the table content to a map. */
     List<Map<String, String>> result = new ArrayList<>();
     try (BufferedReader br = new BufferedReader(new InputStreamReader(
-        new ByteArrayInputStream(tableBytes)))) {
+        new ByteArrayInputStream(tableBytes), StandardCharsets.UTF_8))) {
       String line = br.readLine();
       if (line != null) {
         List<String> headers = new ArrayList<>(Arrays.asList(line.split(",")));

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