Version 6 of character

Updated 2019-08-11 15:35:13 by pooryorick

A character is an abstract symbol in a text. An ordered collection (i.e. a list) of characters is a string.

See Also

Characters, glyphs, code-points, and byte-sequences
The finer points of the terminology.

Hexadecimal to Character

Here is a routine to convert a hexadecimal number to the corresponding Unicode character

proc hex2char hex {
    if {![string is xdigit -strict $hex]} {
        error [list {input is not a hexidecimal string}]
    }
    if {[string length $hex] > 8} {
        error [list {hexadecimal string is too long}]
    }
    expr "\"\\U$hex\""
}