Adding the meta tag for pure XML, with an XML prolog
isn't really useful: the prolog defines encoding, either implictely (UTF-8 by default) or explicitely
Adding the meta-tag is needed when there is no XML prolog: in this case, without the meta-tag, you can't know which encoding was used when writing the content. (XHTML without XML prolog but with meta-tag isn't really XML since it does not conform XML encoding convention, but that's another story).
Then you should either add the XML prolog or the meta-tag, but both isn't really useful.
From an API point of view, this requires the Sink API to know what encoding was used to create the Writer.
About the proposed patch: Sink API is about output.
Having an inputEncoding attribute doesn't make sense: Parser API could eventually have this attribute set along the Reader using the input encoding.
To pass encoding to the Sink when rendering output, RenderingContext should be used, either by adding an outputEncoding attribute or using the attributes Map