code: func encodedSize(src string, enc Encoding) int {
  	if enc.Equals(EncodingUTF8) {
  		return len(src)
  	}
  
  	toXEncoding := resolveXEncoding(nil, enc)
  	encoded, _ := toXEncoding.Encoder().String(src)
  	return len(encoded)
  }
docs: // encodedSize counts length of UTF-8 src if it's encoded to enc.