printf functions fail with non-ascii characters
printf functions fail with non-ascii characters
- Subject: printf functions fail with non-ascii characters
- From: "William H. Schultz" <email@hidden>
- Date: Wed, 5 Sep 2007 10:40:59 -0700
I might be asking a silly question here, but I've been working with this for a few days, and I've narrowed my issues down to this:
The wide character versions of the printf functions are failing with various non-ascii characters, as can be seen with the following code:
#include <stdarg.h> #include <wchar.h>
int main() { wchar_t buf[20]; va_list ap; return vswprintf(buf, 20, L"トネヘ", ap); }
In case the above doesn't properly survive the e-mail, that's just three random Japanese characters in the test string. This code returns -1 instead of the 3 that I would expect by looking at it. The same is true for various other sets of non-ascii characters and various other wide character printf functions.
I'm using Xcode 2.4.1 under 10.4.10 on an Intel machine. This is with g++ version 4.0.1 (build 5367).
Any ideas?
------------------------------- Hank Schultz Cedrus Corporation |
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden