I have an array of uint16 coming from WinAPI PROCESSENTRY32.szExeFile
that I wanna convert to a string.
Here's my var type
var hello [260]uint16
now I need to convert hello to a string. How can I do that?
Edit
Here's what I've tried:
func szExeFileToString(ByteString [260]uint16) string {
b := make([]byte, len(ByteString))
for i, v := range ByteString {
b[i] = byte(v)
}
return string(b)
}
However, this returns pretty weird strings...
result (the function should convert Windows process names in the PROCESSENTRY32.szExeFile
(-> [260]uint16
) type to string)