users@glassfish.java.net

RE: URLEncoder bug?

From: <jacob_at_hookom.net>
Date: Thu, 10 Jul 2008 12:42:58 -0400

Often on the server side, decoding is redundant as the servlet container will do the decoding for you within the API calls. So calling decode again will actually result in errant content.

----
Hello,
I am recently coding some comet application where I need to insert data to 
response header. The data to be inserted is UTF-8 so it needs to be encoded. I 
am encoding it with
URLEncoder.encoder(myString)
and from the javascript side, after I get myString from the responseHeader, I 
make a 
decodeURLComponent(myString)
problem is URLEncoder encodes space to +, however for a space decodeURLComponet 
expects a +.
what am I doing wrong? either one of the encoder or decoder is wrong.
Best.
[Message sent by forum member 'segfault2007' (segfault2007)]
http://forums.java.net/jive/thread.jspa?messageID=285718
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net