code: func HandleStringReader(f func(r io.Reader, ctx *goproxy.ProxyCtx) io.Reader) goproxy.RespHandler {
  	return goproxy.FuncRespHandler(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response {
  		if ctx.Error != nil {
  			return nil
  		}
  		charsetName := ctx.Charset()
  		if charsetName == "" {
  			charsetName = "utf-8"
  		}
  
  		if strings.ToLower(charsetName) != "utf-8" {
  			r, err := charset.NewReader(charsetName, resp.Body)
  			if err != nil {
  				ctx.Warnf("Cannot convert from %v to utf-8: %v", charsetName, err)
  				return resp
  			}
  			tr, err := charset.TranslatorTo(charsetName)
  			if err != nil {
  				ctx.Warnf("Can't translate to %v from utf-8: %v", charsetName, err)
  				return resp
  			}
  			if err != nil {
  				ctx.Warnf("Cannot translate to %v: %v", charsetName, err)
  				return resp
  			}
  			newr := charset.NewTranslatingReader(f(r, ctx), tr)
  			resp.Body = &readFirstCloseBoth{ioutil.NopCloser(newr), resp.Body}
  		} else {
  			//no translation is needed, already at utf-8
  			resp.Body = &readFirstCloseBoth{ioutil.NopCloser(f(resp.Body, ctx)), resp.Body}
  		}
  		return resp
  	})
  }
docs: // Will receive an input stream which would convert the response to utf-8
  // The given function must close the reader r, in order to close the response body.