<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-07-29 21:31 GMT+02:00 Tobias Pape <span dir="ltr"><<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 29.07.2017, at 21:15, tim Rowledge <<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>> wrote:<br>
><br>
> We recently changed ByteArray>at:put: to remove the backup conversion of the value to integer, for what seemed like decent reasons.<br>
><br>
> It’s broken my WeatherStation code a little because there are places where I use<br>
> {my byte stream} nextPutAll: (aString squeakToUtf8)<br>
> or similar. #squeakToUtf8 returns a bytestring, and of course when the #nextPutAll: loop does its thing each character is pulled out as a Character (even though we know at this point it’s a byte value) - and we’ve just made it impossible to stick a character into a byte array.<br>
><br>
> Clearly I could fix it reasonably trivially with a few #asByteArray type messages scattered around but it feels a bit tacky somehow. I see some faintly similar code with plausibly similar issues in WebSocket classes too, which would need some care. Not that I can see a lot of usage of that code…<br>
><br>
> Performance isn’t a colossal issue for MQTT packets but it just rankles a bit to have a known byte valued string and then have to convert it to write it into a byte valued stream collection. KnowWhadIMean?<br>
><br>
<br>
</span>Underlying questions:<br>
- does an utf8 encoded string contain unicode-valued characters?<br>
-> is an utf8-encoded string a string after all?<br>
<br>
I'd suggest no out of purity but I'll expect yes from other out of practicality.<br>
<br>
Best regards<br>
<span class="HOEnZb"><font color="#888888">        -Tobias<br>
</font></span><div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Absolutely,<br></div><div>to me a String is a sequence of characters.<br></div><div>squeakToUtf8 is a hack that makes us consider a String as a sequence of codePoints whose encoding is in the eye of the beholder (or implicitly in the Context - the Smalltalk one).<br></div><div>I's not very object oriented and quite fragile.<br></div><div>We started to clean Multilingual but never finished the job...<br><br></div><div>It's difficult to finish it, because we value backward compatibility.<br></div><div>So maybe the ByteArray change was a bit radical with this respect.<br><br></div><div>Nicolas<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
> tim<br>
> --<br>
> tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
> Never write software that anthropomorphizes the machine. They hate that.<br>
><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>