简体   繁体   English

Jtidy-是否应该<sup>在页面源代码中显示TM的</sup>编码字符( <sup>¢)?</sup>

[英]Jtidy - Shouldn't display encoding character(<sup>&acirc;&#132;&cent;) 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 &trade; 为此有一个HTML实体,称为&trade;并不奇怪&trade; - 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.

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