How to see integer representation of a list of characters

Can someone explain to me why this allows me to see the integer representation of chars?

~c/cat\0/
[99, 97, 116, 0]

And this does not

~c/cat/
‘cat’

0 is not a printable character, hence [99, 97, 116, 0] is not printable.

Then why does this not work?

~c/cat0/

Why must 0 be escaped?

'0' here is not 0, but 48, which is printable.

iex(test@127.0.0.1)> [0]
[0]
iex(test@127.0.0.1)> [?0]
'0'
iex(test@127.0.0.1)> [48]
'0'
iex(test@127.0.0.1)> ?0
48
2 Likes