Giter VIP home page Giter VIP logo

wcwidth's People

Contributors

alexrp avatar bekir-ozturk avatar patriksvensson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wcwidth's Issues

python wcwidth improvements you may want ..

Hello,

I made several improvements to the accuracy of the python wcwidth library that this library might benefit from. I also wrote a specification, which might help with how you parse the unicode data files. I also wrote an automatic terminal assessment tool.

Most especially you will want to follow the improvements made in release 0.2.9 and 0.2.10 to the zero-width tables and support for Variation Selector-16 with a new VS-16 table.

I wrote an article about it all here, https://www.jeffquast.com/post/ucs-detect-test-results/

The API needs to operate in terms of Unicode code points or scalars, not code units

Hi,

As far as I can tell, the internals of this library all use uint which is what one would expect since the tables contain code point values. However, the public UnicodeCalculator API only speaks char. This is a bit of a problem since a .NET char is a UTF-16 code unit, not a Unicode code point / scalar. Many code points that are contained in the tables here can't actually be looked up, severely limiting the usefulness (and correctness) of the library. (This is also out of line with other language ports of this library, including the Python one linked in the README.)

.NET Core 3.0 introduced the System.Text.Rune type (along with str.EnumerateRunes()) which would probably be ideal for the API to work with since an instance of Rune is guaranteed to be a valid Unicode scalar (i.e. a valid Unicode code point that isn't a surrogate). But since taking a dependency on that type is probably undesirable for this library due to targeting .NET Standard 2.0, simply accepting uint would work too.

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.