Text.ToCString
From Xojo Documentation
Method
Text.ToCString(encoding As Xojo.Core.TextEncoding) As CString
Supported for all project types and targets.
Supported for all project types and targets.
Creates a CString from a Text with a specific encoding. The CString is immutable and is its own entity with the lifetime not tied to the source text value. This is provided to make dealing with declares easier.
Notes
In general, CString is for use with Declare commands and MemoryBlocks.
Exceptions
- NilObjectException if encoding is Nil.
- UnsupportedFormatException if the text is cannot be represented in the given encoding. For example, Emoji is not representable in the ASCII encoding.
Sample Code
Convert text to CString: