How to get the size of a string in bytes
819549Apr 21 2011 — edited Apr 21 2011Morning,
I’m trying to get the length in bytes of a string, the characters below are 3 byte UTF-8, but when I display
The length of either int, looks like is double I got 120 and I think it should be 60. Any idea
String requiredMsg = "όόόόόόόόόόόόόόόόόόόό";
int byteCountUTF8 = requiredMsg.getBytes("UTF-8").length;
int byteCountUTF8 = requiredMsg.getBytes().length;
thanks