package main

import "fmt"

func main() {
	var chinese = "人工智能"
	fmt.Println("chinese length", len(chinese))
	fmt.Println("chinese word length", len([]rune(chinese)))
	fmt.Println("chinese word length", utf8.RuneCountInString(chinese))

	for i, ch := range chinese {
		fmt.Printf("(%d, %c)", i, ch) // (0, 人)(3, 工)(6, 智)(9, 能)
	}

	fmt.Println()

	for i, ch := range []rune(chinese) {
		fmt.Printf("(%d, %c)", i, ch) // (0, 人)(1, 工)(2, 智)(3, 能)
	}

	fmt.Println()
}
# chinses is 3 bytes
chinese length 12
chinese word length 4
chinese word length 4
(0, 人)(3, 工)(6, 智)(9, 能)
(0, 人)(1, 工)(2, 智)(3, 能)