Run the following commands, where <80>
is a literal byte entered by typing Ctrl-Vx80:
let literal = "<80>"
let quoted = "\x80"
echo(literal)
andecho(quoted)
will now both output<80>
, but,len(literal)
returns2
instead of the expected1
, and:echo literal[0]
outputs<c2>
. The expected<80>
byte appears to be inliteral[1]
.
Where does this extra byte prefix come from? Why doesn't entering bytes with Ctrl-Vx result in the same sequences of bytes as adding them with a \x
special character?