Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decoder.CharsetReader required #363

Open
gpmn opened this issue Feb 22, 2019 · 0 comments
Open

decoder.CharsetReader required #363

gpmn opened this issue Feb 22, 2019 · 0 comments

Comments

@gpmn
Copy link

gpmn commented Feb 22, 2019

if err := decoder.Decode(doc); err != nil {

decoder := xml.NewDecoder(xmlFile)
decoder.CharsetReader = func(encoding string, input io.Reader) (io.Reader, error) {
	return input, nil
}
if err := decoder.Decode(doc); err != nil {
	return nil, err
}

s.a. https://stackoverflow.com/questions/50812137/xml-encoding-utf-16-declared-but-decoder-charsetreader-is-nil-unmarshal-succe

unless the decoder.CharsetReader, it could not parse such xml file : https://apiwiki.fxcorporate.com/api/fix/docs/FIXFXCM10.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant