1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 21:01:31 +00:00
This commit is contained in:
astaxie 2013-06-11 23:31:40 +08:00
parent 951881b96d
commit b2abb4eb80

View File

@ -212,7 +212,7 @@ func (c *Controller) ServeJson() {
return
}
c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/json")
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/json;charset=UTF-8")
c.Ctx.ResponseWriter.Write(content)
}
@ -223,7 +223,7 @@ func (c *Controller) ServeXml() {
return
}
c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/xml")
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/xml;charset=UTF-8")
c.Ctx.ResponseWriter.Write(content)
}