zubair
zubair

Reputation: 447

JSON RFC 4627: whats the meaning of "false = %x66.61.6c.73.65 ; false"

I'm reading RFC 4627 (http://www.ietf.org/rfc/rfc4627.txt). In para 2.1, It talks about three literal names true, false, null.

     false = %x66.61.6c.73.65   ; false

     null  = %x6e.75.6c.6c      ; null

     true  = %x74.72.75.65      ; true

I am totally lost here. Does anyone know what %x66.61.6c.73.65 mean? Thanks.

Upvotes: 0

Views: 397

Answers (2)

dweeves
dweeves

Reputation: 5605

at first sight these seem to be the ascii codes for the letters :

  • false = "f"+"a"+"l"+"s"+"e" eg : char(0x65)+char(0x61)+char(0x6c)+char(0x73)+char(0x65)

Upvotes: 2

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798744

They're the bytes used for those words. In short, the text is to be encoded in ASCII (or the equivalent) and no other encoding.

>>> print '\x66\x61\x6c\x73\x65'
false

Upvotes: 2

Related Questions