EnumerationSwift5.9.0
UTF8
@frozen enum UTF8
Citizens in Swift
Conformances
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
protocol UnicodeCodec
A Unicode encoding form that translates between Unicode scalar values and form-specific code units.
Members
init(
) Creates an instance of the UTF-8 codec.
static var encodedReplacementCharacter: Unicode.UTF8.EncodedScalar
static func decode(Unicode
.UTF8.EncodedScalar) -> Unicode.Scalar static func encode(Unicode
.Scalar) -> Unicode.UTF8.EncodedScalar? static func encode(Unicode
.Scalar, into: (Unicode.UTF8.CodeUnit) -> Void) Encodes a Unicode scalar as a series of code units by calling the given closure on each code unit.
static func isASCII(Unicode
.UTF8.CodeUnit) -> Bool Returns whether the given code unit represents an ASCII scalar
static func isContinuation(Unicode
.UTF8.CodeUnit) -> Bool Returns a Boolean value indicating whether the specified code unit is a UTF-8 continuation byte.
static func transcode<FromEncoding>(FromEncoding
.EncodedScalar, from: FromEncoding.Type) -> Unicode.UTF8.EncodedScalar? static func width(Unicode
.Scalar) -> Int Returns the number of code units required to encode the given Unicode scalar.
func decode<I>(inout I
) -> UnicodeDecodingResult Starts or continues decoding a UTF-8 sequence.
struct ForwardParser
struct ReverseParser
typealias CodeUnit
typealias EncodedScalar