You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letUTF16Data=tryXCTUnwrap(string.data(using:String.Encoding.utf16.rawValue, allowLossyConversion:false))/* as NSData*/
1207
+
letUTF16Length=UTF16Data.count
1208
1208
XCTAssertEqual(UTF16Length,128,"NSString should successfully produce an external UTF16 representation with a length of 128 but got \(UTF16Length) bytes")
letISOLatin1Data=tryXCTUnwrap(string.data(using:String.Encoding.isoLatin1.rawValue, allowLossyConversion:false))/* as NSData*/
1211
+
letISOLatin1Length=ISOLatin1Data.count
1212
1212
XCTAssertEqual(ISOLatin1Length,63,"NSString should successfully produce an external ISOLatin1 representation with a length of 63 but got \(ISOLatin1Length) bytes")
1213
1213
}
1214
1214
1215
1215
do{
1216
1216
letstring=NSString(string:"🐢 encoding all the way down. 🐢🐢🐢")
letUTF16Data=tryXCTUnwrap(string.data(using:String.Encoding.utf16.rawValue, allowLossyConversion:false))/* as NSData*/
1223
+
letUTF16Length=UTF16Data.count
1224
1224
XCTAssertEqual(UTF16Length,74,"NSString should successfully produce an external UTF16 representation with a length of 74 but got \(UTF16Length) bytes")
0 commit comments