[英]Jtidy - Shouldn't display encoding character(<sup>â„¢) for TM in page source code?
I'm using Jtidy to rendor news information, when news information has TM in it then page source is showing it as 我正在使用Jtidy提供新闻信息,当新闻信息中包含TM时,页面源将其显示为
'â??¢' which is invalid... 'â??¢'这是无效的...
Here is my code: 这是我的代码:
InputStream is = new ByteArrayInputStream(description.getBytes()); InputStream是= new ByteArrayInputStream(description.getBytes()); OutputStream os=new ByteArrayOutputStream();
OutputStream os = new ByteArrayOutputStream();
Tidy tidy = new Tidy();
tidy.setPrintBodyOnly(true);
//tidy.setEscapeCdata(true);
//tidy.setAsciiChars(false);
Any idea how to display TM in place of this encoding characters.... or how to set (ISO-8859-1) to Tidy? 任何想法如何显示TM代替此编码字符....或如何将(ISO-8859-1)设置为Tidy?
There is a HTML entity for this, not too surprisingly called ™
为此有一个HTML实体,称为
™
并不奇怪™
- see eg http://www.w3.org/TR/WD-entities-961125 -参见例如http://www.w3.org/TR/WD-entities-961125
通过在Tidy上设置setInputEncoding()和setOutputEncoding()来解决此问题...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.