You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2019/01/29 18:16:50 UTC

[Bug 63130] New: Jmeter is unable to decode Shift_JIS characters.

https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

            Bug ID: 63130
           Summary: Jmeter is unable to decode Shift_JIS characters.
           Product: JMeter
           Version: 5.0
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: naveen.nandwani@india.nec.com
  Target Milestone: JMETER_5.1

Created attachment 36404
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36404&action=edit
Application to reproduce the scenario.

Overview: 
JMeter is unable to decode Shift_JIS (Multi-Byte) characters and resulting
garbage value. When we post the Shift_JIS  characters from browser using JMeter
HTTP(s) Test Script Recorder, we get garbage value for Shift_JIS characters in
response.
Below is the example of request and response:

Request content:  初期値大阪市 
Response content: 初期?l大阪?s

Impact of bug:

1. When End User post Shift_JIS characters using JMeter proxy, get garbage
value in response.
2. Shift_JIS (Shift Japanese Industrial Standards) encoding is used by many
Japanese company So whenever Japanese engineer uses JMeter for their
performance testing they did not get actual result.

Setup 
1. Deploy Application "jmeter_issue_Encoding_Library"(extract in
apache-tomcat-9.0.12\webapps) in Tomcat and start the tomcat(execute
"apache-tomcat-9.0.12\bin\startup.bat" .
2. Open the browser and change Proxy settings -> LAN Setting and set
Address(eg: localhost) and port(e.g.8888).
3. Run JMeter
        3.1 click on file menu-> open ->open the attached "Test Plan.jmx" file.
        3.2 Set the same port number in “HTTP(s) Test Script Recorder” and in
browser’s Network LAN Settings.
        3.3 Go to JMeter HTTP(s) Test Script Recorder -> Click Start -> Ok


Execution
1. Go to browser , open application (e.g.
http://localhost:portNumber/jmeter_issue_Encoding_Library/index.jsp)

2. Click on Submit Button.

3. View result in browser.

Expected Result: 初期大阪
Actual Result: ?ソス?ソス?ソス?ソス?ソスl?ソス?ソス?ソスs

//Refer ticket #63129 (reported for the same issue)

4. click on "Back to previous page" and click on "Submit" button again.
5. View the result in browser, this time getting 2 characters as garbage.

Expected Result: 初期大阪
Actual Result: 初期?l大阪?s

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

Naveen Nandwani <na...@india.nec.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #7 from Naveen Nandwani <na...@india.nec.com> ---
Hi,

PR Request is raised. Please refer to below:

https://github.com/apache/jmeter/pull/440

Please let me know, if more information is required.

Regards,

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

--- Comment #6 from Naveen Nandwani <na...@india.nec.com> ---
(In reply to Philippe Mouawad from comment #5)
> Hello,
> Can you raise a PR following:
> http://jmeter.apache.org/building.html
> 
> I am afraid this might be breaking many tests, but it's worth checking.
> 
> Regards

Hello,

Thanks for considering this bug and patch.
We are working on creating PR request and will share in next week.

Regards,

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
             Status|NEW                         |NEEDINFO

--- Comment #5 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello,
Can you raise a PR following:
http://jmeter.apache.org/building.html

I am afraid this might be breaking many tests, but it's worth checking.

Regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

--- Comment #1 from Naveen Nandwani <na...@india.nec.com> ---
Created attachment 36405
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36405&action=edit
Test Plan to reproduce the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

--- Comment #4 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
*** Bug 63129 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

--- Comment #3 from Naveen Nandwani <na...@india.nec.com> ---
Created attachment 36407
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36407&action=edit
Patch to fix the problem. I will raise PR request separately.

Fix the issue in HTTPHC4Impl.java as well. 
Please find attached the patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

--- Comment #2 from Naveen Nandwani <na...@india.nec.com> ---
Created attachment 36406
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36406&action=edit
Fix patch in one function.

Cause of Bug:
JMeter uses java.net.URLDecoder class for URL encoding.
Its drawback : This library can not encode Shift_JIS correctly because of
different specific interpretation between Java and IE.
Because of browser specification, char code is zipped.
Browser encode Japanese text as following.
初期値大阪市 ⇒ %8F%89%8A%FA%92l%91%E5%8D%E3%8Es
初 = %8F%89
期 = %8A%FA
値 = %92l      ← % is lack
大 = %91%E5
阪 = %8D%E3
市 = %8Es     ← % is lack

Solution:
JMeter should use org.apache.commons.codec.net.URLCodec class for URL encoding.
Refer to attached HTTPArgument.diff file for changes in library.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|JMETER_5.1                  |JMETER_5.2

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63130] Jmeter is unable to decode Shift_JIS characters.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63130

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---


*** This bug has been marked as a duplicate of bug 64075 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.