diff --git a/utils.go b/utils.go index 301bdcb..4b98178 100644 --- a/utils.go +++ b/utils.go @@ -2,9 +2,11 @@ package main // import "eriol.xyz/piken" import ( "encoding/csv" + "fmt" "io" "net/http" "os" + "strconv" "time" "github.com/Sirupsen/logrus" @@ -84,3 +86,14 @@ func readCsvFile(filepath string) (records [][]string, err error) { return records, nil } + +// Convert an unicode codepoint into a string. +func codePointToGlyph(codepoint string) (string, error) { + + s, err := strconv.ParseInt(codepoint, 16, 32) + if err != nil { + return "", err + } + return fmt.Sprintf("%c", s), nil + +}