Bug 56706 - SampleResult#getResponseDataAsString() does not use encoding in response body impacting PostProcessors and ViewResultsTree
Summary: SampleResult#getResponseDataAsString() does not use encoding in response body...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.11
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-09 21:52 UTC by Ori
Modified: 2014-07-12 12:58 UTC (History)
1 user (show)



Attachments
Http test (76.21 KB, text/plain)
2014-07-09 21:52 UTC, Ori
Details
Test results with JMeterProperties (ver 2.8) (5.17 KB, text/plain)
2014-07-09 21:55 UTC, Ori
Details
Test results with JMeterProperties (ver 2.11) (9.82 KB, text/plain)
2014-07-09 21:56 UTC, Ori
Details
Fix for Bug (875 bytes, patch)
2014-07-12 12:36 UTC, UbikLoadPack support
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ori 2014-07-09 21:52:03 UTC
Created attachment 31803 [details]
Http test

An http test running in version 2.11, display Hebrew characters as Gibberish in the "View results tree" screen.

The same test running in version 2.8 display a well Hebrew characters.
Comment 1 Ori 2014-07-09 21:55:17 UTC
Created attachment 31804 [details]
Test results with JMeterProperties (ver 2.8)
Comment 2 Ori 2014-07-09 21:56:15 UTC
Created attachment 31805 [details]
Test results with JMeterProperties (ver 2.11)
Comment 3 UbikLoadPack support 2014-07-12 12:36:59 UTC
Created attachment 31811 [details]
Fix for Bug

Hello,
Please find attached the patch that fixes the bug.
After analysis, the issue is due to PostProcessor in Test Plan.
We noticed that if you remove them from first sampler, characters will not be corrupted but if you add them they will.
After further analysis , it appeared that as SampleResult#getDataEncodingWithDefault was not overriden in HTTPSampleResult, it lead to encoding contained in html code not being used to decode response.

As we signed an CCLA code is fully property of Apache and we release any right on it.

Regards
Ubik Load Pack
http://ubikloadpack.com
@ubikloadpack
Comment 4 Philippe Mouawad 2014-07-12 12:58:16 UTC
Thanks for contribution, applied with addition of javadocs.


Date: Sat Jul 12 12:57:07 2014
New Revision: 1609912

URL: http://svn.apache.org/r1609912
Log:
Bug 56706 - SampleResult#getResponseDataAsString() does not use encoding in response body impacting PostProcessors and ViewResultsTree
Bugzilla Id: 56706

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
    jmeter/trunk/xdocs/changes.xml