You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountered an error when attempting to pad a string based on the number of visual characters. Currently, we rely on String#length to determine the number of characters to pad; however, this returns the number of code points, which may not be same as the number of graphemes.
We should consider how to properly handle Unicode characters comprised of multiple code points.
Related Issues
Does this issue have any related issues?
No.
Questions
Any questions for reviewers?
No.
Other
Any other information relevant to this issue? This may include screenshots, references, stack traces, sample output, and/or implementation notes.
What steps are required to reproduce the unexpected output?
In order to reproduce this bug, do the following:
attempt to pad using an input string containing surrogate pairs or by providing a string with which to pad containing surrogate pairs.
Expected Results
What are the expected results?
I might expect that I would see padding based on the number of visual characters. Currently, the implementation runs the risk of unpaired surrogates.
Actual Results
What are the actual results?
N/A
Environments
What environments are affected (e.g., Node v0.4.x, Chrome, IE 11)? If Node.js, include the npm version, operating system, and any other potentially relevant platform information.
The following environments are affected:
all
The text was updated successfully, but these errors were encountered:
Checklist
Description
Encountered an error when attempting to pad a string based on the number of visual characters. Currently, we rely on
String#length
to determine the number of characters to pad; however, this returns the number of code points, which may not be same as the number of graphemes.We should consider how to properly handle Unicode characters comprised of multiple code points.
Related Issues
No.
Questions
No.
Other
This affects the following packages:
@stdlib/string/left-pad
@stdlib/string/right-pad
@stdlib/string/pad
Demo
N/A
Reproduction
In order to reproduce this bug, do the following:
Expected Results
I might expect that I would see padding based on the number of visual characters. Currently, the implementation runs the risk of unpaired surrogates.
Actual Results
N/A
Environments
The following environments are affected:
The text was updated successfully, but these errors were encountered: