Gets the numbers of bytes needed to represent a specific character expression using a specific encoding.
Ret-value = ByteCount(character-expression , encoding);
Type Returned:
Numeric
Where:
Character-expression
Character type. Is the input string.
Encoding
Character type. Is the encoding to be used.
Ret-value
Numeric type. Is the number of bytes needed to represent the given character expression with the specified encoding.
Objects:
Procedure, Transaction,
Web Panel,
Work Panel
Generators: .NET,
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