Hi, I'm trying to find the number of chars (letters) in a word that is in UTF-8 format - not the number of bytes. String.length() returns the length in UTF-16 format. For most words the simple String.length() works, but for example: String s = "文書の場合"; The length (s.length()) is 9.
I using the String constructer String(byte[]�bytes, String�charsetName), but the length method is still UTF-16.
Thanks
Michael Lloyd Lee
Greenhorn
Joined: Sep 07, 2005
Posts: 22
posted
0
Can you post the string as unicode escapes? (i.e. \uxxxx)