             }
             
         case kCFCharacterSetKeyedCodingTypeBuiltinAndBitmap:
-            aCoder.encode(CFIndex(_CFCharacterSetGetKeyedCodingBuiltinType(_cfObject).rawValue), forKey: .characterSetNewBuiltinIDKey)
+            aCoder.encode(Int(_CFCharacterSetGetKeyedCodingBuiltinType(_cfObject)), forKey: .characterSetNewBuiltinIDKey)
             if isInverted { aCoder.encode(true, forKey: .characterSetNewIsInvertedKey )}
             
             fallthrough

        
        switch _CFCharacterSetGetKeyedCodingType(_cfObject) {
        case kCFCharacterSetKeyedCodingTypeBuiltin:
            aCoder.encode(CFIndex(_CFCharacterSetGetKeyedCodingBuiltinType(_cfObject).rawValue), forKey: .characterSetBuiltinIDKey)
            
        case kCFCharacterSetKeyedCodingTypeRange:
            let range = _CFCharacterSetGetKeyedCodingRange(_cfObject)


#if _runtime(_ObjC)
fileprivate let lastKnownPredefinedCharacterSetConstant = kCFCharacterSetNewline.rawValue

fileprivate extension Int {
    init(_ predefinedSet: CFCharacterSetPredefinedSet) {
        self = predefinedSet.rawValue
    }
}
#else
fileprivate let lastKnownPredefinedCharacterSetConstant = kCFCharacterSetNewline
#endif
