Gets the numbers of bytes needed to represent a specific character expression using a specific encoding.
Ret-value = ByteCount(character-expression , encoding);
Character type. Is the input string.
Character type. Is the encoding to be used.
Numeric type. Is the number of bytes needed to represent the given character expression with the specified encoding.
Java, Apple (iOS offline support is available since GeneXus15)
Suppose you want to know how many bytes are needed to represent "hello world" using the UTF-8 encoding.
&charVar = 'hello world'
&encoding = 'UTF-8'
&result = byteCount(&charVar,&encoding)
The value of &result will be 11 because in UTF-8 a character is stored in a byte.
Java supported encodings
.NET supported encodings