Got a strange bug with High Sierra/Xojo 2017r1. In my app you can select a mail client and the get/set data for said mail client. In the preferences I save a dictionary where the keys are the mail clients like Mail, Outlook etc.
if EmailClientDictionary.HasKey(MailApplication) then <---- fail here
'get the data for the mail client
end if[/code]
The check with HasKey is failing. I’ve had one customer send me his plist file and the dictionary is there and it has the correct value.
So to my question: I can get the keys with
dim MailClients(-1) as Variant = EmailClientDictionary.Keys
and then convert to string. But can I get the raw data for the dictionary keys? With values like Mail and Outlook it’s unlikely that the problem is an encoding problem. But I’d rather be sure.
HasKey fails even if the dictionary has the key. No crash or runtime exception. One customer has this for “Mail” and one for “Outlook”. The only time I have seen something like this was with precomposed and decomposed UTF8 strings. But here???
I know about the dangers of variant. Thanks the gods you can’t see the abominations I have to do with VBA. The problem with the new framework for me is that this thing is convoluted as heck.
I’m getting the preferences with the MBS plugin. Ancient ancient code but still working well. The version of my app isn’t exactly new but so far the code only fails for High Sierra.
For currentValue = 0 to dict.Count - 1
CFKey = dict.List.Key(currentValue)
//Determine the type of key
Select case CFKey.TypeDescription
Case “CFBoolean”
Key = CFBooleanMBS(CFKey).Value
Case “CFNumber”
Key = CFNumberMBS(CFKey).integerValue
Else //Use the string value
Key = CFStringMBS(CFKey).Str
End Select
I wasn’t able to reproduce the issue. I didn’t see anything after having a look at the binary data. That’s why I asked how I can get the binary data from the user. Even the plist file from the user didn’t show anything.