Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Unicode

len("尼")
3
s := "在线中文输入"
s
在线中文输入
len(s)
18
import "unicode/utf8"
q := "A to Z"
q
A to Z
fc, size1 := utf8.DecodeRuneInString(q)
fc
65
size1
1
lc, size2 := utf8.DecodeLastRuneInString(q)
lc
90
size2
1
fc, size1 := utf8.DecodeRuneInString(s)
fc
22312
size1
3