<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStringEncoding",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFStringEncoding"
  },
  "title" : "CFStringEncoding"
}
-->

# CFStringEncoding

An integer type for constants used to specify supported string encodings in various CFString functions.

```
typealias CFStringEncoding = UInt32
```

## Discussion

This type is used to define the constants for the built-in encodings (see [`CFStringBuiltInEncodings`](/documentation/CoreFoundation/CFStringBuiltInEncodings) for a list) and for platform-dependent encodings (see [External String Encodings](/documentation/CoreFoundation/external-string-encodings)). If CFString does not recognize or support the string encoding of a particular string, CFString functions will identify the string’s encoding as [`kCFStringEncodingInvalidId`](/documentation/CoreFoundation/kCFStringEncodingInvalidId).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)