This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi, Is there any equivalent javascript's escape() function in java? I want to hex-encode in java, that's why i need that function. Any help would be greatly appeciate. Thankx, Ravi
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Well I am not JavaScript expert. What exactly does the escape() do? If you mean an escape character, that is the \ in Java. So \" forces a literal double quote. If you are just trying to work with hex in java then prefacing the hex value with 0x makes it hex. 0x12 = 18 dec
"JavaRanch, where the deer and the Certified play" - David O'Meara
Ravi Mandalapu
Ranch Hand
Joined: Nov 01, 2000
Posts: 34
posted
0
Hi Cindy, Thank you very much for your response. My problem is, I have to invoke the NetscapeMessenger at client side and i have to pass the form data to Netscape messenger fields like CC,TO,BODY,.... for this reason i used MAILTO:// approach. Suppose if i pass multible lines to Messenger body field,it is displaying total data in single line, suppose if we use javascript escape() function, it will convert newlinecharacters,spaces,.....into hex code and pass that data to Messenger. I want the same functionality using java,is it possible? Thankx in advanch. Reply will be greatly appreciate. ravi
Originally posted by Cindy Glass: Well I am not JavaScript expert. What exactly does the escape() do? If you mean an escape character, that is the \ in Java. So \" forces a literal double quote. If you are just trying to work with hex in java then prefacing the hex value with 0x makes it hex. 0x12 = 18 dec
michelle cheung
Greenhorn
Joined: Jun 05, 2001
Posts: 11
posted
0
There's a class in java.net URLEncoder.encode( myString ); That will do the same thing as escape in javascript