String.Encoding struct features several unicode related implementations:
https://developer.apple.com/documentation/swift/string/encoding
utf8utf16and its modificationsutf32and its modifications- and suddenly,
unicode
What is this unicode case, what's it for? Is this just an alias to some particular encoding like utf16? Or maybe, this is just some umbrella value which means "any unicode encoding" and in some contexts it will evaluate to utf8, and in some - to utf16?
Looking at the source code for swift-corelibs-foundation,
utf16is the same asunicode:This makes sense, as the
NSStringEncoding(which presumably is what the cases ofString.Encodingare based on) values are also like this. The docs forNSUTF16StringEncodingsays it is an alias ofNSUnicodeStringEncoding.