Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 57 for encoderune (0.3 sec)

  1. src/encoding/json/encode.go

    	escapeHTML bool
    }
    
    type encoderFunc func(e *encodeState, v reflect.Value, opts encOpts)
    
    var encoderCache sync.Map // map[reflect.Type]encoderFunc
    
    func valueEncoder(v reflect.Value) encoderFunc {
    	if !v.IsValid() {
    		return invalidValueEncoder
    	}
    	return typeEncoder(v.Type())
    }
    
    func typeEncoder(t reflect.Type) encoderFunc {
    	if fi, ok := encoderCache.Load(t); ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  2. src/encoding/json/fold.go

    		if c := in[i]; c < utf8.RuneSelf {
    			if 'a' <= c && c <= 'z' {
    				c -= 'a' - 'A'
    			}
    			out = append(out, c)
    			i++
    			continue
    		}
    		// Handle multi-byte Unicode.
    		r, n := utf8.DecodeRune(in[i:])
    		out = utf8.AppendRune(out, foldRune(r))
    		i += n
    	}
    	return out
    }
    
    // foldRune is returns the smallest rune for all runes in the same fold set.
    func foldRune(r rune) rune {
    	for {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 27 17:37:27 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  3. test/utf.go

    	a[3] = 0xe6
    	a[4] = 0x97
    	a[5] = 0xa5
    	a[6] = 0xe6
    	a[7] = 0x9c
    	a[8] = 0xac
    	a[9] = 0xe8
    	a[10] = 0xaa
    	a[11] = 0x9e
    	for w, i, j := 0, 0, 0; i < L; i += w {
    		var r rune
    		r, w = utf8.DecodeRune(a[i:L])
    		if w == 0 {
    			panic("zero width in bytes")
    		}
    		if r != chars[j] {
    			panic("wrong value from bytes")
    		}
    		j++
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 00:48:19 UTC 2012
    - 1.2K bytes
    - Viewed (0)
  4. src/vendor/golang.org/x/text/unicode/norm/input.go

    	if in.bytes == nil {
    		if !isHangulString(in.str[p:]) {
    			return 0
    		}
    		r, size = utf8.DecodeRuneInString(in.str[p:])
    	} else {
    		if !isHangul(in.bytes[p:]) {
    			return 0
    		}
    		r, size = utf8.DecodeRune(in.bytes[p:])
    	}
    	if size != hangulUTF8Size {
    		return 0
    	}
    	return r
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 20:28:54 UTC 2019
    - 2K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/text/unicode/norm/input.go

    	if in.bytes == nil {
    		if !isHangulString(in.str[p:]) {
    			return 0
    		}
    		r, size = utf8.DecodeRuneInString(in.str[p:])
    	} else {
    		if !isHangul(in.bytes[p:]) {
    			return 0
    		}
    		r, size = utf8.DecodeRune(in.bytes[p:])
    	}
    	if size != hangulUTF8Size {
    		return 0
    	}
    	return r
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. src/syscall/wtf8_windows.go

    		case r < surr1, surr3 <= r:
    			// normal rune
    			ar = rune(r)
    		case surr1 <= r && r < surr2 && i+1 < len(s) &&
    			surr2 <= s[i+1] && s[i+1] < surr3:
    			// valid surrogate sequence
    			ar = utf16.DecodeRune(rune(r), rune(s[i+1]))
    			i++
    		default:
    			// WTF-8 fallback.
    			// This only handles the 3-byte case of utf8.AppendRune,
    			// as surrogates always fall in that case.
    			ar = rune(r)
    			if ar > utf8.MaxRune {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 09:26:16 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/response.go

    func (e *watchEncoder) Encode(event watch.Event) error {
    	encodeFunc := func(obj runtime.Object, w io.Writer) error {
    		return e.doEncode(obj, event, w)
    	}
    	if co, ok := event.Object.(runtime.CacheableObject); ok {
    		return co.CacheEncode(e.identifier(event.Type), encodeFunc, e.framer)
    	}
    	return encodeFunc(event.Object, e.framer)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 18 09:07:03 UTC 2023
    - 16.5K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/mod/sumdb/tlog/note.go

    	return msg, nil
    }
    
    // isValidRecordText reports whether text is syntactically valid record text.
    func isValidRecordText(text []byte) bool {
    	var last rune
    	for i := 0; i < len(text); {
    		r, size := utf8.DecodeRune(text[i:])
    		if r < 0x20 && r != '\n' || r == utf8.RuneError && size == 1 || last == '\n' && r == '\n' {
    			return false
    		}
    		i += size
    		last = r
    	}
    	if last != '\n' {
    		return false
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 29 20:10:15 UTC 2019
    - 3.7K bytes
    - Viewed (0)
  9. src/internal/fuzz/minimize_test.go

    			},
    			input:    []any{"zzzzz"},
    			expected: []any{"00000"},
    		},
    		{
    			name: "string_with_letter",
    			fn: func(e CorpusEntry) error {
    				b := e.Values[0].(string)
    				r, _ := utf8.DecodeRune([]byte(b))
    				if unicode.IsLetter(r) {
    					return fmt.Errorf("bad %v", e.Values[0])
    				}
    				return nil
    			},
    			input:    []any{"ZZZZZ"},
    			expected: []any{"A"},
    		},
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 12 19:47:40 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Decode", Func, 0},
    		{"DecodeRune", Func, 0},
    		{"Encode", Func, 0},
    		{"EncodeRune", Func, 0},
    		{"IsSurrogate", Func, 0},
    	},
    	"unicode/utf8": {
    		{"AppendRune", Func, 18},
    		{"DecodeLastRune", Func, 0},
    		{"DecodeLastRuneInString", Func, 0},
    		{"DecodeRune", Func, 0},
    		{"DecodeRuneInString", Func, 0},
    		{"EncodeRune", Func, 0},
    		{"FullRune", Func, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top