I want to add client side validation for counting characters. That field limit is 300 in database. At server side validation, I get proper string length but while saving form as draft, server side validation is bypassed.
So i get exception. Can anyone help to check character length for Latin characters like
£, §, £, Ä
For Example:
String s= "wa£erw£";
System.out.println("SiZE "+s.length());
System.out.println("UTF - SiZE "+s.getBytes(java.nio.charset.StandardCharsets.UTF_8).length );
Output:
SiZE 7
UTF - SiZE 9
I need Count 9 using JavaScript