+/* If we're compiling against Tiger headers we can support direct conversion
+ * to UTF32. If we are then run against a pre-Tiger system, the encoding
+ * won't be available so we'll defer to the string->UTF-16->UTF-32 conversion.
+ */
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if(CFStringIsEncodingAvailable(wxCFStringEncodingWcharT))
+ {
+ CFRange fullStringRange = CFRangeMake(0, CFStringGetLength(theString));
+ CFIndex usedBufLen;
+
+ CFIndex charsConverted = CFStringGetBytes(
+ theString,
+ fullStringRange,
+ wxCFStringEncodingWcharT,
+ 0,
+ false,
+ // if dstSize is 0 then pass NULL to get required length in usedBufLen
+ dstSize != 0?(UInt8*)dst:NULL,
+ dstSize * sizeof(wchar_t),
+ &usedBufLen);
+
+ // charsConverted is > 0 iff conversion succeeded
+ if(charsConverted <= 0)
+ return wxCONV_FAILED;