numToChar

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the numToChar of <ASCIIValue>
numToChar(<ASCIIValue>)
Summary

Returns the character corresponding to an ASCIIvalue.

Introduced1.0
Changes

The ability to handle Unicode characters was introduced in version 2.0. In previous versions, it was not possible for the numToChar function to return a Unicode character.

Deprecated7.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
ASCIIValue

an integer between zero and 255, or an expression that evaluates to such an integer. If the useUnicode property is set to true, the ASCIIValue is an integer between zero and 65535.

Example
numToChar(65)
numToChar(0)
Values
NameTypeDescription
return

The numToChar function returns a single character.

RelatedKeyword: inverse, character
Operator: mod
Property: extendKey, charSet, HTMLText, useUnicode
Function: uniEncode, nativeCharToNum, binaryEncode, numToCodepoint, macToISO, byteToNum, numToByte, binaryDecode, charToNum, numToNativeChar, toUpper, base64Encode, ISOToMac, toLower, codepointToNum
Glossary: property, ASCII, return, Windows, character set, ISO 8859, Unix, Mac OS, Unicode
Control Structure: function
Description

Use the numToChar function to translate numbers into their character equivalents, or to interpret a character (such as a control character) that can't be displayed.

Important: As of version 7.0 the numToChar and charToNum functions have been deprecated. They will continue to work as in previous versions but should not be used with Unicode text as unexpected results may occur. If working with Unicode text use the numToCodepoint and codepointToNum functions, for native text use numToNativeChar and nativeCharToNum functions. If working with binary data use the numToByte and byteToNum functions.

The numToChar function is the inverse of the charToNum function.

If the ASCIIValue is between 127 and 255, the character returned by the numToChar function depends on the character set currently in use. On Mac OS systems this is usually the Macintosh character set; on Unix systems, this is usually ISO 8859; on Windows systems, this is usually Code Page 1252, a variant of ISO 8859.

If the useUnicode property is set to true, the numToChar function returns a double-byte character. If the useUnicode is false and you specify an ASCIIValue greater than 255, the numToChar function returns the character corresponding to the ASCIIValue mod 256.

Tagstext processing