Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for EncodeWTF16 (0.18 sec)

  1. src/syscall/export_windows_test.go

    var UpdateProcThreadAttribute = updateProcThreadAttribute
    var DeleteProcThreadAttributeList = deleteProcThreadAttributeList
    
    const PROC_THREAD_ATTRIBUTE_HANDLE_LIST = _PROC_THREAD_ATTRIBUTE_HANDLE_LIST
    
    var EncodeWTF16 = encodeWTF16
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 09:26:16 UTC 2023
    - 500 bytes
    - Viewed (0)
  2. src/syscall/wtf8_windows_test.go

    			got := syscall.EncodeWTF16(tt.str, nil)
    			got2 := string(syscall.DecodeWTF16(got, nil))
    			if got2 != tt.str {
    				t.Errorf("got:\n%s\nwant:\n%s", got2, tt.str)
    			}
    		})
    	}
    }
    
    func TestWTF16Golden(t *testing.T) {
    	for _, tt := range wtf8tests {
    		t.Run(fmt.Sprintf("%X", tt.str), func(t *testing.T) {
    			got := syscall.EncodeWTF16(tt.str, nil)
    			if !slices.Equal(got, tt.wstr) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 09:26:16 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  3. src/syscall/wtf8_windows.go

    	surr3 = 0xe000
    
    	tx    = 0b10000000
    	t3    = 0b11100000
    	maskx = 0b00111111
    	mask3 = 0b00001111
    
    	rune1Max = 1<<7 - 1
    	rune2Max = 1<<11 - 1
    )
    
    // encodeWTF16 returns the potentially ill-formed
    // UTF-16 encoding of s.
    func encodeWTF16(s string, buf []uint16) []uint16 {
    	for i := 0; i < len(s); {
    		// Cannot use 'for range s' because it expects valid
    		// UTF-8 runes.
    		r, size := utf8.DecodeRuneInString(s[i:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 09:26:16 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  4. src/syscall/syscall_windows.go

    	// So the number of UTF-8 code units (len(s)) is always greater or
    	// equal than the number of UTF-16 code units.
    	// Also account for the terminating NUL character.
    	buf := make([]uint16, 0, len(s)+1)
    	buf = encodeWTF16(s, buf)
    	return append(buf, 0), nil
    }
    
    // UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s,
    // with a terminating NUL removed. Unpaired surrogates are decoded
    // using WTF-8 instead of UTF-8 encoding.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 11:49:46 UTC 2024
    - 52.7K bytes
    - Viewed (0)
Back to top