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

Kanji characters get error #1

Closed
melborne opened this issue Jan 5, 2011 · 2 comments
Closed

Kanji characters get error #1

melborne opened this issue Jan 5, 2011 · 2 comments

Comments

@melborne
Copy link

melborne commented Jan 5, 2011

Hi janlelis,
Great work!

Japanese use 3 types of charcters, Hiragana, Katakana, Kanji(Chinese Chars) and it works on Hiragana & Katakana.
But on Kanji, I got errors as follows;
irb(main):024:0> '一'.display_size
ArgumentError: ArgumentError
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/unicode-display_width-0.1.0/lib/unicode/display_width.rb:36:in line' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/unicode-display_width-0.1.0/lib/unicode/display_width.rb:42:incodepoint'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/unicode-display_width-0.1.0/lib/unicode/display_width.rb:65:in block in display_width' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/unicode-display_width-0.1.0/lib/unicode/display_width.rb:64:ineach'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/unicode-display_width-0.1.0/lib/unicode/display_width.rb:64:in inject' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/unicode-display_width-0.1.0/lib/unicode/display_width.rb:64:indisplay_width'
from (irb):24
from /opt/local/bin/irb:12:in `

'

'一' represent 'One' in Kanji.
irb(main):025:0> '一'.unpack('U*')
=> [19968]
irb(main):026:0> Unicode::DisplayWidth.offsets[19968]
=> nil

Other Kanji chars might get same results.

Any way, you do great work.

melborne

@janlelis
Copy link
Owner

janlelis commented Jan 5, 2011

Thanks for your issue.

It's now fixed (and refactored) with version 0.1.1 :)

@melborne
Copy link
Author

melborne commented Jan 5, 2011

It's now works on my env.
Thanks!

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

No branches or pull requests

2 participants