PPS Encoding and Decoding API

Updated: April 19, 2023

The PPS encoding and decoding API makes it easy to encode and decode complex data structures such as arrays and objects in PPS attributes and to ensure attributes are properly typed.

It's usually much easier to use these functions for all but the simplest of tasks and is often much safer. Although you can use the standard libc functions to encode and decode PPS data, experience has shown it's sometimes harder to do this correctly than one might think.

PPS attribute encodings

The PPS encoding and decoding API supports the attribute encodings described in Attribute syntax.

To allow interoperability between PPS clients of varying sophistication, the simplest encoding is always used by the encoder functions. For example, consider a string that can be represented using the null encoding, C encoding, and JSON. If the string being encoded doesn't include new line characters, the null encoding is used; if it does, the encoding switches to C.

The existence of these encodings should be important only if you're going to write your own PPS parsers or if you need to deal with PPS data from shell scripts.