The PeerGuardian Text Lists (P2P) Format

The P2P format was created for the original PeerGuardian. It is simple and easily editable with any text editor, but is not very compact for transport in bandwidth limited situations.

The format

The P2P format had no official specification, but applications always follow the basic format:

Some organization:
Another organization:

The encoding of a P2P list is not formally defined, but many parsers assume they are ASCII or ISO-8859-1. PeerGuardian 2 (Windows) assumes P2P lists are encoded in ISO-8859-1 if they do not begin with a UTF-8 BOM.
PeerGuardian Linux allows to specify the encoding of the blocklist to be read.
TODO: which encoding is assumed by PeerGuardian Linux if none specified?

PeerGuardian 2 (Windows) and PeerGuardian Linux treat lines which start with a # as a single-line comment and ignores empty lines, like so:

# This is a comment
Some organization:
Another organization:

# This is another comment
Yet another organization:
And another:

Developing with P2P

A cross-platform C++ library for working with the P2P format is freely available here.

See also

eMule Text Lists (DAT) Format
PeerGuardian Binary Lists (P2B) Format

Based upon the old PhoenixLabs Wiki page