I am using javax.xml.transform.Transformer to write some XML that contains
the Trade Mark sign. I want to write the TM out as  HTML character entity
&#8482 which does not happen since my default encoding is UTF-8.

When I use
javax.xml.transform.Transformer.setOutputProperty(OutputKeys.ENCODING,
"UCS")  i get what i want ( &#8482 in the output file). The trouble is that
if I use
javax.xml.transform.Transformer.setOutputProperty(OutputKeys.ENCODING,
"abcxyz") ,i.e a nonsense encoding, I still get what i want. Does anyone
know why the nonsense encoding works for me?

Thanks,
Graeme
 

Reply via email to