Skip to content

Parse file with special characters #118

@jiwanovski87

Description

@jiwanovski87

Hey everyone,

currently I am trying to parse an xml file with a country specific character.
As example: In Germany there is the character ä. In XML this is represented as ä

So when I just do the following code I receive this error message. How can I fix this?
encoding/xml.SyntaxError {Msg: "invalid character entity ä", Line: 7}

xf, err := os.Open(f)
if err != nil {
	p.Logger.Errorf("Cannot open file: %s", f)
}
defer xf.Close()

doc, err := xmlquery.Parse(xf)
if err != nil {
	fmt.Println(err)
}

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