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

Fix the truncation of unicode strings #108

Merged
merged 1 commit into from
Feb 20, 2017

Conversation

davidchin
Copy link
Contributor

What?

  • Added a handlebars helper to truncate a string #106 added a truncation helper. It uses String.prototype.substring to truncate strings. However, the native function doesn't handle unicode characters properly. So, if you call the truncate helper on strings containing unicode characters (some non-English characters or emoji), you won't get what you expect.
  • To save time, I decided to use a third party library called stringz. It has MIT license, so we should be good to use.

Why?

  • This is necessary because we need to support multiple languages in Stencil.

Testing / Proof

  • Unit

@bigcommerce/checkout @bigcommerce/stencil-team

Copy link
Contributor

@mcampa mcampa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 👍

@davidchin davidchin merged commit 3fd5974 into bigcommerce:master Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants