termbox-go
termbox-go copied to clipboard
When I update termbox-go, it can't print chinese or Japanese.
I'm waiting a pull request from this guy: https://github.com/nsf/termbox-go/pull/69
But apparently he's gone somewhere.
Just merged this pull request: https://github.com/nsf/termbox-go/pull/74
Does it work now?
i wil try later thx very much!
gomatrix still prints the japanese kana's correctly at termbox-go 10f14d7408b64a659b7c694a771f5006952d336c

Looking good!
:smile: :+1:
It can print chinese too
i am using this function to print chinese character. the key problem is the width of chinese rune.
it's a quick workaround.
func print_tb(x, y int, fg, bg termbox.Attribute, msg string) { for _, c := range msg { //fmt.Printf("%d ", utf8.RuneLen(c)) termbox.SetCell(x, y, c, fg, bg) if utf8.RuneLen(c) > 1 { //handle chinese rune x += 2 } else { x++ } } }
utf8.RuneLen(c) doesn't represent cell's width. Use @mattn's library for that: https://github.com/mattn/go-runewidth
thanks, i already done that.