<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 8, 2016, at 10:02 PM, Jacob Bandes-Storch &lt;<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I think it would be more appropriate to use `init(utf8: UnsafeBufferPointer&lt;UInt8&gt;)`, which comprises both a base pointer and a length.</div></div></blockquote><div><br class=""></div><div>Yes. Better.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob Bandes-Storch<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Fri, Jan 8, 2016 at 9:58 PM, Charles Kissinger via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">The String initializer that would actually be of most value to me would be:<div class=""><br class=""></div><div class="">String.init(utf8: UnsafePointer&lt;UInt8&gt;, length: Int)</div><div class=""><br class=""></div><div class="">as long as it is as fast (preferably faster) than String.fromCString() and doesn’t require bridging to NSString. A similar initializer is available for NSString, but as Zach indicated in his link, using it is slow.</div><div class=""><br class=""></div><div class="">Several other initializers, including the one you showed, would be useful, as long as they are performant.</div><div class=""><br class=""></div><div class="">—CK</div><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Jan 8, 2016, at 9:04 PM, 品雪 via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class="">Sorry, I didn't get it, are you talking about:<div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span style="color:rgb(187,44,162)" class="">var</span> bytes : [<span style="color:rgb(112,61,170)" class="">UInt8</span>] = [<span style="color:rgb(39,42,216)" class="">65</span>, <span style="color:rgb(39,42,216)" class="">66</span>, <span style="color:rgb(39,42,216)" class="">67</span>, <span style="color:rgb(39,42,216)" class="">68</span>, <span style="color:rgb(39,42,216)" class="">69</span>, <span style="color:rgb(39,42,216)" class="">70</span>];</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span style="color:rgb(187,44,162)" class="">var</span> s = <span style="color:rgb(112,61,170)" class="">String</span>.<span style="color:rgb(187,44,162)" class="">init</span>(bytes: <span style="color:rgb(79,129,135)" class="">bytes</span>, encoding: <span style="color:rgb(112,61,170)" class="">NSUTF8StringEncoding</span>)</div><div class=""><br class=""></div><div class="">?</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Jan 9, 2016 at 8:22 AM, T.J. Usiyan via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class="">I support this change as well.<div class=""><br class=""></div><div class="">TJ</div></div><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Jan 8, 2016 at 6:06 PM, Guillaume Lessard via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Complete agreement from me. I would like to see a String constructor from a Sequence of code units.<br class="">
Also, why is String.fromCString() a factory function rather than a fallible constructor?<br class="">
<br class="">
Guillaume Lessard<br class="">
<div class=""><div class=""><br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</div></div></blockquote></div><br class=""></div>
</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=zv-2Fta8zZnJ-2BWwISX5RHdd79su-2FjoebtLz43a4s-2BYOw1YUwmckQZetWwzLJetjkg0VLSsYeNrva793asxb2J13O0wwqKRDxIuX1zxa3yr9JEBz1QkaGutYcMvEh8twd8aHreITfNteRdIaIIXFmIHam7GtGEq3rInmgnYBA12e6I8pUV52QJZ1uhb-2F70FWI-2BSizejFgZy-2BY-2Blox8jB6myHqQON-2BWIOMwsJohYKvreruE-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important" class="">
<br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div dir="ltr" class="">Best Regards!<br class=""><br class="">Yang Wu<br class="">--------------------------------------------------------<br class="">Location: Pudong, Shanghai, China.<br class="">EMail&nbsp; &nbsp; : <a href="mailto:pinxue@gmail.com" target="_blank" class="">pinxue@gmail.com</a><br class="">Website: <a href="http://www.time2change.mobi/" target="_blank" class="">http://www.time2change.mobi</a>&nbsp;<a href="http://rockplayer.com/" target="_blank" class="">http://rockplayer.com</a><br class="">Twitter/Weibo : @pinxue<br class=""><a href="http://www.pinxue.net/" target="_blank" class=""></a></div></div>
</div></div></div>
</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=F5lQLlMRbBDxNsThVg1FdaN-2FDA1CiFgV-2FmWJt88lR-2Fpi3AyL-2BYPfTLOWQEDSTRbaIzBgmlUrJotWJuXiWb1uR7Sg6jpwJiAkj1xrmCz-2FdEUGwVQianLN8REjX9vG-2Fnq0LDW8rmcSG-2BwGVpGANJ0u3DV4c1uZTOLxurng76JzxwcBfIYXhPubJOJiKA-2BpVcmyhWbkVort64NR6yR5Y-2B8JOQ-3D-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
_______________________________________________<span class=""><br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></span></div></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=P-2BsYbBZHRBuLDBJaL4DIKDNfkkjpROowTyRAObV11qwmk8XxeZ-2FbKmNh-2BuB031-2Fmj8KdbZBHf-2F-2FkH4rzEtOk29ufqufodEp-2Bql5wAHJZUpQERyRW-2F7FU97XTF-2FPG0WQswylNbPIOv1gWHx7wELHeatGhen8p-2F2ZCmrgspPYMnho-2F7Fyla0Pkw-2Bc8jzHMuasC6NemqTS2a8UPPi0CsE7iXbOEl2SgQfu0i-2FfvR4AiJ14-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</div>
<br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>