You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2007/11/16 00:54:01 UTC

svn commit: r595493 - in /jakarta/jmeter/trunk: src/core/org/apache/jmeter/samplers/SampleResult.java src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java xdocs/changes.xml

Author: sebb
Date: Thu Nov 15 15:54:00 2007
New Revision: 595493

URL: http://svn.apache.org/viewvc?rev=595493&view=rev
Log:
HTTP default encoding is ISO-8859-1; use default encoding if blank

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java?rev=595493&r1=595492&r2=595493&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java Thu Nov 15 15:54:00 2007
@@ -43,7 +43,9 @@
  */
 public class SampleResult implements Serializable {
 
-    // Needs to be accessible from Test code
+    public static final String DEFAULT_HTTP_ENCODING = "ISO-8859-1";  // $NON-NLS-1$
+
+	// Needs to be accessible from Test code
     static final Logger log = LoggingManager.getLoggerForClass();
 
 	// Bug 33196 - encoding ISO-8859-1 is only suitable for Western countries
@@ -53,7 +55,7 @@
     // needs to be accessible from test code
 	static final String DEFAULT_ENCODING 
             = JMeterUtils.getPropDefault("sampleresult.default.encoding", // $NON-NLS-1$
-			"ISO-8859-1"); // $NON-NLS-1$
+			DEFAULT_HTTP_ENCODING);
 
 	/**
 	 * Data type value indicating that the response data is text.
@@ -612,7 +614,7 @@
 	 * Returns the dataEncoding or the default if no dataEncoding was provided
 	 */
 	public String getDataEncodingWithDefault() {
-		if (dataEncoding != null) {
+		if (dataEncoding != null && dataEncoding.length() > 0) {
 			return dataEncoding;
 		}
 		return DEFAULT_ENCODING;

Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java?rev=595493&r1=595492&r2=595493&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java Thu Nov 15 15:54:00 2007
@@ -40,6 +40,7 @@
 
 	public HTTPSampleResult() {
 		super();
+		setDataEncoding(DEFAULT_HTTP_ENCODING); // default if encoding not provided be the page
 	}
 
 	public HTTPSampleResult(long elapsed) {

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=595493&r1=595492&r2=595493&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Thu Nov 15 15:54:00 2007
@@ -62,6 +62,8 @@
 Fix SamplingStatCalculator so it no longer adds elapsed time to endTime, as this is handled by SampleResult.
 This corrects discrepancies between Summary Report and Aggregate Report throughput calculation.
 </li>
+<li>Default HTTPSampleResult to ISO-8859-1 encoding</li>
+<li>Fix default encoding for blank encoding</li>
 </ul>
 
 <h4>Improvements</h4>



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org