Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for UTF16FromString (0.3 sec)

  1. src/syscall/syscall_windows_test.go

    	f.Add("\xe3\xc1\x81") // invalid middle byte
    
    	f.Fuzz(func(t *testing.T, tst string) {
    		res, err := syscall.UTF16FromString(tst)
    		if err != nil {
    			if strings.Contains(tst, "\x00") {
    				t.Skipf("input %q contains a NUL byte", tst)
    			}
    			t.Fatalf("UTF16FromString(%q): %v", tst, err)
    		}
    		t.Logf("UTF16FromString(%q) = %04x", tst, res)
    
    		if len(res) < 1 || res[len(res)-1] != 0 {
    			t.Fatalf("missing NUL terminator")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 17 16:33:09 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/sys/windows/setupapi_windows.go

    	str, err := UTF16FromString(description)
    	if err != nil {
    		return err
    	}
    	copy(data.description[:], str)
    	return nil
    }
    
    func (data *DrvInfoData) MfgName() string {
    	return UTF16ToString(data.mfgName[:])
    }
    
    func (data *DrvInfoData) SetMfgName(mfgName string) error {
    	str, err := UTF16FromString(mfgName)
    	if err != nil {
    		return err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 00:11:50 UTC 2022
    - 67.2K bytes
    - Viewed (0)
  3. src/os/path_windows.go

    	} else if isDevice {
    		// Don't add the extended prefix to device paths, as it would
    		// change its meaning.
    	} else {
    		prefix = []uint16{'\\', '\\', '?', '\\'}
    	}
    
    	p, err := syscall.UTF16FromString(path)
    	if err != nil {
    		return path
    	}
    	// Estimate the required buffer size using the path length plus the null terminator.
    	// pathLength includes the working directory. This should be accurate unless
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:44:48 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/sys/windows/exec_windows.go

    // DecomposeCommandLine returns an error if commandLine contains NUL.
    func DecomposeCommandLine(commandLine string) ([]string, error) {
    	if len(commandLine) == 0 {
    		return []string{}, nil
    	}
    	utf16CommandLine, err := UTF16FromString(commandLine)
    	if err != nil {
    		return nil, errorspkg.New("string with NUL passed to DecomposeCommandLine")
    	}
    	var argc int32
    	argv, err := commandLineToArgv(&utf16CommandLine[0], &argc)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 10 16:32:44 UTC 2023
    - 7.3K bytes
    - Viewed (0)
  5. src/syscall/syscall_windows.go

    // function panics instead of returning an error.
    //
    // Deprecated: Use [UTF16FromString] instead.
    func StringToUTF16(s string) []uint16 {
    	a, err := UTF16FromString(s)
    	if err != nil {
    		panic("syscall: string with NUL passed to StringToUTF16")
    	}
    	return a
    }
    
    // UTF16FromString returns the UTF-16 encoding of the UTF-8 string
    // s, with a terminating NUL added. If s contains a NUL byte at any
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 11:49:46 UTC 2024
    - 52.7K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/sys/windows/syscall_windows.go

    )
    
    // StringToUTF16 is deprecated. Use UTF16FromString instead.
    // If s contains a NUL byte this function panics instead of
    // returning an error.
    func StringToUTF16(s string) []uint16 {
    	a, err := UTF16FromString(s)
    	if err != nil {
    		panic("windows: string with NUL passed to StringToUTF16")
    	}
    	return a
    }
    
    // UTF16FromString returns the UTF-16 encoding of the UTF-8 string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 05 22:18:42 UTC 2024
    - 82.8K bytes
    - Viewed (0)
  7. src/internal/syscall/windows/registry/value.go

    	return k.setValue(name, QWORD, (*[8]byte)(unsafe.Pointer(&value))[:])
    }
    
    func (k Key) setStringValue(name string, valtype uint32, value string) error {
    	v, err := syscall.UTF16FromString(value)
    	if err != nil {
    		return err
    	}
    	buf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[: len(v)*2 : len(v)*2]
    	return k.setValue(name, valtype, buf)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 20:01:34 UTC 2023
    - 11K bytes
    - Viewed (0)
  8. src/os/os_windows_test.go

    	// Create a file whose name contains unpaired surrogates.
    	// Use syscall.CreateFile instead of os.Create to simulate a file that is created by
    	// a non-Go program so the file name hasn't gone through syscall.UTF16FromString.
    	dirw := utf16.Encode([]rune(dir))
    	pathw := append(dirw, namew...)
    	fd, err := syscall.CreateFile(&pathw[0], syscall.GENERIC_ALL, 0, nil, syscall.CREATE_NEW, 0, 0)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 41.8K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"TransmitFileBuffers.TailLength", Field, 0},
    		{"Truncate", Func, 0},
    		{"UNIX_PATH_MAX", Const, 12},
    		{"USAGE_MATCH_TYPE_AND", Const, 0},
    		{"USAGE_MATCH_TYPE_OR", Const, 0},
    		{"UTF16FromString", Func, 1},
    		{"UTF16PtrFromString", Func, 1},
    		{"UTF16ToString", Func, 0},
    		{"Ucred", Type, 0},
    		{"Ucred.Gid", Field, 0},
    		{"Ucred.Pid", Field, 0},
    		{"Ucred.Uid", Field, 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)
  10. api/go1.1.txt

    pkg syscall (windows-386), func LoadGetAddrInfo() error
    pkg syscall (windows-386), func ReadConsole(Handle, *uint16, uint32, *uint32, *uint8) error
    pkg syscall (windows-386), func UTF16FromString(string) ([]uint16, error)
    pkg syscall (windows-386), func UTF16PtrFromString(string) (*uint16, error)
    pkg syscall (windows-386), func WriteConsole(Handle, *uint16, uint32, *uint32, *uint8) error
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 31 20:37:15 UTC 2022
    - 2.6M bytes
    - Viewed (0)
Back to top