<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body
bgcolor="#FFFFFF" text="#000000">
Next question in my migration. How do I do what this did in Swift 2.2?<br>
<br>
<span style="font-family: monospace;">let theData = String.init(bytes:
data.memory, length: length, encoding: NSUTF8StringEncoding)</span><br
style="font-family: monospace;">
<br>
The only initialisers that have a length are<br>
<br>
<span style="font-family: monospace;">init?(bytesNoCopy:
UnsafeMutableRawPointer, length: Int, encoding: String.Encoding,
freeWhenDone: Bool)</span><br style="font-family: monospace;">
<span style="font-family: monospace;">init(utf16CodeUnitsNoCopy:
UnsafePointer<unichar>, count: Int, freeWhenDone: Bool)</span><br
style="font-family: monospace;">
<br>
Neither is applicable.<br>
<br>
Do I need to push it into a Data object first, like this?<br>
<br>
<span style="font-family: monospace;">let theData = String.init(data:
Data.init(bytes: data, length: length), encoding: String.Encoding.utf8)</span><br
style="font-family: monospace;">
<br>
Or is there a better way that I've missed (highly possible)?<br>
<br>
John<br>
<div class="moz-signature">-- <br>John Brownie<br>
In Finland on furlough from SIL Papua New Guinea<br>
</div>
</body>
</html>