Bug 8961 - utf8 url encoding not supported by deffault in jdk's older than 1.4
Summary: utf8 url encoding not supported by deffault in jdk's older than 1.4
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 1.5
Hardware: PC All
: P5 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-10 02:39 UTC by Marouane Bouzoubaa
Modified: 2004-11-16 19:05 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marouane Bouzoubaa 2002-05-10 02:39:33 UTC
I was trying to use jmeter to test our new Arabic web search engine, but things 
were not working well until I found out that the arabic "arguments" that are in 
utf8 were not encoded correctly. the URLEncoder/URLDecoder (in jdk's older than 
1.4) use the default system encoding. jdk1.4 supports new versions of this 
methods that take two parameters: String to be encoded and the encoding to use 
for encoding.
I just didn't have time to figure out which source file to edit to make the 
needed changes.
Comment 1 Mike Stover 2002-05-30 18:03:08 UTC
I don't know what to do with this one.  I would think JMeter should use the 
local encoding.  You are putting in utf-8 codes to simulate Arabic characters 
because you are on a non-arabic machine?  If JMeter used utf-8 rather than the 
local encoding, wouldn't that also create problems for some people?  The only 
other option is to give people a choice of encodings in the GUI...

I'm just not sure how to resolve your problem that will also work for everyone 
else.
Comment 2 rOnn 2002-09-10 09:07:26 UTC
This comments may or may not be applicable since this bug is already several 
months old.

I've run in to this problem with my application in the past. The way i got 
around the problem is to set file.encoding system property to ISO8859_1 
(because jdk makes that assumption).
Comment 3 Jordi Salvat i Alabart 2003-01-10 18:55:27 UTC
Can someone be more specific on what this bug is about?

Provide a way to reproduce it, explain what the expected results are, and where
actual results deviate from them?

I'll currently reduce severity from Blocker to Normal (can't be a blocker if
it's been open for so long!), and I'll close as INVALID if we don't get more
info in a week or so. (Of course it can always be reopened).
Comment 4 Oliver Rossmueller 2003-01-15 00:58:04 UTC
If you have a web app which expects the client requests to be in a specific
character encoding (e.g. it is an arabic web site and the servlet expects the
requests to be utf-8) you need a way to tell JMeter which encoding to use to
simulate clients using that encoding.

The solution would be to provide a way to set the character encoding to be used
by an http request (text field or combo box for example). But this would also
require a full switch to J2SE 1.4, because there is no way to set the character
set for url encoding in earlier java releases.
Comment 5 Matthew Faull 2003-05-23 03:57:57 UTC
I'm using JMeter against a utf-8 website with alot of Japanese content. Using
the latest tar ball (20/05/2003) this doesn't work. The posted values aren't
encoded correctly. Thus I've temporarily altered the following file(in my
source) until I can find or do a more complete solution:
"org.apache.jmeter.protocol.http.util.EncoderCache.java"
I changed: 
encodedValue = URLEncoder.encode(k);

To:
try{
  encodedValue = URLEncoder.encode(k, "utf8");
   }
catch (UnsupportedEncodingException e)
   {
     System.out.println("Don't support utf8 encoding??");
     e.printStackTrace();
   }

Yes - I know my exception handling here is bad :-p
Comment 6 The ASF infrastructure team 2022-09-24 20:37:27 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/847