Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for surr2 (0.11 sec)

  1. src/unicode/utf16/utf16.go

    // the Unicode replacement code point U+FFFD.
    func DecodeRune(r1, r2 rune) rune {
    	if surr1 <= r1 && r1 < surr2 && surr2 <= r2 && r2 < surr3 {
    		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.
    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/syscall/wtf8_windows.go

    func decodeWTF16(s []uint16, buf []byte) []byte {
    	for i := 0; i < len(s); i++ {
    		var ar rune
    		switch r := s[i]; {
    		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.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 09:26:16 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  3. src/unicode/utf16/utf16_test.go

    	{'\U0010FFFD', false}, // PRIVATE USE CHARACTER-10FFFD (last Unicode code point)
    
    	{rune(0xd7ff), false}, // surr1-1
    	{rune(0xd800), true},  // surr1
    	{rune(0xdc00), true},  // surr2
    	{rune(0xe000), false}, // surr3
    	{rune(0xdfff), true},  // surr3-1
    }
    
    func TestIsSurrogate(t *testing.T) {
    	for i, tt := range surrogateTests {
    		got := IsSurrogate(tt.r)
    		if got != tt.want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  4. src/unicode/utf16/export_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package utf16
    
    // Extra names for constants so we can validate them during testing.
    const (
    	Surr1           = surr1
    	Surr3           = surr3
    	SurrSelf        = surrSelf
    	MaxRune         = maxRune
    	ReplacementChar = replacementChar
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 394 bytes
    - Viewed (0)
Back to top