0

I'm using Jtidy to rendor news information, when news information has TM in it then page source is showing it as

'™' which is invalid...

Here is my code:

InputStream is = new ByteArrayInputStream(description.getBytes()); 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?

TP_JAVA
  • 1,002
  • 5
  • 23
  • 49

2 Answers2

0

There is a HTML entity for this, not too surprisingly called ™ - see e.g. http://www.w3.org/TR/WD-entities-961125

tripleee
  • 175,061
  • 34
  • 275
  • 318
0

Resolved it by setting setInputEncoding() and setOutputEncoding() on Tidy...

TP_JAVA
  • 1,002
  • 5
  • 23
  • 49