-
-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
It appears that StringWidth reports the length of certain runes incorrectly. The problem seems to be centered around languages used primarily in India (Tamil, Telugu, and Hindi are examples).
Sample program that shows the problem:
package main
import (
"fmt"
"github.com/mattn/go-runewidth"
"strings"
)
func main() {
words := []string{
"English",
"हिन्द",
"தமிழ்",
"ไทย",
"עברית",
}
for _, w := range words {
max := 12 - runewidth.StringWidth(w)
fmt.Printf("|%s%s|\n", w, strings.Repeat(" ", max))
}
}The output is shows the misalignment in the 2nd and 3rd rows (sorry, but pasting here won't work since Github seems to force "Liberation Mono" as the monospace font and this font appears to have its own issues). I've tried this on terminals, browsers, etc, always with similar results.
pepa65
Metadata
Metadata
Assignees
Labels
No labels