Skip to content

decoder.CharsetReader required #363

@gpmn

Description

@gpmn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions