My question is how to I set the encoding on a TextWriter object?
I'm passing the result of an XML/XSLT tranformation to it later in the script.
the encoding specified in the XSLT document is ignored and the TextWriter property is used instead.
Therefore I need to change it to what I need (I want to set it to UTF-8)
It's declared as follows:-
TextWriter writer = new StringWriter();