From db04bbf9e27a3e91f77335fb0c77c1cca5219ed6 Mon Sep 17 00:00:00 2001 From: Apple Date: Tue, 23 Jun 2015 22:35:45 +0000 Subject: [PATCH] CF-1153.18.tar.gz --- CFAvailability.h | 2 + CFCharacterSetBitmaps.bitmap | Bin 434391 -> 434391 bytes CFDateFormatter.c | 2 +- CFPriv.h | 2 +- CFSocket.c | 49 +++------- CFString.c | 161 ++++++++++++++++++++++++++++++++- CFStringEncodingConverter.c | 18 ++-- CFStringEncodings.c | 6 ++ CFURLPriv.h | 17 ++++ CFUniCharPropertyDatabase.data | Bin 31780 -> 36900 bytes CFUnicodeData-B.mapping | Bin 90744 -> 91792 bytes CFUnicodeData-L.mapping | Bin 90744 -> 91792 bytes CFVersion.c | 4 +- MakefileVersion | 2 +- 14 files changed, 212 insertions(+), 51 deletions(-) diff --git a/CFAvailability.h b/CFAvailability.h index 76a14b0..fb1d44d 100644 --- a/CFAvailability.h +++ b/CFAvailability.h @@ -82,6 +82,7 @@ #define __NSi_10_9 introduced=10.9 #define __NSi_10_10 introduced=10.10 #define __NSi_10_10_2 introduced=10.10.2 +#define __NSi_10_10_3 introduced=10.10.3 #define __NSd_2_0 ,deprecated=2.0 #define __NSd_2_1 ,deprecated=2.1 @@ -115,6 +116,7 @@ #define __NSd_10_9 ,deprecated=10.9 #define __NSd_10_10 ,deprecated=10.10 #define __NSd_10_10_2 ,deprecated=10.10.2 +#define __NSd_10_10_3 ,deprecated=10.10.3 #define __NSi_NA unavailable #define __NSd_NA diff --git a/CFCharacterSetBitmaps.bitmap b/CFCharacterSetBitmaps.bitmap index 81fa63db5ca3004f01d8481036243b1b497a01d8..1e52a8d5826410a31dcd1849f3f36fae6e7cc508 100644 GIT binary patch delta 4674 zcmc&%eQ;FO6@T}>kKL?Ec0-l`A=!_hL1>jlu|z}IT@u8PD*Qnx#Zfo0IF8z=Xr0ce zyoclWl){@Q9zR-Q6vT-$K-|jhfF--~VePbLX+_3XA<+tz(hw#^;{^8h-1qX507m?$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UKse>b-E}P1UHR;ntYCj#S5J zOl>SpCKZk(RY$VF%S+0^QXu@1b813$+~m`WSUP^or_EmIxl)Wz&GAxKqDv~*GMmI` zAVmo}=|=R(G7NuDcJOyEsPBlo_Tb0r_sdgWnm0*y%ZZpM?1cyk9k*0{j~*%Ft3FY0 zx7164K#TpkE^Rv@Y%^>M9s?MnHo6M9YJ+v~J97+&ZA z7cTc{&P1)|O%`f;q!#aeNw$<5|C^5uy6{YcR%4yJR@$jLke2z%8ZDvO7T}gP5(K{< fn5x@Sc@s+p{aW!g^F6h7B3}-VrV=LY#@zn_r{Z*0 diff --git a/CFDateFormatter.c b/CFDateFormatter.c index 71c5da0..0021d49 100644 --- a/CFDateFormatter.c +++ b/CFDateFormatter.c @@ -1154,7 +1154,7 @@ static CFStringRef __CFDateFormatterCreateForcedString(CFDateFormatterRef format } else if (err == U_BUFFER_OVERFLOW_ERROR) { err = U_ZERO_ERROR; UChar *largerBuffer = calloc(newPatternLen + 1, sizeof(UChar)); - newPatternLen = uadatpg_remapPatternWithOptions(ptg, ustr, cnt, options, outBuffer, newPatternLen + 1, &err); + newPatternLen = uadatpg_remapPatternWithOptions(ptg, ustr, cnt, options, largerBuffer, newPatternLen + 1, &err); if (U_SUCCESS(err)) { result = CFStringCreateWithCharacters(kCFAllocatorSystemDefault, largerBuffer, newPatternLen); } diff --git a/CFPriv.h b/CFPriv.h index 475a4b2..72131bc 100644 --- a/CFPriv.h +++ b/CFPriv.h @@ -497,7 +497,7 @@ void CFCharacterSetInitInlineBuffer(CFCharacterSetRef cset, CFCharacterSetInline @result true, if the value is in the character set, otherwise false. */ #if defined(CF_INLINE) -CF_INLINE bool CFCharacterSetInlineBufferIsLongCharacterMember(CFCharacterSetInlineBuffer *buffer, UTF32Char character) { +CF_INLINE bool CFCharacterSetInlineBufferIsLongCharacterMember(const CFCharacterSetInlineBuffer *buffer, UTF32Char character) { bool isInverted = ((0 == (buffer->flags & kCFCharacterSetIsInverted)) ? false : true); if ((character >= buffer->rangeStart) && (character < buffer->rangeLimit)) { diff --git a/CFSocket.c b/CFSocket.c index 0fa2d04..5771abb 100644 --- a/CFSocket.c +++ b/CFSocket.c @@ -1672,46 +1672,21 @@ static void __CFSocketHandleRead(CFSocketRef s, Boolean causedByTimeout) if (ctRemaining > 0) { base = CFDataGetMutableBytePtr(s->_readBuffer); - struct timeval timeBeforeRead = { 0 }; - gettimeofday(&timeBeforeRead, NULL); - - struct timeval deadlineTime = { 0 }; - timeradd(&timeBeforeRead, &s->_readBufferTimeout, &deadlineTime); - - struct timeval timeAfterRead = { 0 }; - - while (1) { - ctRead = read(CFSocketGetNative(s), &base[s->_bytesToBufferPos], ctRemaining); - - if (ctRead >= 0) { - break; - } - - if (errno != EAGAIN) { - break; - } - - gettimeofday(&timeAfterRead, NULL); - - if (timercmp(&timeAfterRead, &deadlineTime, >)) { -#if defined(LOG_CFSOCKET) - CFSocketNativeHandle fd = CFSocketGetNative(s); - CFStringRef peerName = copyPeerAddress(kCFAllocatorDefault, fd); - CFStringRef localName = copyLocalAddress(kCFAllocatorDefault, fd); - CFLog(kCFLogLevelCritical, CFSTR("ERROR: Buffered read of %llu bytes failed for fd %d (socket valid? %d fd valid? %d %@ => %@)"), ctRemaining, fd, __CFSocketIsValid(s), __CFNativeSocketIsValid(fd), localName, peerName); - if (peerName) - CFRelease(peerName); - if (localName) - CFRelease(localName); -#endif - break; - } - } + ctRead = read(CFSocketGetNative(s), &base[s->_bytesToBufferPos], ctRemaining); switch (ctRead) { case -1: - s->_bufferedReadError = errno; - s->_atEOF = true; + if (errno == EAGAIN) { // no error + __CFLock(&__CFActiveSocketsLock); + /* restore socket to fds */ + __CFSocketSetFDForRead(s); + __CFUnlock(&__CFActiveSocketsLock); + __CFSocketUnlock(s); + return; + } else { + s->_bufferedReadError = errno; + s->_atEOF = true; + } #if defined(LOG_CFSOCKET) fprintf(stderr, "BUFFERED READ GOT ERROR %d\n", errno); #endif diff --git a/CFString.c b/CFString.c index 92ae1eb..74527d4 100644 --- a/CFString.c +++ b/CFString.c @@ -3398,6 +3398,98 @@ enum { kCFStringHangulStateBreak }; +static const CFCharacterSetInlineBuffer *__CFStringGetFitzpatrickModifierBaseCharacterSet(void) { + static CFCharacterSetInlineBuffer buffer; + static dispatch_once_t initOnce; + dispatch_once(&initOnce, ^{ // based on UTR#51 1.0 (draft 7) for Unicode 8.0 + /* + U+261D WHITE UP POINTING INDEX + U+2639 WHITE FROWNING FACE…U+263A WHITE SMILING FACE + U+270A RAISED FIST…U+270D WRITING HAND + U+1F385 FATHER CHRISTMAS + U+1F3C2 SNOWBOARDER…U+1F3C4 SURFER + U+1F3C7 HORSE RACING + U+1F3CA SWIMMER + U+1F442 EAR…U+1F443 NOSE + U+1F446 WHITE UP POINTING BACKHAND INDEX…U+1F450 OPEN HANDS SIGN + U+1F466 BOY…U+1F469 WOMAN + U+1F46E POLICE OFFICER…U+1F478 PRINCESS + U+1F47C BABY ANGEL + U+1F47F IMP + U+1F481 INFORMATION DESK PERSON…U+1F482 GUARDSMAN + U+1F483 DANCER + U+1F485 NAIL POLISH + U+1F486 FACE MASSAGE…U+1F487 HAIRCUT + U+1F4AA FLEXED BICEPS + U+1F590 RAISED HAND WITH FINGERS SPLAYED + U+1F595 REVERSED HAND WITH MIDDLE FINGER EXTENDED…U+1F596 RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + U+1F600 GRINNING FACE…U+1F637 FACE WITH MEDICAL MASK + U+1F641 SLIGHTLY FROWNING FACE…U+1F642 SLIGHTLY SMILING FACE + U+1F645 FACE WITH NO GOOD GESTURE…U+1F647 PERSON BOWING DEEPLY + U+1F64B HAPPY PERSON RAISING ONE HAND + U+1F64C PERSON RAISING BOTH HANDS IN CELEBRATION + U+1F64D PERSON FROWNING…U+1F64E PERSON WITH POUTING FACE + U+1F64F PERSON WITH FOLDED HANDS + U+1F6A3 ROWBOAT + U+1F6B4 BICYCLIST…U+1F6B6 PEDESTRIAN + U+1F6C0 BATH + */ + CFMutableCharacterSetRef cset = CFCharacterSetCreateMutable(NULL); + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x261D, 1)); // WHITE UP POINTING INDEX + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x2639, 2)); // WHITE FROWNING FACE ~ WHITE SMILING FACE + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x270A, 4)); // RAISED FIST ~ WRITING HAND + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F385, 1)); // FATHER CHRISTMAS + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F3C2, 3)); // SNOWBOARDER ~ SURFER + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F3C7, 1)); // HORSE RACING + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F3CA, 1)); // SWIMMER + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F442, 2)); // EAR ~ NOSE + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F446, 0x1F451 - 0x1F446)); // WHITE UP POINTING BACKHAND INDEX ~ OPEN HANDS SIGN + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F466, 4)); // BOY ~ WOMAN + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F46E, 0x1F479 - 0x1F46E)); // POLICE OFFICER ~ PRINCESS + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F47C, 1)); // BABY ANGEL + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F47F, 1)); // IMP + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F481, 3)); // INFORMATION DESK PERSON ~ DANCER + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F485, 3)); // NAIL POLISH ~ HAIRCUT + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F4AA, 1)); // FLEXED BICEPS + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F590, 1)); // RAISED HAND WITH FINGERS SPLAYED + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F595, 2)); // REVERSED HAND WITH MIDDLE FINGER EXTENDED ~ RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F600, 0x1F638 - 0x1F600)); // GRINNING FACE ~ FACE WITH MEDICAL MASK + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F641, 2)); // SLIGHTLY FROWNING FACE ~ SLIGHTLY SMILING FACE + + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F645, 3)); // FACE WITH NO GOOD GESTURE ~ PERSON BOWING DEEPLY + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F64B, 0x1F650 - 0x1F64B)); // HAPPY PERSON RAISING ONE HAND ~ PERSON WITH FOLDED HANDS + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F6A3, 1)); // ROWBOAT + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F6B4, 0x1F6B7 - 0x1F6B4)); // BICYCLIST ~ PEDESTRIAN + CFCharacterSetAddCharactersInRange(cset, CFRangeMake(0x1F6C0, 1)); // BATH + CFCharacterSetCompact(cset); + CFCharacterSetInitInlineBuffer(cset, &buffer); + }); + + return (const CFCharacterSetInlineBuffer *)&buffer; +} + +static inline bool __CFStringIsFitzpatrickModifiers(UTF32Char character) { return ((character >= 0x1F3FB) && (character <= 0x1F3FF) ? true : false); } +static inline bool __CFStringIsBaseForFitzpatrickModifiers(UTF32Char character) { + if (((character >= 0x2600) && (character < 0x27C0)) || ((character >= 0x1F300) && (character < 0x1F700))) { // Misc symbols, dingbats, & emoticons + return (CFCharacterSetInlineBufferIsLongCharacterMember(__CFStringGetFitzpatrickModifierBaseCharacterSet(), character) ? true : false); + } + + return false; +} + +static inline bool __CFStringIsFamilySequenceBaseCharacterHigh(UTF16Char character) { return (character == 0xD83D) ? true : false; } +static inline bool __CFStringIsFamilySequenceBaseCharacterLow(UTF16Char character) { return (((character >= 0xDC66) && (character <= 0xDC69)) || (character == 0xDC8B) ? true : false); } +static inline bool __CFStringIsFamilySequenceCluster(CFStringInlineBuffer *buffer, CFRange range) { + UTF16Char character = CFStringGetCharacterFromInlineBuffer(buffer, range.location); + + if (character == 0x2764) { // HEART + return true; + } else if (range.length > 1) { + if (__CFStringIsFamilySequenceBaseCharacterHigh(character) && __CFStringIsFamilySequenceBaseCharacterLow(CFStringGetCharacterFromInlineBuffer(buffer, range.location + 1))) return true; + } + return false; +} + static CFRange _CFStringInlineBufferGetComposedRange(CFStringInlineBuffer *buffer, CFIndex start, CFStringCharacterClusterType type, const uint8_t *bmpBitmap, CFIndex csetType) { CFIndex end = start + 1; const uint8_t *bitmap = bmpBitmap; @@ -3430,7 +3522,19 @@ static CFRange _CFStringInlineBufferGetComposedRange(CFStringInlineBuffer *buffe } } - if (!CFUniCharIsMemberOfBitmap(character, bitmap) && (character != 0xFF9E) && (character != 0xFF9F) && ((character & 0x1FFFF0) != 0xF870)) break; + if (__CFStringIsFitzpatrickModifiers(character) && (start > 0)) { + UTF32Char baseCharacter = CFStringGetCharacterFromInlineBuffer(buffer, start - 1); + + if (CFUniCharIsSurrogateLowCharacter(baseCharacter) && ((start - 1) > 0)) { + UTF16Char otherCharacter = CFStringGetCharacterFromInlineBuffer(buffer, start - 2); + + if (CFUniCharIsSurrogateHighCharacter(otherCharacter)) baseCharacter = CFUniCharGetLongCharacterForSurrogatePair(otherCharacter, baseCharacter); + } + + if (!__CFStringIsBaseForFitzpatrickModifiers(baseCharacter)) break; + } else { + if (!CFUniCharIsMemberOfBitmap(character, bitmap) && (character != 0xFF9E) && (character != 0xFF9F) && ((character & 0x1FFFF0) != 0xF870)) break; + } --start; @@ -3522,6 +3626,8 @@ static CFRange _CFStringInlineBufferGetComposedRange(CFStringInlineBuffer *buffe } } + bool prevIsFitzpatrickBase = __CFStringIsBaseForFitzpatrickModifiers(character); + // Extend forward while ((character = CFStringGetCharacterFromInlineBuffer(buffer, end)) > 0) { if ((type == kCFStringBackwardDeletionCluster) && (character >= 0x0530) && (character < 0x1950)) break; @@ -3535,7 +3641,9 @@ static CFRange _CFStringInlineBufferGetComposedRange(CFStringInlineBuffer *buffe step = 1; } - if (!CFUniCharIsMemberOfBitmap(character, bitmap) && (character != 0xFF9E) && (character != 0xFF9F) && ((character & 0x1FFFF0) != 0xF870)) break; + if ((!prevIsFitzpatrickBase || !__CFStringIsFitzpatrickModifiers(character)) && !CFUniCharIsMemberOfBitmap(character, bitmap) && (character != 0xFF9E) && (character != 0xFF9F) && ((character & 0x1FFFF0) != 0xF870)) break; + + prevIsFitzpatrickBase = __CFStringIsBaseForFitzpatrickModifiers(character); end += step; } @@ -3673,7 +3781,54 @@ CFRange CFStringGetRangeOfCharacterClusterAtIndex(CFStringRef string, CFIndex ch } ++currentIndex; } - + + // Family face sequence + CFRange aCluster; + + if (range.location > 1) { // there are more than 2 chars + character = CFStringGetCharacterFromInlineBuffer(&stringBuffer, range.location); + + if (__CFStringIsFamilySequenceCluster(&stringBuffer, range) || (character == ZERO_WIDTH_JOINER)) { // extend backward + currentIndex = (character == ZERO_WIDTH_JOINER) ? range.location + 1 : range.location; + + while ((currentIndex > 1) && (ZERO_WIDTH_JOINER == CFStringGetCharacterFromInlineBuffer(&stringBuffer, currentIndex - 1))) { + aCluster = _CFStringInlineBufferGetComposedRange(&stringBuffer, currentIndex - 2, type, bmpBitmap, csetType); + + if (__CFStringIsFamilySequenceCluster(&stringBuffer, aCluster) && (aCluster.location < range.location)) { + currentIndex = aCluster.location; + } else { + break; + } + } + + if (currentIndex < range.location) { + range.length += range.location - currentIndex; + range.location = currentIndex; + } + } + } + + // Extend forward + if (range.location + range.length < length) { + currentIndex = range.location + range.length - 1; + character = CFStringGetCharacterFromInlineBuffer(&stringBuffer, currentIndex); + + if ((ZERO_WIDTH_JOINER == character) || __CFStringIsFamilySequenceCluster(&stringBuffer, _CFStringInlineBufferGetComposedRange(&stringBuffer, currentIndex, type, bmpBitmap, csetType))) { + + if (ZERO_WIDTH_JOINER != character) ++currentIndex; // move to the end of cluster + + while (((currentIndex + 1) < length) && (ZERO_WIDTH_JOINER == CFStringGetCharacterFromInlineBuffer(&stringBuffer, currentIndex))) { + aCluster = _CFStringInlineBufferGetComposedRange(&stringBuffer, currentIndex + 1, type, bmpBitmap, csetType); + if (__CFStringIsFamilySequenceCluster(&stringBuffer, aCluster)) { + currentIndex = aCluster.location + aCluster.length; + if ((aCluster.length > 1) && (ZERO_WIDTH_JOINER == CFStringGetCharacterFromInlineBuffer(&stringBuffer, currentIndex - 1))) --currentIndex; + } else { + break; + } + } + if (currentIndex > (range.location + range.length)) range.length = currentIndex - range.location; + } + } return range; } diff --git a/CFStringEncodingConverter.c b/CFStringEncodingConverter.c index 546306c..f3773bf 100644 --- a/CFStringEncodingConverter.c +++ b/CFStringEncodingConverter.c @@ -768,9 +768,13 @@ uint32_t CFStringEncodingUnicodeToBytes(uint32_t encoding, uint32_t flags, const CFIndex localUsedLen; localUsedByteLen = 0; - while ((usedLen < numChars && theUsedByteLen < maxByteLen) && !localUsedByteLen && (localUsedLen = TO_BYTE_FALLBACK(converter, characters + usedLen, numChars - usedLen, NULL, 0, &localUsedByteLen))) usedLen += localUsedLen; - - theUsedByteLen += localUsedByteLen; + // after the buffer is full, we still try out all the rest of the characters + // if all characters cannot be converted, we mark the result as insufficient output buffer + while ((usedLen < numChars) && !localUsedByteLen && (localUsedLen = TO_BYTE_FALLBACK(converter, characters + usedLen, numChars - usedLen, NULL, 0, &localUsedByteLen))) { + if (localUsedByteLen == 0) { + usedLen += localUsedLen; + } + } } if (usedLen < numChars) theResult = kCFStringEncodingInsufficientOutputBufferLength; break; @@ -799,9 +803,11 @@ uint32_t CFStringEncodingUnicodeToBytes(uint32_t encoding, uint32_t flags, const CFIndex localUsedLen; localUsedByteLen = 0; - while ((usedLen < numChars && theUsedByteLen < maxByteLen) && !localUsedByteLen && (localUsedLen = TO_BYTE_FALLBACK(converter, characters + usedLen, numChars - usedLen, NULL, 0, &localUsedByteLen))) usedLen += localUsedLen; - - theUsedByteLen += localUsedByteLen; + while ((usedLen < numChars) && !localUsedByteLen && (localUsedLen = TO_BYTE_FALLBACK(converter, characters + usedLen, numChars - usedLen, NULL, 0, &localUsedByteLen))) { + if (!localUsedByteLen) { + usedLen += localUsedLen; + } + } } if (usedLen < numChars) theResult = kCFStringEncodingInsufficientOutputBufferLength; } diff --git a/CFStringEncodings.c b/CFStringEncodings.c index 7f79a2d..876e204 100644 --- a/CFStringEncodings.c +++ b/CFStringEncodings.c @@ -955,6 +955,8 @@ void _CFStringGetUserDefaultEncoding(UInt32 *oScriptValue, UInt32 *oRegionValue) if (stringValue) { *oScriptValue = strtol_l(stringValue, &stringValue, 0, NULL); + // We force using MacRoman for Arabic/Hebrew users When changing language to Arabic and Hebrew, set the default user encoding to MacRoman, not MacArabic/MacHebrew + if ((*oScriptValue == kCFStringEncodingMacArabic) || (*oScriptValue == kCFStringEncodingMacHebrew)) *oScriptValue = kCFStringEncodingMacRoman; if (*stringValue == ':') { if (oRegionValue) *oRegionValue = strtol_l(++stringValue, NULL, 0, NULL); return; @@ -994,6 +996,8 @@ void _CFStringGetInstallationEncodingAndRegion(uint32_t *encoding, uint32_t *reg if (stringValue) { *encoding = strtol_l(stringValue, &stringValue, 0, NULL); + // We force using MacRoman for Arabic/Hebrew users When changing language to Arabic and Hebrew, set the default user encoding to MacRoman, not MacArabic/MacHebrew + if ((*encoding == kCFStringEncodingMacArabic) || (*encoding == kCFStringEncodingMacHebrew)) *encoding = kCFStringEncodingMacRoman; if (*stringValue == ':') *region = strtol_l(++stringValue, NULL, 0, NULL); } } @@ -1017,6 +1021,8 @@ Boolean _CFStringSaveUserDefaultEncoding(UInt32 iScriptValue, UInt32 iRegionValu int fd = open(filename, O_WRONLY|O_CREAT, 0400); if (0 <= fd) { char buffer[__kCFMaxDefaultEncodingFileLength]; + // We force using MacRoman for Arabic/Hebrew users When changing language to Arabic and Hebrew, set the default user encoding to MacRoman, not MacArabic/MacHebrew + if ((iScriptValue == kCFStringEncodingMacArabic) || (iScriptValue == kCFStringEncodingMacHebrew)) iScriptValue = kCFStringEncodingMacRoman; size_t size = snprintf(buffer, __kCFMaxDefaultEncodingFileLength, "0x%X:0x%X", (unsigned int)iScriptValue, (unsigned int)iRegionValue); if (size <= __kCFMaxDefaultEncodingFileLength) { int ret = write(fd, buffer, size); diff --git a/CFURLPriv.h b/CFURLPriv.h index 8d4d37a..b90699a 100644 --- a/CFURLPriv.h +++ b/CFURLPriv.h @@ -291,6 +291,23 @@ CF_EXPORT const CFStringRef kCFURLUbiquitousItemDownloadRequestedKey CF_AVAILABL CF_EXPORT const CFStringRef kCFURLUbiquitousItemContainerDisplayNameKey CF_AVAILABLE(10_10, 8_0); /* Returns the localized name of the ubiquity container that contains this item (Read-only, value type CFString) */ +CF_EXPORT const CFStringRef kCFURLUbiquitousItemIsSharedKey; // true if the ubiquitous item is shared. (Read-only, value type boolean NSNumber) + +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemRoleKey /*CF_AVAILABLE(10_11, 9_0)*/; // returns the current user's role for this shared item, or nil if not shared. (Read-only, value type NSString). Possible values below. +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemRoleOwner /*CF_AVAILABLE(10_11, 9_0)*/; // the current user is the owner of this shared item. +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemRoleParticipant /*CF_AVAILABLE(10_11, 9_0)*/; // the current user is a participant of this shared item. + +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemOwnerNameKey /*CF_AVAILABLE(10_11, 9_0)*/; // returns the name of the owner of a shared item, or nil if the current user. (Read-only, value type NSString) + +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemPermissionsKey /*CF_AVAILABLE(10_11, 9_0)*/; // returns the current user's permissions for this shared item. (Read-only, value type NSString). Possible values below. +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemPermissionsReadOnly /*CF_AVAILABLE(10_11, 9_0)*/; // the user is only allowed to read this item +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemPermissionsReadWrite /*CF_AVAILABLE(10_11, 9_0)*/; // the user is allowed to both read and write this item + +// Deprecated. Will be removed. +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemReadOnlyPermissions /*CF_AVAILABLE(10_11, 9_0)*/; // the user is only allowed to read this item +CF_EXPORT const CFStringRef kCFURLUbiquitousSharedItemReadWritePermissions /*CF_AVAILABLE(10_11, 9_0)*/; // the user is allowed to both read and write this item + + // these keys are defined here, not in CFURL.h, because they return NSImage values which can only be used by Foundation CF_EXPORT const CFStringRef kCFURLThumbnailDictionaryKey CF_AVAILABLE(10_10, 8_0); CF_EXPORT const CFStringRef kCFURLThumbnailKey CF_AVAILABLE(10_10, 8_0); diff --git a/CFUniCharPropertyDatabase.data b/CFUniCharPropertyDatabase.data index e5de170467bdc85f12cf3cd3791aa17a6df8e632..c573dbc19a1a08894c86adde5f081b2ff4468be7 100644 GIT binary patch delta 1328 zcmYjRUr1YL6wh~aZ?5^LHzvmVH_;}I%|GLx#u;NZ#^~ywnOGTuI&QHPGu)`1owj@M zWw3|g=JhxB(n2drVK9dCgFWtK5rj0!7bly2xK!d^zp_OQ3@+-q!i;O0B$eCK!0 z`F`K|vhxqyxhuH45(yKDVls7#Cey4UG*@o9Wk?MvJ}$2~@UJ9EPjtam(Su##3i7go z-|Qj2=2>SD>%HXM!y|79O09VEnU9W+xUIU)W-+i&uvNaVsiKz&X1$upM72mHi(F>4 z*|ow&!Qs>jc~-6!JVJ${6{?tvKX3LhJa#TofouAzsX@IR+!i*`6!--Z_XSNoMZI*> zm%@+1`_!9DQ`2O=t*J73h6(!?lW{0dVqXpuT-F-^YdF7m+QslgaD*bh(jzrhPeV9s z3HKM&yo7fbJenHPf#_*^Ou_5eADyE09e$(b79(Z<S_ z>Pdq|YgjLu;;)yTXMO#df$Sg|6H-nZ8h(`rBI_d2VHMC8i{bayVP@vx#4Q2W->AgX zw#a6}f{J!4QZX;=xhf>$&3O2x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2T?mc9I? ilAYs2p9?FttX-ANmh7@Zb_vMV_%1-}bX?Y}O{;(IxNPqL diff --git a/CFUnicodeData-L.mapping b/CFUnicodeData-L.mapping index e45d88567e6de7a47a3744bc2edf5a120e1fb8f1..8acb0d8c430f6db27bbcdb6963672956604dacac 100644 GIT binary patch delta 1312 zcmXZcS!h&O9LMqBNu8NelBkKwJebsqS&SNkf?^*O+lPWx5J41iNm>z?zE%X0>0cjw zDij7>G8(P68FdoPCCDsP0;(#qDAEqX<|gK0w>{Q zoPw1&)qkJ2d3fHgdTDpPTrH;j^RY=+vLh|+Ov~-U-B^n$+=F|u4)-Ou6i+Y7uv(rY z*MK$Hh~Hro)?pU6`^MtJoW%aP)9JXgpYaSHz#cq^XYm*8#b5Cp)?**0@jM>F-|#U0 zjz{nUX7D05;3aIt%Xk#8;4!=!cL{4^ag8ss*pJP49X;N_<9HKK;4M6fxA7F-!4~`j zTk%h9!vSo^yV!yEuoLfN7e2sld>GGlwvKu++O$mY7sd@l$1pfCKv#`PC&vKQkWL;c zn-*n;YD^~w%07>7XPHeW3(BWOnW&o5{)_S<7kSBr5`I=iYFH70MQBH05!w-0gmzQ0 z()U*uj?5#l2<=i>>mSeA=1K@GLOTMB(2l?&v?H(x?e<}vubG?5NsvwCGqQ<%MmCYp z$R_d`*+f1go5*Km6Zwp6BA<~>C>&9EQUDIh5unU{*R|oANysttZK$rJlt%K z;1Z5j9;%Ha*!00pY~kUKakRcO*_>VPX8WS%^KMGm{fXQUVRtTuUHKTUG6KWy0t~xH z`Nuw!KP%iUOeYwo6K)o!5)4xchUtWxhUtWxhUu*JKlYrRIARa4=DcCNe>fkL3kT!H c%QI3LFXIZFnUPzG8~9&Yg^MzN&0xXCw=p+eLjV8( delta 329 zcmXBL&ntrg90u^``?9?yW*pqGSZgn(*N?P|!#GS1E2Ny5ABQ<{Kn_Ck2drL)U6g~G zgUkB195z21ap54hB`rykw6w#k96aTF`8+*6-_*Uwz4n9#`)vgAe@6jeGzOH%fZuVz z%>v0HkPc)+U8YW(VXq!GY&2@PH6>2D&DKb}->6&Sw^;+&ojTD`@_G{n;D|G9^*NhX z#3@*|RxMYw+MTY|6WiaUchMcu)seKJ^|7E&!rD9a*t0$JASjvGouyASL7z<&=V+PE z(-*oxU+E%!qj~zyeSv<^Gy2K?oPN;@TA`Qpo5D3P6o&|nP=iL}(EMK1b_Q}uiReM@ gR&@XL*vGtfb7i%xWPs%i#HAsD{Lo3!txEIyAIoiQMgRZ+ diff --git a/CFVersion.c b/CFVersion.c index 13faadd..d575112 100644 --- a/CFVersion.c +++ b/CFVersion.c @@ -25,5 +25,5 @@ Copyright 2009-2014, Apple Inc. All rights reserved. Responsibility: CFLite Team */ -const unsigned char kCFCoreFoundationVersionString[] = "@(#)PROGRAM:CoreFoundation PROJECT:CoreFoundation-1152 SYSTEM:Darwin DEVELOPER:unknown BUILT:" __DATE__ " " __TIME__ "\n"; -double kCFCoreFoundationVersionNumber = (double)1152; +const unsigned char kCFCoreFoundationVersionString[] = "@(#)PROGRAM:CoreFoundation PROJECT:CoreFoundation-1153.18 SYSTEM:Darwin DEVELOPER:unknown BUILT:" __DATE__ " " __TIME__ "\n"; +double kCFCoreFoundationVersionNumber = (double)1153.18; diff --git a/MakefileVersion b/MakefileVersion index 6702720..85cecda 100644 --- a/MakefileVersion +++ b/MakefileVersion @@ -1 +1 @@ -VERSION=1152 +VERSION=1153.18 -- 2.45.2