utf8包的使用问题
我写了个读文件的程序 只是读一个简单的txt文件,但里面含有中文 package main import ( "fmt" file "io/ioutil" // utf "unicode/utf8" ) func main() { readbuf, _ := file.ReadFile("test.txt") str := string(readbuf) buf := []rune(str) //buf, l := utf.DecodeRune(readbuf) l := len(buf) for i...阅读全文