DecodeHex

From Xojo Documentation
Jump to: navigation, search
Method

Decodes the passed String into hex. Invalid hex values will be discarded.


Syntax

result=DecodeHex (s)

Part Type Description
result String The passed string decoded into a hex string.
s String The string to be decoded into hex.


Notes

Hexadecimal encoded strings are byte-based instead of character-based, i.e. they ignore text encodings. For example, the string "Xojo™" is 12 characters long but, as it uses UTF-8 as encoding, it is 14 bytes long (the ™ character uses 3 bytes in UTF-8). You should keep that in mind when using EncodeHex and DecodeHex.

Only a hexadecimal string made from a UTF-8 string will be transformed back properly by DecodeHex.


Examples

The following converts a hex string back into a letter.

Dim s as String
s = DecodeHex("61") //returns "a"

See Also

EncodeHex, Hex function.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About