• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting javascript escape codes

 
mrtuba
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application resident in a Domino database (so I am stuck in Java 1.1 and without the Servlet objects that may be cool for translating stuff like this). I need to take a URL and parse out the escape codes (like %20 becomes a space, etc.) I have the following code, and it works. But I was wondering if there is a function or API that can help me (remember . . . 1.1!?)
Thanks for your help.

[ May 18, 2002: Message edited by: Dirk Schreckmann ]
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at StreamTokenizer it's been there since JDK1.0. It has a method to setWhiteChars which you can make these unwated characters as whitespace. Might be usefull to y ou.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"mrtuba",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Tom McComb
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the guidance. (Previously known as mrtuba)

------------------
Tom McComb
 
michelle cheung
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in java.net
URLEncoder.encode( myString )
It works like the javascript escape function
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic