<div dir="ltr">Hi David,<div><br></div><div>had a read through the CSR.</div><div><br></div><div>---</div><div><br></div><div>`<span style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px">In addition we tweak the wording of</span><span class="gmail-Apple-converted-space" style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px"> </span><code class="gmail-prettyprint" style="color:rgb(23,43,77);font-size:14px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace">GetStringUTFChars</code><span class="gmail-Apple-converted-space" style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px"> </span><span style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px">so that it:</span></div>...<br class="gmail-Apple-interchange-newline" style="color:rgb(0,0,0)"><span style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px">b) references the new</span><span class="gmail-Apple-converted-space" style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px"> </span><code class="gmail-prettyprint" style="color:rgb(23,43,77);font-size:14px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace">GetStringUTFLengthAsLong</code><span class="gmail-Apple-converted-space" style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px"> </span><span style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px">function instead of the Deprecated</span><span class="gmail-Apple-converted-space" style="color:rgb(23,43,77);font-family:"DejaVu Sans",sans-serif;font-size:14px"> </span><code class="gmail-prettyprint" style="color:rgb(23,43,77);font-size:14px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace">GetStringUTFLength`</code><br><div><code class="gmail-prettyprint" style="color:rgb(23,43,77);font-size:14px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace"><br></code></div><div><code class="gmail-prettyprint" style="color:rgb(23,43,77);font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace"><div style="font-size:14px;color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">(b) refers to <span style="font-size:small">GetStringUTFRegion, or? GetStringUTFChars has no such wording, nor a len argument</span></div><div style="font-size:14px;color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif"><span style="font-size:small"><br></span></div><div style="font-size:14px;color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif"><span style="font-size:small">---</span></div><div style="font-size:14px;color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif"><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">I was initially surprised that we return a fake length from GetStringUTFLength upon overflow instead of a clear error indicator like -1. Now folks will work with potentially truncated strings. Typically those are documents stored in string form, and truncation errors are not obvious. But probably there is no better way:</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif"><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">Returning 0 would be an option - it would cause clearer and more immediate data errors (missing document contents). But it can be confused with "have no data" which can be a valid state.</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">Returning -1 is potentially dangerous and can lead to overflows.</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">Returning MAX_INT is not much better than returning up to the last valid encoding, we just get a weird character at the end of the document.</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif"><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">Cheers, Thomas</div></code></div><br class="gmail-Apple-interchange-newline"><br></div>