Bug 55852

Summary: Be more lenient in parsing when charset value is surrounded with single quotes
Product: JMeter - Now in Github Reporter: lenieto3 <lenieco>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: lenieco, p.mouawad
Priority: P2    
Version: 2.10   
Target Milestone: ---   
Hardware: All   
OS: All   

Description lenieto3 2013-12-06 14:55:12 UTC
When using proxy for recording traffic, if any request has specified a charset in single-quotes it produces java.nio.charset.IllegalCharsetNameException.

If request is something like this:

<meta http-equiv="Content-Type" content="text/html;charset='UTF-8'">

The following exception occurs:

2013/12/04 14:08:48 ERROR - jmeter.protocol.http.proxy.Proxy: Not implemented (probably used https) java.nio.charset.IllegalCharsetNameException: 'UTF-8'
	at java.nio.charset.Charset.checkName(Charset.java:284)
	at java.nio.charset.Charset.lookup2(Charset.java:458)
	at java.nio.charset.Charset.lookup(Charset.java:437)
	at java.nio.charset.Charset.isSupported(Charset.java:479)
	at org.apache.jmeter.protocol.http.util.ConversionUtils.getEncodingFromContentType(ConversionUtils.java:73)
	at org.apache.jmeter.protocol.http.proxy.Proxy.addPageEncoding(Proxy.java:493)
	at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:215)
Comment 1 Sebb 2013-12-06 19:15:48 UTC
Additionally, the Proxy class should catch IllegalCharsetNameException, log a warning and then treat it the same as an unsupported charset.
Comment 2 Philippe Mouawad 2013-12-06 20:04:03 UTC
Date: Fri Dec  6 20:03:20 2013
New Revision: 1548710

URL: http://svn.apache.org/r1548710
Log:
Bug 55852 - Be more lenient in parsing when charset value is surrounded with single quotes
Bugzilla Id: 55852

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 The ASF infrastructure team 2022-09-24 20:37:56 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3281