Hi,

I want to print a possible exception in function *runscript* to stdout,
but I have a problem with this  JSStringRef.

What I currently do is:

if (fwide(stdout, 1) >0) .....

JSStringRef str = JSStringCreateWithUTF8CString("test");

const JSChar *c = JSStringGetCharactersPtr(str);
for(int i=0; i<JSStringGetLength(str); i++) {
        wprintf(L"%s", c); c++;
}

because wprintf(L"%s",  JSStringGetCharactersPtr(str) )
just prints the first character or gibberish with "%ls".
Same, if I don't use wide mode and just printf.
It always prints only the first character.

So, what's the right way?

Greetings
Christian


Reply via email to