Generic Initializer

init(decodingCString:as:)

Creates a string from the null-terminated sequence of bytes at the given pointer.

Required.

Declaration

init<Encoding>(decodingCString nullTerminatedCodeUnits: UnsafePointer<Encoding.CodeUnit>, as sourceEncoding: Encoding.Type) where Encoding : _UnicodeEncoding

Parameters

nullTerminatedCodeUnits

A pointer to a sequence of contiguous code units in the encoding specified in sourceEncoding, ending just before the first zero code unit.

sourceEncoding

The encoding in which the code units should be interpreted.