I want to make a border around the text 这是一个测试, but I cannot get the actual width of it. With English text, it does work perfectly.
Here is my analysis:
len tells me this:
这是一个测试 18
aaaaaaaaa 10
つのだ☆HIRO 16
aaaaaaaaaa 10
runewidth.StringWidth tells me this:
这是一个测试 12
aaaaaaaaa 10
つのだ☆HIRO 11
aaaaaaaaaa 10
func main() {
fmt.Println("这是一个测试 |")
fmt.Println("aaaaaaaaaa | 10*a")
fmt.Println()
fmt.Println("这是一个测试 |")
fmt.Println("aaaaaaaaa | 9*a")
fmt.Println()
fmt.Println("Both are not equal to the Chinese text.")
fmt.Println("The (pipe) lines are not under each other.")
}
Question:
How can I get my box (first screenshot) to appear correctly?

