code: func (p *printer) EscapeString(s string) {
  	var esc []byte
  	last := 0
  	for i := 0; i < len(s); {
  		r, width := utf8.DecodeRuneInString(s[i:])
  		i += width
  		switch r {
  		case '"':
  			esc = esc_quot
  		case '\'':
  			esc = esc_apos
  		case '&':
  			esc = esc_amp
  		case '<':
  			esc = esc_lt
  		case '>':
  			esc = esc_gt
  		case '\t':
  			esc = esc_tab
  		case '\n':
  			esc = esc_nl
  		case '\r':
  			esc = esc_cr
  		default:
  			if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) {
  				esc = esc_fffd
  				break
  			}
  			continue
  		}
  		p.WriteString(s[last : i-width])
  		p.Write(esc)
  		last = i
  	}
  	p.WriteString(s[last:])
  }
docs: // EscapeString writes to p the properly escaped XML equivalent
  // of the plain text data s.