I'm trying to port some Java to Go. The Java code has a character variable with the value '\ud83f'
. When I try to use this value in Go, it doesn't compile:
package main
func main() {
c := '\ud83f'
println(c)
}
$ go run a.go
# command-line-arguments
./a.go:3: invalid Unicode code point in escape sequence: 0xd83f
Why? I also tried making a string with that value in Python and it worked too. It's just not working in Go for some reason.