Summary: | Encoding of embedded element URLs depend on the file.encoding property | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Pieter Ennes <apache.org> |
Component: | HTTP | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | p.mouawad |
Priority: | P2 | ||
Version: | 2.3.4 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
Example script
Output UTF-8 Output ISO-8859-1 Content ISO-8859-1 |
Description
Pieter Ennes
2010-06-03 05:27:57 UTC
Created attachment 25513 [details]
Output UTF-8
Created attachment 25514 [details]
Output ISO-8859-1
I don't get the same problem, but it looks like the page has probably changed. If you get the same problem with another page, please save the original page contents using the Save Response to File Listener, and attach that here. Created attachment 25532 [details]
Content ISO-8859-1
That seems to lead to identical files for both charsets. (So, I'm only attaching one)
Sorry, forgot to mention that currently it can be reproduced by changing the path in the script to: http://www.rnw.nl/english/rnw_fp?page=3 And at some point this will go to page=4 etc... Using page=3 loads the image OK for me when I use file.encoding=iso-8859-1, although the request display and JTL output is not correct. If I use file.encoding=iso (invalid) then JMeter 2.3.4 does fail to load the page. Can you provide the first few lines of the jmeter.log files, upto at least jmeter.JMeter: JMeterHome ? Running with: $ LANG=en_GB.UTF-8 jmeter 2010/06/06 14:41:32 INFO - jmeter.util.JMeterUtils: Setting Locale to en_GB 2010/06/06 14:41:32 INFO - jmeter.JMeter: Copyright (c) 1998-2009 The Apache Software Foundation 2010/06/06 14:41:32 INFO - jmeter.JMeter: Version 2.3.4 2010/06/06 14:41:32 INFO - jmeter.JMeter: java.version=1.6.0_18 2010/06/06 14:41:32 INFO - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM 2010/06/06 14:41:32 INFO - jmeter.JMeter: os.name=Linux 2010/06/06 14:41:32 INFO - jmeter.JMeter: os.arch=amd64 2010/06/06 14:41:32 INFO - jmeter.JMeter: os.version=2.6.32-22-generic 2010/06/06 14:41:32 INFO - jmeter.JMeter: file.encoding=UTF-8 2010/06/06 14:41:32 INFO - jmeter.JMeter: Default Locale=English (United Kingdom) 2010/06/06 14:41:32 INFO - jmeter.JMeter: JMeter Locale=English (United Kingdom) 2010/06/06 14:41:32 INFO - jmeter.JMeter: JMeterHome=/usr/share/jmeter And both of: $ LANG=en_GB.ISO-8859-1 jmeter $ LANG=iso-8859-1 jmeter give: 2010/06/06 14:43:12 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US 2010/06/06 14:43:12 INFO - jmeter.JMeter: Copyright (c) 1998-2009 The Apache Software Foundation 2010/06/06 14:43:12 INFO - jmeter.JMeter: Version 2.3.4 2010/06/06 14:43:12 INFO - jmeter.JMeter: java.version=1.6.0_18 2010/06/06 14:43:12 INFO - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM 2010/06/06 14:43:12 INFO - jmeter.JMeter: os.name=Linux 2010/06/06 14:43:12 INFO - jmeter.JMeter: os.arch=amd64 2010/06/06 14:43:12 INFO - jmeter.JMeter: os.version=2.6.32-22-generic 2010/06/06 14:43:12 INFO - jmeter.JMeter: file.encoding=ANSI_X3.4-1968 2010/06/06 14:43:12 INFO - jmeter.JMeter: Default Locale=English (United States) 2010/06/06 14:43:12 INFO - jmeter.JMeter: JMeter Locale=English (United States) 2010/06/06 14:43:12 INFO - jmeter.JMeter: JMeterHome=/usr/share/jmeter Issue is in HtmlParserHTMLParser#getEmbeddedResourceURLs in following code: String contents = new String(html); Using this code, file.encoding of platform is used instead of page encoding. By the way, to reproduce issue , I just put : -Dfile.encoding=ANSI_X3.4-1968 I don't reproduce it by changing LANG variable because it does not lead to same encoding as bug reporter's one. Should we use: SampleResult#getDataEncoding ? And if null, default to "sampleresult.default.encoding" jmeter property ? Date: Wed Dec 28 14:33:41 2011 New Revision: 1225193 URL: http://svn.apache.org/viewvc?rev=1225193&view=rev Log: Bug 49374 - Encoding of embedded element URLs depend on the file.encoding property Now using SampleResult#getDataEncodingWithDefault() to avoid relying on file.encoding of the JVM. Modified HTMLParserTestFile_2.xml to take into account the impact of encoding change. Modified: jmeter/trunk/bin/testfiles/HTMLParserTestFile_2.xml jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/HTMLParser.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/HtmlParserHTMLParser.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/JTidyHTMLParser.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java jmeter/trunk/xdocs/changes.xml This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2372 |