jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1754436 - in /jmeter/trunk: src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java src/core/org/apache/jmeter/report/core/CsvSampleReader.java xdocs/changes.xml
Date Thu, 28 Jul 2016 17:36:07 GMT
Author: fschumacher
Date: Thu Jul 28 17:36:07 2016
New Revision: 1754436

URL: http://svn.apache.org/viewvc?rev=1754436&view=rev
Log:
Change encoding to UTF-8 in reports for dashboard.

Bugzilla Id: 59889

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java
    jmeter/trunk/src/core/org/apache/jmeter/report/core/CsvSampleReader.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java?rev=1754436&r1=1754435&r2=1754436&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java Thu Jul
28 17:36:07 2016
@@ -25,8 +25,11 @@ import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.lang3.Validate;
+import org.apache.jmeter.save.SaveService;
+import org.apache.jorphan.logging.LoggingManager;
 import org.apache.jorphan.util.JOrphanUtils;
 
 /**
@@ -45,7 +48,9 @@ abstract public class AbstractSampleWrit
 
     private static final int BUF_SIZE = 10000;
 
-    private static final String CHARSET = "ISO8859-1";
+    private static final String CHARSET = SaveService.getFileEncoding(StandardCharsets.UTF_8.displayName());
+    
+    private static org.apache.log.Logger log = LoggingManager.getLoggerForClass();
 
     /** output writer to write samples to */
     protected PrintWriter writer;
@@ -72,7 +77,8 @@ abstract public class AbstractSampleWrit
 
     /**
      * Instructs this sample writer to write samples on the specified output
-     * with ISO8859-1 encoding
+     * with UTG-8 encoding. The encoding can be overriden by the user through
+     * {@link SaveService#getFileEncoding(String)}
      * 
      * @param out
      *            The output stream on which sample should be written
@@ -83,7 +89,7 @@ abstract public class AbstractSampleWrit
         try {
             setWriter(new OutputStreamWriter(out, CHARSET));
         } catch (UnsupportedEncodingException e) {
-            // ignore iso8859-1 always supported
+            log.warn("Unsupported CHARSET: " + CHARSET, e);
         }
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/CsvSampleReader.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/CsvSampleReader.java?rev=1754436&r1=1754435&r2=1754436&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/CsvSampleReader.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/CsvSampleReader.java Thu Jul 28 17:36:07
2016
@@ -25,9 +25,11 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.jmeter.samplers.SampleSaveConfiguration;
 import org.apache.jmeter.save.CSVSaveService;
+import org.apache.jmeter.save.SaveService;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.jorphan.util.JOrphanUtils;
@@ -46,7 +48,7 @@ public class CsvSampleReader implements
     private static final Logger LOG = LoggingManager.getLoggerForClass();
     private static final int BUF_SIZE = 10000;
 
-    private static final String CHARSET = "ISO8859-1";
+    private static final String CHARSET = SaveService.getFileEncoding(StandardCharsets.UTF_8.displayName());
 
     private static final char DEFAULT_SEPARATOR =
             JMeterUtils.getPropDefault("jmeter.save.saveservice.default_delimiter", ",").charAt(0);
//$NON-NLS-1$ //$NON-NLS-2$

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1754436&r1=1754435&r2=1754436&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Jul 28 17:36:07 2016
@@ -175,6 +175,7 @@ Summary
     <li><bug>59722</bug>Use StandardCharsets to reduce the possibility
of misspelling Charset names.</li>
     <li><bug>59723</bug>Use jmeter.properties for testing whenever possible</li>
     <li><bug>59726</bug>Unit test to check that CSV header text and sample
format don't change unexpectedly</li>
+    <li><bug>59889</bug>Change encoding to UTF-8 in reports for dashboard.</li>
 </ul>
 
  <!--  =================== Thanks =================== -->



Mime
View raw message