Coder Social home page Coder Social logo

string_width's Issues

Are all emoji characters of width 2 ?

Regarding my comment on #2 i thought i make a separate issue for this.

The following code line replaces all emoji characters with two empty spaces which returns a width of 2 as far as i can see. Is this correct behavior, or a naive implementation?

  input = input.replaceAll(emojiRegex(), '  ');

As i mentioned in #2 , the black square only takes up 1 space in the terminal whilst still being replaced in the emojiRegex call.

As I've learned there are lots of things determining the width of a rendered character, like the Terminal, Font, Unicode version etc. Maybe you could elaborate on the scope or correctness of this method / package.

Support various Unicode versions ?

I've noticed that some characters have different widths based on the Unicode version of the terminal. Would it make sense to make this package handle multiple Unicode versions by passing in a Unicode version argument?

"heart hands" emoji 🫶 report 1 in width

I was trying out your project and found that the "heart hands" emoji 🫶 was reported as 1 in width even though it takes up two spaces in my terminal. It's part of Unicode 14.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.