<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="">In general we want to encourage the use of “common currency” types across the SDK. Introducing new types that are almost the same as existing ones but with a subtle behavior difference has a tendency to cause forking of APIs and introduce what we like to call impedance mismatch. Callers would end up having to convert back and forth for very little reason.<div class=""><br class=""></div><div class="">Like I said, I think we can resolve this with URL itself. We just need some time to figure out the consequences on Darwin. We’re looking into it.</div><div class=""><br class=""></div><div class="">- Tony</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Oct 27, 2016, at 9:09 AM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Another option might be to introduce a separate type, such as "URI", which uses only the new behavior.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Oct 27, 2016 at 9:05 AM Tony Parker <<a href="mailto:anthony.parker@apple.com" class="">anthony.parker@apple.com</a>> wrote:<br class=""></div><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="gmail_msg">For what it’s worth, we had this discussion in a PR already:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><a href="https://github.com/apple/swift-corelibs-foundation/pull/664" class="gmail_msg" target="_blank">https://github.com/apple/swift-corelibs-foundation/pull/664</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><p style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;margin-top:0px!important" class="gmail_msg">The issue here is that the compatibility API in question is NSURL/URL, and we want to maintain compatibility between it and NSURLComponents/URLComponents. Therefore this code chooses to percent encode the <code style="box-sizing:border-box;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.899999618530273px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="gmail_msg">;</code>.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px" class="gmail_msg">If/when we change the behavior of NSURL/URL itself (which we have to do carefully, as many apps out there rely on its nuances), then we can change this one as well. This code is shared on all of our platforms so we can't forget about the consequences for darwin API as well.</p><div style="box-sizing:border-box;margin-top:0px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;margin-bottom:0px!important" class="gmail_msg">I think the best place for this patch right now is in a JIRA, so we can track updating these together in the future.</div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It’s not impossible to change, but we still want to maintain cross-platform behavior so we would need to change it in Darwin as well. And to change it there, we want it to be consistent behavior between NSURL and NSURLComponents. And to change NSURL we have to be careful about the consequences of changing the behavior under all existing apps. We have first hand experience with changes in NSURL causing strange behavior in other apps.</div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Tony</div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Oct 27, 2016, at 2:24 AM, Chris Bailey via swift-server-dev <<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a>> wrote:</div><br class="gmail_msg m_8772675713604602384Apple-interchange-newline"><div class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">Hi Jacob:</font>
<br class="gmail_msg">
<br class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">This should really be posted to swift-corelibs-dev,
which covers the Foundation library which covers URL and URLComponents
- there's more people on that list that are likely to pick this up.</font>
<br class="gmail_msg">
<br class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">Chris<br class="gmail_msg">
</font>
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">From:
</font><font size="1" face="sans-serif" class="gmail_msg">Jacob Bandes-Storch
via swift-server-dev <<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a>></font>
<br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">To:
</font><font size="1" face="sans-serif" class="gmail_msg"><a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a></font>
<br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Date:
</font><font size="1" face="sans-serif" class="gmail_msg">27/10/2016 07:24</font>
<br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Subject:
</font><font size="1" face="sans-serif" class="gmail_msg">Re: [swift-server-dev]
[Bug] Foundation.URL should support semicolon(; ) appearing in URL path</font>
<br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Sent by:
</font><font size="1" face="sans-serif" class="gmail_msg"><a href="mailto:swift-server-dev-bounces@swift.org" class="gmail_msg" target="_blank">swift-server-dev-bounces@swift.org</a></font>
<br class="gmail_msg">
<hr noshade="" class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg"><font size="3" class="gmail_msg">Sorry for fake threading, the original message was sent
before I subscribed to this list.</font>
<br class="gmail_msg">
<br class="gmail_msg"><a href="http://host/book;id=1/page;2/" class="gmail_msg" target="_blank"><font size="3" color="blue" class="gmail_msg"><u class="gmail_msg">http://host/book;id=1/page;2/</u></font></a><font size="3" class="gmail_msg"><br class="gmail_msg">
this URL is a valid URL, but URLComponents will ruin it with %3B</font><font size="3" color="blue" class="gmail_msg"><u class="gmail_msg"><br class="gmail_msg">
</u></font><a href="http://host/book%3Bid=1/page%3B2/" class="gmail_msg" target="_blank"><font size="3" color="blue" class="gmail_msg"><u class="gmail_msg">http://host/book%3Bid=1/page%3B2/</u></font></a><font size="3" class="gmail_msg"><br class="gmail_msg">
Since Swift Server is coming out, this bug should be solved.</font>
<br class="gmail_msg">
<br class="gmail_msg"><font size="3" class="gmail_msg">Just wanted to point out some related bugs that I have
filed in the past:</font>
<br class="gmail_msg">
<br class="gmail_msg"><font size="3" class="gmail_msg">- </font><a href="https://bugs.swift.org/browse/SR-21" class="gmail_msg" target="_blank"><font size="2" color="blue" class="gmail_msg"><u class="gmail_msg">https://bugs.swift.org/browse/SR-21</u></font></a>
<br class="gmail_msg">
<br class="gmail_msg"><font size="3" class="gmail_msg">- <a class="gmail_msg">rdar://23241861</a></font><font size="2" class="gmail_msg"> "NSFont
fontWithDescriptor:size: fails when passed a URL with a semicolon in it"
(</font><font size="3" class="gmail_msg">marked as dupe of </font><font size="2" class="gmail_msg"><a class="gmail_msg">rdar://22424272</a>)</font>
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg"><font size="3" class="gmail_msg">Jacob</font><tt class="gmail_msg"><font size="2" class="gmail_msg">_______________________________________________<br class="gmail_msg">
swift-server-dev mailing list<br class="gmail_msg">
<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a><br class="gmail_msg">
</font></tt><a href="https://lists.swift.org/mailman/listinfo/swift-server-dev" class="gmail_msg" target="_blank"><tt class="gmail_msg"><font size="2" class="gmail_msg">https://lists.swift.org/mailman/listinfo/swift-server-dev</font></tt></a><tt class="gmail_msg"><font size="2" class="gmail_msg"><br class="gmail_msg">
</font></tt>
<br class="gmail_msg">
<br class="gmail_msg">_______________________________________________<br class="gmail_msg">swift-server-dev mailing list<br class="gmail_msg"><a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-server-dev" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-server-dev</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></div></div></blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>