Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for encoderFunc (0.17 sec)

  1. src/unicode/utf16/utf16.go

    		return (r1-surr1)<<10 | (r2 - surr2) + surrSelf
    	}
    	return replacementChar
    }
    
    // EncodeRune returns the UTF-16 surrogate pair r1, r2 for the given rune.
    // If the rune is not a valid Unicode code point or does not need encoding,
    // EncodeRune returns U+FFFD, U+FFFD.
    func EncodeRune(r rune) (r1, r2 rune) {
    	if r < surrSelf || r > maxRune {
    		return replacementChar, replacementChar
    	}
    	r -= surrSelf
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  2. src/unicode/utf16/utf16_test.go

    	for i, tt := range encodeTests {
    		j := 0
    		for _, r := range tt.in {
    			r1, r2 := EncodeRune(r)
    			if r < 0x10000 || r > unicode.MaxRune {
    				if j >= len(tt.out) {
    					t.Errorf("#%d: ran out of tt.out", i)
    					break
    				}
    				if r1 != unicode.ReplacementChar || r2 != unicode.ReplacementChar {
    					t.Errorf("EncodeRune(%#x) = %#x, %#x; want 0xfffd, 0xfffd", r, r1, r2)
    				}
    				j++
    			} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 6.5K bytes
    - Viewed (0)
Back to top