---
title: "CFStringConvertIANACharSetNameToEncoding(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfstringconvertianacharsetnametoencoding(_:)"
---

# CFStringConvertIANACharSetNameToEncoding(_:)

Returns the Core Foundation encoding constant that is the closest mapping to a given IANA registry “charset” name.

## Declaration

```swift
func CFStringConvertIANACharSetNameToEncoding(_ theString: CFString!) -> CFStringEncoding
```

## Parameters

- `theString`: The IANA “charset” name to use.

## Return Value

Return Value The Core Foundation string encoding that is closest to the IANA “charset” IANAName. Returns the kCFStringEncodingInvalidId constant if the name is not recognized.

## Discussion

Discussion The CFStringConvertEncodingToIANACharSetName(_:) function is complementary to this function.

## See Also

### Working With Encodings

- [CFStringConvertEncodingToIANACharSetName(_:)](corefoundation/cfstringconvertencodingtoianacharsetname(_:).md)
- [CFStringConvertEncodingToNSStringEncoding(_:)](corefoundation/cfstringconvertencodingtonsstringencoding(_:).md)
- [CFStringConvertEncodingToWindowsCodepage(_:)](corefoundation/cfstringconvertencodingtowindowscodepage(_:).md)
- [CFStringConvertNSStringEncodingToEncoding(_:)](corefoundation/cfstringconvertnsstringencodingtoencoding(_:).md)
- [CFStringConvertWindowsCodepageToEncoding(_:)](corefoundation/cfstringconvertwindowscodepagetoencoding(_:).md)
- [CFStringGetFastestEncoding(_:)](corefoundation/cfstringgetfastestencoding(_:).md)
- [CFStringGetListOfAvailableEncodings()](corefoundation/cfstringgetlistofavailableencodings().md)
- [CFStringGetMaximumSizeForEncoding(_:_:)](corefoundation/cfstringgetmaximumsizeforencoding(_:_:).md)
- [CFStringGetMostCompatibleMacStringEncoding(_:)](corefoundation/cfstringgetmostcompatiblemacstringencoding(_:).md)
- [CFStringGetNameOfEncoding(_:)](corefoundation/cfstringgetnameofencoding(_:).md)
- [CFStringGetSmallestEncoding(_:)](corefoundation/cfstringgetsmallestencoding(_:).md)
- [CFStringGetSystemEncoding()](corefoundation/cfstringgetsystemencoding().md)
- [CFStringIsEncodingAvailable(_:)](corefoundation/cfstringisencodingavailable(_:).md)
