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

When I update termbox-go, it can't print chinese or Japanese. #71

Open
dacez opened this issue Mar 5, 2015 · 10 comments
Open

When I update termbox-go, it can't print chinese or Japanese. #71

dacez opened this issue Mar 5, 2015 · 10 comments
Labels

Comments

@dacez
Copy link

dacez commented Mar 5, 2015

No description provided.

@nsf
Copy link
Owner

nsf commented Mar 5, 2015

I'm waiting a pull request from this guy: #69

But apparently he's gone somewhere.

@nsf
Copy link
Owner

nsf commented Mar 17, 2015

Just merged this pull request: #74

Does it work now?

@dacez
Copy link
Author

dacez commented Mar 18, 2015

i wil try later thx very much!

@GeertJohan
Copy link
Contributor

gomatrix still prints the japanese kana's correctly at termbox-go 10f14d7

@mattn
Copy link
Contributor

mattn commented Mar 18, 2015

Looking good!

@GeertJohan
Copy link
Contributor

😄 👍

@dacez
Copy link
Author

dacez commented Mar 26, 2015

It can print chinese too

@ericwq
Copy link

ericwq commented Apr 22, 2015

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++
}
}
}

@nsf
Copy link
Owner

nsf commented Apr 22, 2015

utf8.RuneLen(c) doesn't represent cell's width. Use @mattn's library for that: https://github.com/mattn/go-runewidth

@ericwq
Copy link

ericwq commented Apr 23, 2015

thanks, i already done that.

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

No branches or pull requests

5 participants