Platforms to show: All Mac Windows Linux Cross-Platform

NewCFBinaryDataMBSStr(s as string) as CFBinaryDataMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a CFBinary object for the given string.
Example
dim t as TextOutputStream
dim f as FolderItem
dim o as CFObjectMBS
dim s as string
dim i as TextInputStream

f=SpecialFolder.Desktop.Child("test")
o=NewCFStringMBS("Hello")

// write

s=o.XML.str
s=ConvertEncoding(s,Encodings.UTF8)

t=f.CreateTextFile
t.Write s
t.Close

// clear

o=nil

// now read back

i=f.OpenAsTextFile
s=i.ReadAll(Encodings.UTF8)
i.Close

o=NewCFObjectMBSFromXML(NewCFBinaryDataMBSStr(s))

MsgBox CFStringMBS(o).str

Some examples using this global method:

Some FAQ entries about this method:

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...