wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes How to decode a String in Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

How to decode a String in Java?

Jingh Yi
Ranch Hand

Joined: Mar 23, 2005
Posts: 90
Hi All,

I have a question. Right now one of the field in our database, the Comments field, which is coming from other online systems, has encoded characters in it. For example, it's possible to have ''' in the Comments field instead of \'. Or '"' in the Comments field instead of \". How can I decode them back to \' and \" in Java? I tried java.net.URLDecoder.decode(comments) and it didn't work. What do I do?

Thanks!
Jinghui
Jingh Yi
Ranch Hand

Joined: Mar 23, 2005
Posts: 90
The encoded code for \' is '& # 39;'. On my previous post, '& # 39;' is automatically decoded by HTML to \'. The \" is encoded to '& QUOT;'. How do I decode them back to \' and \"?

Thanks!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,

Welcome to JavaRanch!

Please don't post the same question to more than one forum; it just wastes people's time. I'm going to close this copy and leave this one open.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to decode a String in Java?
 
Similar Threads
how does servlet interpret parameter string ?
New to XML
How to decode a String with '& # 39;'?
String to integer??
Character decoding in Java