I am facing the issue on the case comment size. There is an inbound email handler which creates a case comment on a specific case record based on the incoming email body.
Sometimes its giving error - "STRING_TOO_LONG, Body: data value too large". Then i checked the limit for case comment body and its 4000 bytes and not characters.
Now the problem is how do i check for size of a string as bytes and not as characters in apex? I found that string .size() method returns number of characters and not no of bytes.
Please help.
Thanks