diff --git a/src/core/org/apache/jmeter/samplers/SampleResult.java b/src/core/org/apache/jmeter/samplers/SampleResult.java index e983af68ec..2ca098016c 100644 --- a/src/core/org/apache/jmeter/samplers/SampleResult.java +++ b/src/core/org/apache/jmeter/samplers/SampleResult.java @@ -43,7 +43,9 @@ import org.apache.log.Logger; */ 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 @@ public class SampleResult implements Serializable { // 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 @@ public class SampleResult implements Serializable { * 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; diff --git a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java index 27f5f96355..9045f0beff 100644 --- a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java +++ b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java @@ -40,6 +40,7 @@ public class HTTPSampleResult extends SampleResult { public HTTPSampleResult() { super(); + setDataEncoding(DEFAULT_HTTP_ENCODING); // default if encoding not provided be the page } public HTTPSampleResult(long elapsed) { diff --git a/xdocs/changes.xml b/xdocs/changes.xml index fdc6c750f5..e343fbf935 100644 --- a/xdocs/changes.xml +++ b/xdocs/changes.xml @@ -62,6 +62,8 @@ Filenames can now include function references; variable references do not work.< 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. +