New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle META tag http-equiv charset? #2038
Comments
Sebb (migrated from Bugzilla): |
Sebb (migrated from Bugzilla): rather than only processing the meta content-type if the header content-type |
benoit.wiart (migrated from Bugzilla): please note that there is no workaround to this bug because DEFAULT_HTTP_ENCODING can not be overriden with sampleresult.default.encoding |
benoit.wiart (migrated from Bugzilla): setDataEncoding(DEFAULT_HTTP_ENCODING); // default if encoding not provided be the page should probably be removed |
@pmouawad (migrated from Bugzilla): If encoding is set through header, encoding declared in meta will not be taken into account. Philippe Created attachment patch-HTTPSampleResult.patch: Path that removes encoding setting in constructor patch-HTTPSampleResult.patchIndex: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
===================================================================
--- src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java (revision 816394)
+++ src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java (working copy)
@@ -39,7 +39,7 @@
public HTTPSampleResult() {
super();
- setDataEncoding(DEFAULT_HTTP_ENCODING); // default if encoding not provided be the page
+// setDataEncoding(DEFAULT_HTTP_ENCODING); // default if encoding not provided be the page
}
public HTTPSampleResult(long elapsed) { |
Sebb (migrated from Bugzilla): Applied with further fix so ensure correct default was used. URL: http://svn.apache.org/viewvc?rev=929364&view=rev Modified: |
Sebb (Bug 43678):
The HTML tag:
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
is treated by browsers the same as the Content-Type header.
At present (JMeter 2.3) JMeter does not extract this information, it only uses
headers.
If no charset is present, then the platform default encoding (overridable by
defining sampleresult.default.encoding) is applied when converting the
response to a string.
This means that the conversion of the responseData to a string may not produce
the correct result - for example in the Tree View Listener, and presumably in
Post-Processors.
JMeter could extract the content-type from the data.
It probably needs to check that the data is intended to be used as HTML first -
i.e. the existing Content-Type should specify text/html.
Votes in Bugzilla: 1
Severity: normal
OS: other
The text was updated successfully, but these errors were encountered: