####  type [ XMLCharDecoder
](https://github.com/levigross/grequests/blob/9c307ef1f48d/utils.go#L52) ¶

    
    
    type XMLCharDecoder func(charset [string](/builtin#string), input [io](/io).[Reader](/io#Reader)) ([io](/io).[Reader](/io#Reader), [error](/builtin#error))

XMLCharDecoder is a helper type that takes a stream of bytes (not encoded in
UTF-8) and returns a reader that encodes the bytes into UTF-8. This is done
because Go's XML library only supports XML encoded in UTF-8

##  ![](/static/shared/icon/insert_drive_file_gm_grey_24dp.svg) Source Files
¶

[ View all Source files
](https://github.com/levigross/grequests/tree/9c307ef1f48d)

  * [ base.go ](https://github.com/levigross/grequests/blob/9c307ef1f48d/base.go "base.go")
  * [ file_upload.go ](https://github.com/levigross/grequests/blob/9c307ef1f48d/file_upload.go "file_upload.go")
  * [ request.go ](https://github.com/levigross/grequests/blob/9c307ef1f48d/request.go "request.go")
  * [ response.go ](https://github.com/levigross/grequests/blob/9c307ef1f48d/response.go "response.go")
  * [ session.go ](https://github.com/levigross/grequests/blob/9c307ef1f48d/session.go "session.go")
  * [ utils.go ](https://github.com/levigross/grequests/blob/9c307ef1f48d/utils.go "utils.go")

Click to show internal directories.

Click to hide internal directories.

[ Why Go ](https://go.dev/solutions) [ Use Cases
](https://go.dev/solutions#use-cases) [ Case Studies
](https://go.dev/solutions#case-studies)

[ Get Started ](https://learn.go.dev/) [ Playground ](https://play.golang.org)
[ Tour ](https://tour.golang.org) [ Stack Overflow
](https://stackoverflow.com/questions/tagged/go?tab=Newest) [ Help
](https://go.dev/help)

[ Packages ](https://pkg.go.dev) [ Standard Library ](/std) [ Sub-repositories
](/golang.org/x) [ About Go Packages ](https://pkg.go.dev/about)

[ About ](https://go.dev/project) [ Download ](https://go.dev/dl/) [ Blog
](https://go.dev/blog) [ Issue Tracker ](https://github.com/golang/go/issues)
[ Release Notes ](https://go.dev/doc/devel/release.html) [ Brand Guidelines
](https://blog.golang.org/go-brand) [ Code of Conduct
](https://go.dev/conduct)

[ Connect ](https://www.twitter.com/golang) [ Twitter
](https://www.twitter.com/golang) [ GitHub ](https://github.com/golang) [
Slack ](https://invite.slack.golangbridge.org/) [ r/golang
](https://reddit.com/r/golang) [ Meetup ](https://www.meetup.com/pro/go) [
Golang Weekly ](https://golangweekly.com/)

![Gopher in flight goggles](/static/shared/gopher/pilot-bust-1431x901.svg)

  * [ Copyright ](https://go.dev/copyright)
  * [ Terms of Service ](https://go.dev/tos)
  * [ Privacy Policy ](http://www.google.com/intl/en/policies/privacy/)
  * [ Report an Issue ](https://go.dev/s/pkgsite-feedback)
  * ![System theme](/static/shared/icon/brightness_6_gm_grey_24dp.svg) ![Dark theme](/static/shared/icon/brightness_2_gm_grey_24dp.svg) ![Light theme](/static/shared/icon/light_mode_gm_grey_24dp.svg)

Theme Toggle

  * ![](/static/shared/icon/keyboard_grey_24dp.svg)

Shortcuts Modal

[ ![Google logo](/static/shared/logo/google-white.svg) ](https://google.com)

##  Jump to

![](/static/shared/icon/close_gm_grey_24dp.svg)

Close

##  Keyboard shortcuts

![](/static/shared/icon/close_gm_grey_24dp.svg)

**?** |  : This menu   
---|---  
**/** |  : Search site   
**f** or **F** |  : Jump to   
**y** or **Y** |  : Canonical URL   
  
Close

go.dev uses cookies from Google to deliver and enhance the quality of its
services and to analyze traffic. [ Learn more.
](https://policies.google.com/technologies/cookies)

Okay