Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Encoding  RSS feed

 
Sunil Kumarrr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When I copy and paste the contents from word document with special characters like “ ‘ etc (eg., “Testing”) the characters in JSP are displayed as ¿Testing¿.

Please help me out.



Thank You
Sunil



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't do that. Those are "special" Word characters that don't make sense to anything else.

Why would you write a JSP in Word?
 
Sunil Kumarrr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example, if there is texbox or textarea in the jsp, when i copy and paste the test data (“Hello Test ” ) from a word document and click on "SAVE" the page is reloaded as "â¿¿Testing⿝" in the texbox.

Note : This happens only when the special characters are copied from word document and works fine when typed from keyboard.
 
Sunil Kumarrr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wrongly typed the test data ---

“Testing”
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you bother to read my reply?
 
Sunil Kumarrr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I need a solution.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Besides don't copy and paste from Word?

I suppose you can discover what the values of those characters are, and then replace them (on the server with Java, or on the client using JavaScript) with the "real" characters. But there's no way to prevent those values from being pasted in the first place.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!