0

I have used

"<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>" at the top of my jsp.

UTF-8 coding works fine in all parts of the page except the <textarea> field. FYI, I have kept this <textarea> filed within a form.

I am testing with the below content in this text area:
‘Contacts’ AND ™ Trade Mark AND Registered symbol ® AND Double"Quote AND APOSTROPHE'

But it appears as below in the textarea:
âContactsâ AND ⢠Trade Mark AND Registered symbol ® AND Double"Quote AND APOSTROPHE'

Please suggest at the earliest. Thanks in advance

1 Answers1

0

Reffering to W3School / HTML Entities:

Reserved characters in HTML must be replaced with character entities.

Characters that are not present on your keyboard can also be replaced by entities.

Based on Character Entity Reference Chart, use &rsquo; for ’, &lsquo; for ‘, &trade; for ™ and&reg; for ®.

pan.goth
  • 1,475
  • 10
  • 16
  • But the thing is the data from the jsp form is received at the server looks like below : âContactsâ AND ⢠Trade Mark AND Registered symbol ® AND Double"Quote AND APOSTROPHE'. Due to this reason, I am unable to use the encoding as you mentioned – user3364886 Feb 22 '17 at 12:36
  • So, you can encode the data before sending it to the server. Here is the hint, how to do this: http://stackoverflow.com/a/1354715/6700665 – pan.goth Feb 22 '17 at 13:03