Skip to content

Instantly share code, notes, and snippets.

@ra
Created December 5, 2013 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ra/7805934 to your computer and use it in GitHub Desktop.
Save ra/7805934 to your computer and use it in GitHub Desktop.
print runes over for loop range of Unicode code points
package main
import (
"fmt"
)
func main() {
// x := string([]rune{0x767d, 0x9d6c, 0x7fd4}) // works
// x := string(rune(0x66)) // works
for x := 0x0e82; x < 0x0ec6; x++ { // change these bounds to see other glyphs
y := string(rune(x))
fmt.Println("decimal code point and its rune:", x, y)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment