Open jiwanovski87 opened 3 days ago
Ok, I believe I have fixed it with the following code:
doc, err := xmlquery.ParseWithOptions(xf, xmlquery.ParserOptions{
Decoder: &xmlquery.DecoderOptions{
CharsetReader: func(charset string, input io.Reader) (io.Reader, error) {
utf8_reader := charmap.ISO8859_1.NewDecoder().Reader(input)
return utf8_reader, nil
},
},
})
if err != nil {
fmt.Println(err)
}
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}