I'm in the situation of needing to provide cross-platform xml decoding.
So I thought that xml.Decoder.CharsetReader would be the right approach
in conjunction with
golag.org/x/text/encoding. However, the xml decoder
needs to be able to understand the text in order to be able to read the
proc inst to get the charset out to hand to CharsetReader.
So it seems that we need to get the proc inst out from the io.Reader
input, deduce the charset and convert it to UTF-8 and then reinject it
into the io.Reader so that the charset can then be passed to
CharsetReader. This can't be the right way to do things.
I'm wondering what is the use of CharsetReader if it can't be used to
determine the charset without already having determined the charset.
How should it be used?
Dan