How do you encode unicode code points in Go? In the example below I'm storing the hex representation of the unicode for ace of spades as \u1F0A1
but when I print it comes out as Ἂ1
. Why is that? If I copy and paste the ace of spades glyph it prints fine.
package main
import "fmt"
func main() {
fmt.Println("
Lowercase \u
is for Unicode code points from \u0000
to \uFFFF
. Use \U
if you want to have code points above 0xFFFF:
package main
import "fmt"
func main() {
fmt.Println("