If you run fmt.Println(\"\\u554a\"), it shows \'啊\'.
fmt.Println(\"\\u554a\")
But how to get unicode-style-string \\u554a from a rune \'啊\' ?
\\u554a
package main import "fmt" import "strconv" func main() { quoted := strconv.QuoteRuneToASCII('啊') // quoted = "'\u554a'" unquoted := quoted[1:len(quoted)-1] // unquoted = "\u554a" fmt.Println(unquoted) }
This outputs:
\u554a