From 4566387de937ef164f4240971ac77ed4eab3c5ba Mon Sep 17 00:00:00 2001 From: Jianfei Wang Date: Fri, 6 Mar 2015 15:10:57 +0800 Subject: [PATCH] support xml encoding other than utf-8 --- goupnp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/goupnp.go b/goupnp.go index 120b924..9a63d73 100644 --- a/goupnp.go +++ b/goupnp.go @@ -20,6 +20,8 @@ import ( "net/http" "net/url" + "golang.org/x/net/html/charset" + "github.com/huin/goupnp/httpu" "github.com/huin/goupnp/ssdp" ) @@ -104,6 +106,7 @@ func requestXml(url string, defaultSpace string, doc interface{}) error { decoder := xml.NewDecoder(resp.Body) decoder.DefaultSpace = defaultSpace + decoder.CharsetReader = charset.NewReaderByName return decoder.Decode(doc) }