From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

TextEncoding.Chr(CodePoint as Integer) As String

Supported for all project types and targets.

Returns the character in the given encoding specified by the Unicode CodePoint.


The "code point" of the character is the same as the value that Asc returns. In general, it is safest to use this rather than the Chr function unless you are dealing with ASCII codes only (0-127).

macOS Info

You can activate the Character viewer window by selecting Emoji & Symbols" from the Edit menu of most apps. This allows you to search for characters and get code point information. For example, search for "neptune" to find a neptune character and then right-click to copy the Character Info show here:

 Unicode: U+2646, UTF-8: E2 99 86

You can use the above number as the hexadecimal code point like this:

Var s As String // UTF8 encoding is used by default
s = Encodings.UTF8.Chr(&h2646) // Converts the Unicode character NEPTUNE into its UTF8 counterpart

See Also

For more information about Unicode and the code points, see this article on Wikipedia.