<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>On Mon, Jan 4, 2016, at 03:08 PM, Paul Cantrell wrote:<br></div>
<blockquote type="cite"><div><blockquote type="cite"><blockquote type="cite"><div><div>But doing lazy checking of strings would end up having to check <i>every</i> string that comes from ObjC<br></div>
</div>
</blockquote></blockquote></div>
<div> </div>
<div>I don’t think that’s necessarily true. There’s a limited set of places where invalid Unicode can creep into an NSString, and so the lazy check could probably bypass quite a few common cases — an ASCII string for example. Without digging into it, I suspect any NSString created from UTF-8 data can be safely bridged, since unpaired surrogate chars can’t make it through UTF-8.<br></div>
</blockquote><div> </div>
<div>Every single method you implement that takes a `String` property and is either exposed to Obj-C or is overriding an Obj-C declaration will have to check the String parameter every single time the function is called.<br></div>
<div> </div>
<div>Every time you call an Obj-C method that returns a String, you'll have to check that String result.<br></div>
<div> </div>
<div>Basically, any time a String object is backed by an NSString, which is going to be very common in most apps, that backing NSString will have to be checked.<br></div>
<div> </div>
<div>-Kevin Ballard</div>
<div> </div>
</body>
</html>