Added encoding parameter to PlainTextFormatter to support encodings other than default