I know there is String#length and the various methods in Character which more or less work on code units/code points.
What is the suggested
It depends on exactly what you mean by "length of [the] String":
String. This is normally only useful for programming related tasks that require looking at a String as a series of Unicode code points without needing to worry about multi-byte encoding interfering.String for the given Locale. Using this multiple times can allow you to count the number of graphemes in a String. Since graphemes are basically letters (in most circumstances) this method is useful for getting the number of writable characters the String contains. Essentially this method returns approximately the same number you would get if you manually counted the number of letters in the String, making it useful for things like sizing user interfaces and splitting Strings without corrupting the data.To give you an idea of how each of the different methods can return different lengths for the exact same data, I created this class to quickly generate the lengths of the Unicode text contained within this page, which is designed to offer a comprehensive test of many different languages with non-English characters. Here is the results of executing that code after normalizing the input file in three different ways (no normalizing, NFC, NFD):
Input UTF-8 String
>> String.length() = 3431
>> String.codePointCount(int,int) = 3431
>> BreakIterator.getCharacterInstance(Locale) = 3386
NFC Normalized UTF-8 String
>> String.length() = 3431
>> String.codePointCount(int,int) = 3431
>> BreakIterator.getCharacterInstance(Locale) = 3386
NFD Normalized UTF-8 String
>> String.length() = 3554
>> String.codePointCount(int,int) = 3554
>> BreakIterator.getCharacterInstance(Locale) = 3386
As you can see, even the "same-looking" String could give different results for the length if you use either String.length() or String.codePointCount(int,int).
For more information on this topic and other similar topics you should read this blog post that covers a variety of basics on using Java to properly handle Unicode.