String utf8 size in kilobytes


#1

I have a mimemessage in a string.
This string is utf8, i would like to know the size of this string.
String.size gives me the length in characters, but i need the size in kb
or bytes


#2

daniel wijnands wrote:

I have a mimemessage in a string.
This string is utf8, i would like to know the size of this string.
String.size gives me the length in characters, but i need the size in kb
or bytes

String#size returns the size in bytes. String#jsize returns the number
of characters (with require ‘jcode’).


#3

Thanks, then my method is valid, i want to know the bytes, so that’s
fine :slight_smile:

Andreas S. wrote:

daniel wijnands wrote:

I have a mimemessage in a string.
This string is utf8, i would like to know the size of this string.
String.size gives me the length in characters, but i need the size in kb
or bytes

String#size returns the size in bytes. String#jsize returns the number
of characters (with require ‘jcode’).