Re: Special Charaters issue with JTidy on Unix

On 3 Mar 2005 at 7:00, Khanna, Anuj (IT) said:

>     I am using JTidy. I want to replace the Non-Ascii charaters
> like(£ etc...) with their corresponding entity references since i
> insert all the returned HTML cleaned string into XML. I am
> successfully able to do this on Windows platforms. JTidy replaces all
> the special charaters with their entity references, However when i try
> the same code on Unix platform the result is not desirable i get all
> ??????? characters in place of all the special characters. I don't why
> is this happening. Can anybody suggest why it is behaving this way. 

If it's the same code, then the difference has to be in the Java or OS 
environment. Clearly a different assumption is being made about the 
encoding of your source data. Windows is assuming an 8-bit encoding, 
probably your default Windows codepage, and Unix is assuming something 
different where the bytes don't decode properly.

But are you quite sure it's the same code? The "Windows" output seems 
consistent with the code, but the "Unix" output has a significantly 
different sequence of characters:

Windows starts  !"#$%&'()*+,-./
Unix starts     !\"#$%&<>'()

and there are more differences further on.

Received on Wednesday, 23 March 2005 09:49:36 UTC