TextEncoding.Chr

From Real Software Documentation

Jump to: navigation, search
Method
TextEncoding.Chr ( CodePoint as Integer ) As String

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

Notes

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


On Mac OS X

You can activate the option Keyboard & Character Viewer in the Input Sources tab of the Language & Text pane of the System Preferences application. This will allow you to display the Character Viewer window which provides a list of all the Unicode characters, depicts the characters for the fonts which have the selected code point.

alt The Character Viewer window in Snow Leopard


If you keep the mouse on top of a character, a tooltip will give you the Unicode code point that you should use with Chr. Alternatively, you can directly insert this character in the IDE. In the above window, the NEPTUNE (♆) character has code point 2646 (in hexadecimal).

dim s as string //Real Studio uses the UTF8 encoding 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.

Personal tools