Platforms to show: All Mac Windows Linux Cross-Platform

SetEncodingOfStringMBS(s as string, encoding as UInt32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method XojoRuntime MBS Util Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the internal value for the encoding of this string.
Example
dim s as string = "äöü"
dim t as string = ConvertEncoding(s, encodings.UTF16)
dim m as MemoryBlock = t // memoryblock has bytes from UTF16 string without knowning the encoding
dim u as string = m // convert back to a string without encoding

MsgBox u // shows wrong characters
SetEncodingOfStringMBS u, 256 // set to UTF-16
MsgBox u

Only useful on Xojo 4.5 and newer.
Some example values for encoding:
MacRoman 0Also for ASCII or binary data used.
WindowsLatin1&h0500ANSI codepage 1252
ISOLatin1&h0201ISO 8859-1
NextStepLatin&h0B01NextStep encoding
Unicode &h010016 bit Unicode
UTF8&h080001008 bit Unicode
Invalid&hFFFFFFFF(Binary)
Invalid&hFFFF(Binary)

Renamed from SetStringEncoding to SetEncodingOfString in MBS Plugin 3.1.

Some examples using this global method:

Xojo Developer Magazine

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


The biggest plugin in space...