aspose file tools*
The moose likes Servlets and the fly likes Escaping Multilingual strings/UTF-8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Escaping Multilingual strings/UTF-8" Watch "Escaping Multilingual strings/UTF-8" New topic
Author

Escaping Multilingual strings/UTF-8

Soumya Manjunath
Ranch Hand

Joined: Nov 28, 2007
Posts: 34
Guys,

I'm working in an application that supports UTF-8 charset. I've a page which supports update and
I'm using an Ajax call to do that update. As the string contains special characters I'm escaping it
before the update. After the update I see that the string has extra bad characters like ? etc..
Please let me know if you have any inputs to get around with it...


Thanks & Regards,<br />Soumya.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3106
    
  41

Soumya Manjunath wrote:As the string contains special characters I'm escaping it before the update.

How do you do that?
I'm not understanding what do you really mean by 'updating' here.
Can you show us the problem with some code with isolating the problem.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

There aren't any characters which can't be encoded in UTF-8. So what are these characters which you have decided are "special" and why are you escaping them?
Soumya Manjunath
Ranch Hand

Joined: Nov 28, 2007
Posts: 34
Sorry for the delayed reply Guys. I figured it out. The messages were in different languages and contained html codes, strings, \ , etc..

I was escaping them in javascript and decoding them in server side. But got to know that javascript escape method supports only
ASCII characters. So I replaced the escape method with encodeURLComponent and that solved problem.

Thanks for your reply though.
 
wood burning stoves
 
subject: Escaping Multilingual strings/UTF-8