Part of the process makes sure all line endings are in DOS format (CRLF), which is probably required by specifications.
If PHP's mbstring extension is enabled, the mb_convert_encoding() function is used to ensure the payload matches the encoding set in the XML declaration. The encoding type can be manually set via XML_RPC_Message::setSendEncoding().