UTF16
You’re reading documentation from an older version of Swift 6.1.
A symbol with the same signature as this one exists in the latest stable release of Swift 6.1.
@frozen enum UTF16You’re reading documentation from an older version of Swift 6.1.
A symbol with the same signature as this one exists in the latest stable release of Swift 6.1.
@frozen enum UTF16import Swift@frozen enum UnicodeA namespace for Unicode utilities.
@frozen enum ASCIIstruct CanonicalCombiningClassThe classification of a scalar used in the Canonical Ordering Algorithm defined by the Unicode Standard.
enum GeneralCategoryThe most general classification of a Unicode scalar.
enum NumericTypeThe numeric type of a scalar.
@frozen enum ParseResult<T>The result of attempting to parse a T from some input.
@frozen struct ScalarA Unicode scalar value.
@frozen enum UTF32@frozen enum UTF8typealias Encoding = _UnicodeEncodingtypealias Parser = _UnicodeParsertypealias Version = (major: Int, minor: Int)A version of the Unicode Standard represented by its major and minor components.
protocol BitwiseCopyableprotocol CopyableA type whose values can be implicitly or explicitly copied.
protocol Escapableprotocol Sendableprotocol UnicodeCodec : _UnicodeEncodingA Unicode encoding form that translates between Unicode scalar values and form-specific code units.
init() Creates an instance of the UTF-16 codec.
static var encodedReplacementCharacter: Unicode.UTF16.EncodedScalar { get }static func decode(_ source: Unicode.UTF16.EncodedScalar) -> Unicode.Scalar static func encode(_ source: Unicode.Scalar) -> Unicode.UTF16.EncodedScalar? static func encode(_ input: Unicode.Scalar, into processCodeUnit: (Unicode.UTF16.CodeUnit) -> Void) Encodes a Unicode scalar as a series of code units by calling the given closure on each code unit.
static func isASCII(_ x: Unicode.UTF16.CodeUnit) -> Bool Returns whether the given code unit represents an ASCII scalar
static func isLeadSurrogate(_ x: Unicode.UTF16.CodeUnit) -> Bool Returns a Boolean value indicating whether the specified code unit is a high-surrogate code unit.
static func isSurrogate(_ x: Unicode.UTF16.CodeUnit) -> Bool Returns a Boolean value indicating whether the specified code unit is a high or low surrogate code unit.
static func isTrailSurrogate(_ x: Unicode.UTF16.CodeUnit) -> Bool Returns a Boolean value indicating whether the specified code unit is a low-surrogate code unit.
static func leadSurrogate(_ x: Unicode.Scalar) -> UTF16.CodeUnit Returns the high-surrogate code unit of the surrogate pair representing the specified Unicode scalar.
static func trailSurrogate(_ x: Unicode.Scalar) -> UTF16.CodeUnit Returns the low-surrogate code unit of the surrogate pair representing the specified Unicode scalar.
static func transcode<FromEncoding>(_ content: FromEncoding.EncodedScalar, from _: FromEncoding.Type) -> Unicode.UTF16.EncodedScalar? where FromEncoding : _UnicodeEncoding static func transcodedLength<Input, Encoding>(of input: Input, decodedAs sourceEncoding: Encoding.Type, repairingIllFormedSequences: Bool) -> (count: Int, isASCII: Bool)? where Input : IteratorProtocol, Encoding : _UnicodeEncoding, Input.Element == Encoding.CodeUnit Returns the number of UTF-16 code units required for the given code unit sequence when transcoded to UTF-16, and a Boolean value indicating whether the sequence was found to contain only ASCII characters.
static func width(_ x: Unicode.Scalar) -> Int Returns the number of code units required to encode the given Unicode scalar.
mutating func decode<I>(_ input: inout I) -> UnicodeDecodingResult where I : IteratorProtocol, I.Element == UInt16 Starts or continues decoding a UTF-16 sequence.
@frozen struct ForwardParser@frozen struct ReverseParsertypealias CodeUnit = UInt16typealias EncodedScalar