#Converting WIDE string data returned by Windows API
13 messages · Page 1 of 1 (latest)
yay memory unsafety
If you were getting random characters before, it's also possible that the corruption happening is random. I'm guessing it's either getting printed before the string is written, or after the string is overwritten, and if it happens to get timed right, you won't see it.
If you're getting it from a windows API, then either it has some unsafety that isn't being properly handled, or there's a bug in windows.