<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 18, 2019, 19:07 Thiago Macieira <<a href="mailto:thiago@macieira.org" target="_blank" rel="noreferrer">thiago@macieira.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Saturday, 17 August 2019 12:25:57 PDT Henri Sivonen wrote:<br>
> To the extent other programming languages that have encoding<br>
> conversion in their standard library, such as Java, focus on<br>
> contiguous buffers rather than iteration, it's worthwhile to study if<br>
> application developers really feel that something important is<br>
> missing.<br>
<br>
We were just discussing URLs in the cpplang Slack and that reminded me: <br>
there's exactly one in 10 years case that I've needed to decode a non-<br>
contiguous byte range and that's when parsing a URL.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Can you elaborate on this? Per spec, URL parsing doesn't invoke a decoder but an encoder:</div><div dir="auto"><a href="https://url.spec.whatwg.org/#query-state">https://url.spec.whatwg.org/#query-state</a><br></div><div dir="auto"><br></div><div dir="auto">Here's the corresponding code in Firefox using the span-oriented API that I linked to in my previous email:</div><div dir="auto"><a href="https://searchfox.org/mozilla-central/source/netwerk/base/nsStandardURL.cpp#138" target="_blank" rel="noreferrer">https://searchfox.org/mozilla-central/source/netwerk/base/nsStandardURL.cpp#138</a><br></div><div dir="auto">The span-oriented API works well here in my opinion, even though this case is a more advanced used of the API that implement a custom replacement behavior.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div></div></div>