W3C home > Mailing lists > Public > www-jigsaw@w3.org > November to December 1996

Re: URLDecoder mystery

From: Jason Hoos <jhoos@uiuc.edu>
Date: Wed, 04 Dec 1996 14:36:30 CST
To: jewellsc@pop.mts.kpnw.org
CC: www-jigsaw@w3.org
Message-Id: <AECB3CEE@uiuc.edu>
>Is URLDecoder returning an array of bytes rather than a String object
>perhaps?  Maybe this is a Java question, but I only seem to have this
>problem with the URLDecoder.

It should be returning a String; however, I don't think you can directly 
compare string objects using '==' in Java, since technically, the 'name' object 
and the '"C"' object are two distinct things and therefore never equal.  Try 
replacing the comparison with something like:

if (name.equals("C")) ....

This way you use the 'equals' method of the String class, which does the 
comparison properly.

---------=============# Jason Hoos - jhoos@uiuc.edu #=============---------
---------=============###############################=============---------
"I don't want to start any blasphemous rumours, but I think that God's got
   a sick sense of humour, and when I die I expect to find Him laughing..."
                                      - Depeche Mode, "Blasphemous Rumours"
Received on Wednesday, 4 December 1996 15:36:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT