Encode infinite word/community parameters as a single string.