File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Converting javascript escape codes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Converting javascript escape codes" Watch "Converting javascript escape codes" New topic

Converting javascript escape codes


Joined: May 29, 2001
Posts: 4
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 ]

Tom McComb
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
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.

Val SCJP <BR>going for SCJD
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . 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.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Tom McComb
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Thanks for the guidance. (Previously known as mrtuba)

Tom McComb

Tom McComb
michelle cheung

Joined: Jun 05, 2001
Posts: 11
Look in
URLEncoder.encode( myString )
It works like the javascript escape function
I agree. Here's the link:
subject: Converting javascript escape codes
It's not a secret anymore!