Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Escaping Multilingual strings/UTF-8

 
Soumya Manjunath
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4588
302
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Clapham
Sheriff
Posts: 21318
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic