phphacklang

What kind of string representation is this?


I'm running the following code and I get the following output. According to the documentation it says it returns a binary string?

PHP\pack('H*', 'ab') //     "\253"
PHP\pack('H*', 'a')  //     "\240"

I can't for the life of me figure out 253 is 'ab'. 253 is 11111101 in binary which if you were to break out is

1111 and 1101 which don't map to a or b?

What does "\253" represent?


Solution

  • U+00AB, character «‬, decimal 171, hex 0xAB, octal \253, binary 10101011

    Specifically: http://software.hixie.ch/utilities/cgi/unicode-decoder/utf8-decoder?encoding=numeric&bytes=0xc2%200xab

    For any future issues: http://software.hixie.ch/utilities/cgi/unicode-decoder/character-identifier?keywords=quotation