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

Implement wcwidth() for calculating string column widths #75

Open
Spakman opened this issue Sep 14, 2012 · 3 comments
Open

Implement wcwidth() for calculating string column widths #75

Spakman opened this issue Sep 14, 2012 · 3 comments
Assignees
Milestone

Comments

@Spakman
Copy link
Collaborator

Spakman commented Sep 14, 2012

As noted by @shirosaki (#57 (comment)), there is a Ruby port[1] of wcwidth()[2]. This should be a better way for us to calculate character widths.

1 - https://github.com/shurizzle/ruby-wcwidth/blob/master/lib/wcwidth.rb#L96-L110
2 - http://www.kernel.org/doc/man-pages/online/pages/man3/wcwidth.3.html

@phasis68
Copy link
Contributor

phasis68 commented Jan 3, 2014

I have implemented another ruby version of wcwidth.

https://github.com/phasis68/rb-wcwidth/blob/master/lib/wcwidth.rb

@luislavena
Copy link
Collaborator

Thank you @phasis68.

Under which license is that code? If is bsd compatible, then I will push it as a module of rbreadline instead of modifying string class.

@phasis68
Copy link
Contributor

phasis68 commented Jan 3, 2014

The original C code is under 2-clause BSD-like license.
So my code might be under the same license.
But I don't want to claim my license, use it as you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants