Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why is the output character encoding I set in the stylesheet not being used?

0
Posted

Why is the output character encoding I set in the stylesheet not being used?

0

If you use a character output stream to instantiate the StreamResult object which holds the transformation output, the Writer uses its own encoding, not the encoding you specify in the stylesheet. If you want to use the stylesheet output encoding, do not use StreamResult(java.io.Writer) to instantiate the holder for the output. Alternatively, you can specify the encoding when you create a Writer (java.io.OutputStreamWriter). Once the Writer exists, you cannot change its encoding.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123