I never left, I just went silent. But since I'm "back", I'm curious to know what the engine-types think of Bernd's solution for fixing the UTF-32 offsets code. It seems that when converting both the stringToFind and stringToSearch to UTF-32 and then searching the binary with byteOffset, you won't find "Reykjavík" in "Reykjavík er höfuðborg"
But if you first append "せ" to each string, then do the textEncode, then strip the last 4 bytes, the match will work. That seems like strange voodoo to me. On Tue, Nov 13, 2018 at 12:54 PM Ben Rubinstein via use-livecode < use-livecode@lists.runrev.com> wrote: > For the avoidance of doubt, all my outrage is faux outrage. > Public life on both sides of the Atlantic (and around the world) has > completely exhausted capacity for real outrage. > > Come back Geoff! > > Ben > > On 13/11/2018 17:29, Mark Waddingham via use-livecode wrote: > > On 2018-11-13 18:21, Geoff Canyon via use-livecode wrote: > >> Nothing I said in this thread has anything to do with optimizing the > >> allOffsets routines; I only used examples from that discussion because > they > >> illustrate my puzzlement on the exact topic you (in general) raised: how > >> data types are handled by the engine. I'd generalize the responses, to > say > >> that it seems how the engine stores data and how it presents that data > are > >> not identical in all cases. > > > > The best way to think about it is that the engine stores data pretty > much in > > the form it is presented with it; however, what script sees of data is > in the > > form it requests. In particular, if data has been through some > operation, or > > mutated, then there is a good change it won't be in the same form it was > before. > > > > e.g. put tVar + 1 into tVar > > > > Here tVar could start off as a string, but would end up as a number by > virtue > > of the fact you've performed an arithmetic operation on it. > > > >> The above notwithstanding: sorry I outraged you; I'll exit this thread. > > > > Obviously I'm not Ben, but I *think* it was 'faux outrage' (well I hope > it was > > - hence my jocular comment about herding cats!) - so I don't think > there's a > > reason to exit... > > > > Warmest Regards, > > > > Mark. > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode