func MyCharsetReader(charset string, input io.Reader) (io.Reader, error) {
fmt.Printf("XML Charset: %s\n", charset)
switch charset {
case "ISO-88591-1":
return transform.NewReader(input, charmap.ISO8859_1.NewDecoder()), nil }
return nil,nil
}
func main() {
dec := xml.NewDecoder(os.Stdin)
dec.CharsetReader = MyCharsetReader
dec.Strict = false
No comments:
Post a Comment