Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for isHex (0.03 sec)

  1. src/mime/mediatype.go

    	// Count %, check that they're well-formed.
    	percents := 0
    	for i := 0; i < len(s); {
    		if s[i] != '%' {
    			i++
    			continue
    		}
    		percents++
    		if i+2 >= len(s) || !ishex(s[i+1]) || !ishex(s[i+2]) {
    			s = s[i:]
    			if len(s) > 3 {
    				s = s[0:3]
    			}
    			return "", fmt.Errorf("mime: bogus characters after %%: %q", s)
    		}
    		i += 3
    	}
    	if percents == 0 {
    		return s, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  2. src/net/url/url.go

    	// Count %, check that they're well-formed.
    	n := 0
    	hasPlus := false
    	for i := 0; i < len(s); {
    		switch s[i] {
    		case '%':
    			n++
    			if i+2 >= len(s) || !ishex(s[i+1]) || !ishex(s[i+2]) {
    				s = s[i:]
    				if len(s) > 3 {
    					s = s[:3]
    				}
    				return "", EscapeError(s)
    			}
    			// Per https://tools.ietf.org/html/rfc3986#page-21
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 36.1K bytes
    - Viewed (0)
Back to top