Strings are UTF-16, so writing to a StringWriter will always use UTF-16. If that’s not what you want, then use some other TextWriter derived class, with the encoding you like.
Strings are UTF-16, so writing to a StringWriter will always use UTF-16. If that’s not what you want, then use some other TextWriter derived class, with the encoding you like.