HTTP default encoding is ISO-8859-1; use default encoding if blank

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@595493 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 50265a75c6
This commit is contained in:
Sebastian Bazley 2007-11-15 23:54:00 +00:00
parent 0f187c9160
commit 7ee6947c5b
3 changed files with 8 additions and 3 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -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.
</li>
<li>Default HTTPSampleResult to ISO-8859-1 encoding</li>
<li>Fix default encoding for blank encoding</li>
</ul>
<h4>Improvements</h4>