Name
ByteLen -- return string length in bytes (V7.0)
Synopsis
len = ByteLen(s$)
Function
This function returns the length of string s$ in bytes. If you need to know the string length in characters, use StrLen() instead. See StrLen for details.

In the UTF-8 character encoding a single character may need a storage space of up to 4 bytes. In the ISO 8859-1 character encoding there is no difference between byte and character sizes.

Inputs
s$
input string
Results
len
length of input string in bytes
Example
len = ByteLen("äöü")
Print(len)
If Hollywood is in Unicode mode, this will return 6 because each of the characters needs two bytes in the UTF-8 character encoding. In ISO 8859-1 mode, there is no difference between characters and bytes which means the code above will return 3.

Show TOC