Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wchar_t and printf not working



All,

This is my first post to darwin-dev and I hope this is on topic.

I have downloaded expat-1.95.8 (an XML cross platform C lib) and it has the option of using UTF-16, which is passed around in wchar_t* variables. I want to print these variables out to stdout, and i am not having any luck.

I try:

printf( "<format string>", element);
where <format string> is "%s", or "%S", or "%ls". Nothing gets printed to screen.


wprintf( L"<format string>", element);
where <format string> is "%s", "%S", "%ls". Weird stuff gets printed to screen.


Could it be that expat is assuming wchar_t is 2 bytes instead of the 4 bytes of darwin running on powerpc?

Regards,
Warwick Hall

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.