quill icon indicating copy to clipboard operation
quill copied to clipboard

discrepancy in unicode character lengths in quill

Open khaled4vokalz opened this issue 4 years ago • 2 comments

discrepancy in unicode character lengths in quill

Steps for Reproduction

  1. check https://codepen.io/khaled4vokalz/pen/YzqWjgv?editors=0011
  2. even though "ő".length === 2 quill considers it as length 1 when we do quill.getLength() but for an emoji e.g. "😀".length === 2 quill considers it as length of 2 when we do quill.getLength()
  3. even though quill.getLength() returns 1 for , if I try to create a delta with and check delta.length() that returns 2. This is quite confusing.

Expected behavior:

  • as JS returns same length for both the characters quill should do the same

Actual behavior:

  • quill.getLength() returns 2 for and quill.getLength() returns 3 for 😀. quill should have a consistent behavior regarding the length that it calculates

Platforms:

Chromium: 81.0.4044.138, Ubuntu 20.04

Version:

1.3.6

khaled4vokalz avatar Aug 18 '20 10:08 khaled4vokalz

@jhchen can you please review this issue early?

khaled4vokalz avatar Aug 18 '20 10:08 khaled4vokalz

Related https://github.com/quilljs/quill/issues/1230

benbro avatar Feb 03 '24 15:02 benbro

Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide :pray:

quill-bot avatar Apr 17 '24 11:04 quill-bot