blob: edf7d03318d2b2153795f5bc4ed374e39648e9e6 [file] [log] [blame]
cue export bytes.cue
cmp stdout expect-stdout-cue
-- frontmatter.toml --
title = "Bytes"
description = ""
-- text.md --
CUE distinguishes between a `string` and a `bytes` type.
Bytes are converted to base64 when emitting JSON.
Byte literals are defined with single quotes.
The following additional escape sequences are allowed in byte literals:
\xnn // arbitrary byte value defined as a 2-digit hexadecimal number
\nnn // arbitrary byte value defined as a 3-digit octal number
<!-- jba: this contradicts the spec, which has \nnn (no leading zero) -->
-- bytes.cue --
a: '\x03abc'
-- expect-stdout-cue --
{
"a": "A2FiYw=="
}