CharToNum Depricated??

Bob Sneidar bobsneidar at iotecdigital.com
Mon Sep 16 12:26:22 EDT 2024


I think you nailed it Bernd. That scans with all that I am seeing in troubleshooting. 

Bob S


> On Sep 15, 2024, at 11:50 AM, Niggemann, Bernd via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi Bob,
> 
> charToNum has been deprecated, I think since LC 7.0
> 
> It is replaced by nativeCharToNum() and byteToNum
> 
> (As of LC 10.0.0 charToNum maps to nativeCharToNum, see release notes)
> 
> This covers the ASCII range.
> 
> For unicode you use codepointToNum()
> 
> I suspect that the small difference you see in file size is a Byte Order Mark, BOM at the beginning of the Konica Minolta address book.
> 
> You could try to use "open file" to import the Konica Minolta address book.
> 
> open file tFilePath for read
> read from file tFilePath until EOF
> put it into tData
> close file tFilePath
> 
> The dictionary states
> 
> From 7.0, it's possible to specify an encoding for the file being
> opened. By doing so, you can straight read or write to a file without
> having to call textEncode or textDecode; the encoding supported by
> open file are the same as these text encoding functions. If no encoding
> is provided, then open file tries to read a Byte Order Mark (BOM) exists
> at the beginning of the file. In success, the encoding is adapted and the
> BOM is ignored.
> 
> 
> If my assumption that there is a BOM is correct then after opening and reading from the file should give you the same length of the data since the BOM is not part of the data.
> I guess that is also the reason why SublimeText sees both files as identical. It probably also ignores the BOM.
> 
> I am just guessing and I am not an expert for these matters but maybe this gives you an idea to try.
> 
> Kind regard
> Bernd
> 
> 
> Bob wrote
> 
> Also, if charToNum is deprecated, what do I use to compare t he ascii values of
> two characters??
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list