-
i did read the man page... from my re-reading i changed %C to %c but otherwise i dont know what to do -- arg1 is a pointer to a wide char array? arg2 is the maximum length of the string (?) arg 3 is the format and the rest are referred to in the format...
is this correct?
ps, dont get my wrong i love how you dont tell me, but rather let me learn on my own (i just need a small extra clue :) )
-
ok im going for the sprintf the bytes to a char array and going from there i found this piece of code does not compile
Code:
#include <stdio.h>
#include <wchar.h>
int main() {
char ch[] = {0x00, 0x6C, 0x00, 0x6F, 0x00, 0x00};
printf("%S", (wchar_t*)ch);
return 0;
}
at all i tried it on multiple architectures.. nothing. right now if i could print the array file_name then i would be a happy person. another thing, does creat() take UTF-16?
thanks
-
The following works for me in VS2005
Code:
#include <stdio.h>
#include <wchar.h>
int main()
{
char ch[] = {0x6C, 0x00, 0x6F, 0x00, 0x00,0x00 };
wchar_t* pCh = (wchar_t*)ch;
wprintf(L"%s\n", pCh);
printf("%S\n", pCh);
return 0;
}
I have no gcc to check it as well
-
that interprets it as a 1 byte string, becuase it prints 'l' (ell) and quits, also if you add a trailing 0x00, (which is evident in my string) then it doesnt print anything...
this is becming an annoyance... is it really that hard to print a 16 bit character string?
(Im not paying out on you, im just surprised :s)
thanks