MCPcopy Create free account
hub / github.com/tdewolff/canvas / parseTextString

Function parseTextString

cmd/pdftext/util.go:70–79  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

68}
69
70func parseTextString(b []byte) string {
71 if len(b)%2 == 0 && len(b) != 0 && b[0] == 254 && b[1] == 255 {
72 s := []rune{}
73 for i := 2; i+2 <= len(b); i += 2 {
74 s = append(s, rune(binary.BigEndian.Uint16(b[i:i+2])))
75 }
76 return string(s)
77 }
78 return string(b)
79}
80
81func parseDate(b []byte) time.Time {
82 t, _ := time.Parse("D:20060102150405Z07'00'"[:len(b)], string(b))

Callers 1

GetInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected