encoder for metadata