简体   繁体   English

HTML页面utf-8编码

[英]HTML Page utf-8 encoding

I have used 我用过

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

UTF-8 coding works fine in all parts of the page except the <textarea> field. 除了<textarea>字段外,UTF-8编码在页面的所有部分都可以正常工作。 FYI, I have kept this <textarea> filed within a form. 仅供参考,我已将此<textarea>归档在表格中。

I am testing with the below content in this text area: 我正在此文本区域中测试以下内容:
'Contacts' AND ™ Trade Mark AND Registered symbol ® AND Double"Quote AND APOSTROPHE' “联系人” AND™商标AND注册符号®以及“引号和撇号”双

But it appears as below in the textarea: 但是它在文本区域中显示如下:
âContactsâ AND ⢠Trade Mark AND Registered symbol ® AND Double"Quote AND APOSTROPHE' âContacts和¢商标和注册符号®和Double“ Quote AND APOSTROPHE'

Please suggest at the earliest. 请尽早提出建议。 Thanks in advance 提前致谢

Reffering to W3School / HTML Entities : 引用到W3School / HTML实体

Reserved characters in HTML must be replaced with character entities. HTML中的保留字符必须替换为字符实体。

Characters that are not present on your keyboard can also be replaced by entities. 键盘上不存在的字符也可以由实体代替。

Based on Character Entity Reference Chart , use &rsquo; 根据角色实体参考表 ,使用&rsquo; for ', &lsquo; 对于', &lsquo; for ', &trade; 对于', &trade; for ™ and &reg; 用于™和&reg; for ®. 用于®。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM