The unicode string in question:
ਪਹਿਲਾਂ ਲੋਕਾਂ ਦੇ ਦਿਲਾਂ ਦਿਮਾਗ਼ਾਂ ਚੋਂ ਇਹ ਵਹਿਮ ਕੱਢੋ ਕਿ
ਅਸੀਂ ਹਿੰਦੂ ਹਾਂ,
ਅਸੀਂ ਸਿੱਖ ਹਾਂ,
ਅਸੀਂ ਮੁਸਲਮਾਨ ਹਾਂ,
ਅਸਲੀਅਤ ਇਹ ਹੈ ਕਿ
ਅਸੀਂ ਭੁੱਖੇ ਹਾਂ,
ਅਸੀਂ ਬੇਰੁਜ਼ਗਾਰ ਹਾਂ,
ਅਸੀਂ ਨਸ਼ੇੜੀ ਹਾਂ,
ਅਸੀਂ ਲਾਚਾਰ ਹਾਂ,
ਅਸੀਂ ਬੇਵਕੂਫ਼ ਹਾਂ,
ਅਸੀਂ ਬੀਮਾਰ ਹਾਂ,
Language: Punjabi
Format: Unicode
Problem:
Javascript reports its str.length() =
226; whereas WhatsApp says 700 Characters
.
Javascript Code:
console.log(inputStr.length);
Whatsapp Screenshot 01:
Fine, no error: (count at 698 or 699)
Just adding a new line from mobile keyboard makes it over 700
- Why there is a big mismatch in string length?
- Which number is real?
- How can I get the similar result in Javascript same as of Whatsapp result?