Separating null byte separated UNICODE C string.
- by Ramblingwood
First off, this is NOT a duplicate of: http://stackoverflow.com/questions/1911053/turn-a-c-string-with-null-bytes-into-a-char-array , because the given answer doesn't work when the char *'s are Unicode.
I think the problem is that because I am trying to use Unicode and thus wchar_t instead of char, the length of each character is different and thus, this doesn't work (it does in non-unicode):
char *Buffer; // your null-separated strings
char *Current; // Pointer to the current string
// [...]
for (Current = Buffer; *Current; Current += strlen(Current) + 1)
printf("GetOpenFileName returned: %s\n", Current);
Does anyone have a similar solution that works on Unicode strings?
I have been banging my head on the this for over 4 hours now. C doesn't agree with me.