MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / utf16LE

Function utf16LE

pkg/tabular/tabular_test.go:152–159  ·  view source on GitHub ↗

utf16LE encodes s as UTF-16 little-endian with a BOM, mimicking PowerShell redirection.

(s string)

Source from the content-addressed store, hash-verified

150
151// utf16LE encodes s as UTF-16 little-endian with a BOM, mimicking PowerShell redirection.
152func utf16LE(s string) []byte {
153 out := make([]byte, 0, 2+2*len(s))
154 out = append(out, 0xFF, 0xFE) // LE BOM
155 for _, r := range s {
156 out = append(out, byte(r), byte(r>>8))
157 }
158 return out
159}
160
161// utf16BE encodes s as UTF-16 big-endian with a BOM.
162func utf16BE(s string) []byte {

Callers 1

TestParseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected