Incorrect character count
See original GitHub issueCount Characters
script returns incorrect character count:
This originates from: https://github.com/IvanMathy/Boop/blob/5794294ef9a7f4e35e65c5008b47c1ec3733efd3/Boop/Boop/scripts/CountCharacters.js#L14
The implementation does not account for Unicode quirks which are described in detail here: https://mathiasbynens.be/notes/javascript-unicode#counting-symbols
Corrected implementation using string-length
:
https://runkit.com/embed/0q9svv0m85db
/cc @borna223 😉
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why is my character count incorrect? - Stack Overflow
It says I have 6 words , when according to MS Word I'd have 4 . spaced-out and in. Gives me a word...
Read more >How Does Character Count in Word Working? - NordicTrans
It's very uncommon that you the character count, but it's as easy as tracking word count, via ribbon's Review tab. Word automatically calculates...
Read more >Character count incorrect when pasting data | Blazor Forums
We have considered the issue “Character count shows incorrect value when pasting content” as a bug from our end and the fix for...
Read more >Character Count wrong · Issue #3849 · notepad-plus ... - GitHub
The character count in the summary reads it is counted without space, while in fact it also does count the spaces.
Read more >Incorrect textarea character count on form validation in IE11
Hello, I have a textarea with a maxlength attribute within a form. I type text into that textarea until the max length is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey there! Sorry about the very delayed response.
Digging more into the code you pasted it turns out it was taken from lodash, which is something that’s built in to Boop. I’m opening a PR right now to fix the issue, thank you so much for the help!
Hey there! Thanks for the report, looks like a bug indeed…
Feel free to put in a PR with a proposed solution, otherwise I’ll tackle it in 1.3.0.