Platforms to show: All Mac Windows Linux Cross-Platform

Back to StringHandleMBS class.

StringHandleMBS.IsValidASCII(data as ptr, TotalByteLength as integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method String MBS DataTypes Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks whether given data is valid ASCII text.

StringHandleMBS.IsValidUTF8(data as ptr, TotalByteLength as integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method String MBS DataTypes Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks whether given data is valid UTF-8 text.

StringHandleMBS.UTF8Length(data as ptr, TotalByteLength as integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method String MBS DataTypes Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries how many UTF-8 characters are in one memory area.
Example
Dim s As String = "Hello äöü"
Dim m As MemoryBlock = s

Dim c As Integer = StringHandleMBS.UTF8Length(m, m.size)

MsgBox str(c)+" characters, "+str(m.size)+" bytes"

Please make sure ptr is a valid ptr.
This is the internal function we use ourselves for the UTF-8 related functions.

StringHandleMBS.UTF8LengthToBytes(data as ptr, TotalByteLength as integer, Characters as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method String MBS DataTypes Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries how many bytes are needed for UTF-8 characters.
Example
Dim s As String = "Hello äöü"
Dim m As MemoryBlock = s

Dim c As Integer = StringHandleMBS.UTF8Length(m, m.size)
Dim b As Integer = StringHandleMBS.UTF8LengthToBytes(m, m.size, c)

MsgBox Str(c)+" characters, "+Str(b)+" bytes"

Please make sure ptr is a valid ptr.
This is the internal function we use ourselves for the UTF-8 related functions.

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


The biggest plugin in space...