I am trying hard to get the count of unicode string and tried various options. Looks like a small problem but struck in a big way.
Here I am trying to get the length
This is the new way to calculate the length of a Java String taking into account the Unicode characters.
int unicodeLength = str.codePointCount(0, str.length);