Swift part9 [無断転載禁止]©5ch.io
レス数が950を超えています。1000を超えると書き込みができなくなります。
0961デフォルトの名無しさん (ワッチョイ 5fc9-fFgi)
2017/02/18(土) 14:10:33.53ID:ss3TDen/0それはたぶんユニコードスカラーリテラルのことを言ってるんじゃないの
普通のStringは実装が_StringCoreで
https://github.com/apple/swift/blob/master/stdlib/public/core/StringCore.swift
_StringCoreの中のバッファは以下の3つどれかが選ばれて
public var asciiBuffer: UnsafeMutableBufferPointer<UTF8.CodeUnit>?
public var nativeBuffer: _StringBuffer?
public var cocoaBuffer: _CocoaString?
NSString由来じゃなくASCIIに収まらないなら_StringBufferが使われて、_StringBufferはUTF16
https://github.com/apple/swift/blob/master/stdlib/public/core/StringBuffer.swift
C文字列から作る系は全部_StringBufferにデコードされる
https://github.com/apple/swift/blob/master/stdlib/public/core/CString.swift
StaticStringはASCIIかUTF8か単一のUnicodeScalar
https://github.com/apple/swift/blob/master/stdlib/public/core/StaticString.swift
レス数が950を超えています。1000を超えると書き込みができなくなります。