Unicode string length
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jyri_Saastamoinen
Posted On:   Tuesday, November 23, 2004 06:03 AM

Hi.

How can I check how many chars or bytes unicode string, for example some chinese text is long?

Re: Unicode string length

Posted By:   David_Thornton  
Posted On:   Tuesday, November 23, 2004 05:24 PM

You probably want to check for the number of bytes not characters as Chinese is a DBCS.


public int getLengthInBytes(String str) {
byte[] numOfbytes = str.getBytes();
return numOfbytes.length;
}
About | Sitemap | Contact