Creates a string from the given Unicode code units in the specified encoding.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
init<C, Encoding>(decoding codeUnits: C, as sourceEncoding: Encoding.Type) where C : Collection, Encoding : _UnicodeEncoding , C.Element == Encoding.CodeUnit
Parameters
codeUnits
A collection of code units encoded in the encoding specified in
source
.Encoding sourceEncoding
The encoding in which
code
should be interpreted.Units