Skip to content

Instantly share code, notes, and snippets.

@okdistribute
Created August 1, 2020 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okdistribute/5f8ae929d5b550a451856d0aacea15c9 to your computer and use it in GitHub Desktop.
Save okdistribute/5f8ae929d5b550a451856d0aacea15c9 to your computer and use it in GitHub Desktop.
utf go lameness
package main
import "fmt"
import "unicode/utf8"
func main() {
fmt.Println(len("Hello World"))
fmt.Println(utf8.RuneCountInString("Hello World"))
fmt.Println(len("读写汉字 - 学中文"))
fmt.Println(utf8.RuneCountInString("读写汉字 - 学中文"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment