Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algorithm to remove last string character is not Unicode aware #297

Open
2 tasks done
kgryte opened this issue May 14, 2020 · 0 comments
Open
2 tasks done

Algorithm to remove last string character is not Unicode aware #297

kgryte opened this issue May 14, 2020 · 0 comments
Labels
Bug Something isn't working. Help Wanted Extra attention is needed.

Comments

@kgryte
Copy link
Member

kgryte commented May 14, 2020

Checklist

Please ensure the following tasks are completed before filing a bug report.

  • Read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.

Description

Description of the issue.

Encountered an error when attempting to remove the last character of a string. Issues arise when using @stdlib/string/remove-last because a visual character can be comprised of multiple code points.

We should evaluate whether to make the implementation Unicode aware.

Related Issues

Does this issue have any related issues?

None.

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.

N/A

Demo

If relevant, provide a link to a live demo.

N/A

Reproduction

What steps are required to reproduce the unexpected output?

In order to reproduce this bug, do the following:

  • attempt to remove the last character when comprised of two Unicode code points.

Expected Results

What are the expected results?

The visual character to be removed, not just a single code point.

Actual Results

What are the actual results?

The last code point is removed, not the full character.

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
@kgryte kgryte added Bug Something isn't working. Help Wanted Extra attention is needed. labels May 14, 2020
ShraddheyaS added a commit to ShraddheyaS/stdlib that referenced this issue Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working. Help Wanted Extra attention is needed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant