---
title: "CTFontGetStringEncoding(_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontgetstringencoding(_:)"
---

# CTFontGetStringEncoding(_:)

Returns the best string encoding for legacy format support.

## Declaration

```swift
func CTFontGetStringEncoding(_ font: CTFont) -> CFStringEncoding
```

## Parameters

- `font`: The font reference.

## Return Value

Return Value The best string encoding for the font.

## See Also

### Working With Encoding

- [CTFontCopyCharacterSet(_:)](coretext/ctfontcopycharacterset(_:).md)
- [CTFontCopySupportedLanguages(_:)](coretext/ctfontcopysupportedlanguages(_:).md)
