nativeCharToNum

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the nativeCharToNum of <nativeCharacter>
nativeCharToNum(<nativeCharacter>)
Summary

Returns the 8-bit value corresponding to a native character.

Introduced7.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
nativeCharacter

A single native character.

Example
put nativeCharToNum("A")
get nativeCharToNum(space)
Values
NameTypeDescription
return

The nativeCharToNum function returns an integer between 0 and 255.

RelatedFunction: numToChar, charToNum, numToNativeChar, numToCodepoint, codepointToNum
Description

Use the nativeCharToNum function to translate native characters to their 8-bit numerical value.

The nativeCharToNum function is the inverse of the numToNativeChar function.

These functions convert between text and native characters and are replacements for the deprecated numToChar and charToNum functions.

As the native character sets for each platform have a limited and different repertoire, these functions should not be used when preservation of Unicode text is desired. Any characters that cannot be mapped to the native character set are replaced with a question mark character (?).

Unless needed for compatibility reasons, it is recommended that you use the numToCodepoint and codepointToNum functions instead.