Created
August 1, 2020 18:54
-
-
Save okdistribute/5f8ae929d5b550a451856d0aacea15c9 to your computer and use it in GitHub Desktop.
utf go lameness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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