fix: the client can now successfully call methods using ISO-8859-1 or UTF-8 character...
[plcapi.git] / src / Request.php
index 7d5a8a0..df899e3 100644 (file)
@@ -2,9 +2,10 @@
 
 namespace PhpXmlRpc;
 
+use PhpXmlRpc\Helper\Charset;
 use PhpXmlRpc\Helper\Http;
-use PhpXmlRpc\Helper\XMLParser;
 use PhpXmlRpc\Helper\Logger;
+use PhpXmlRpc\Helper\XMLParser;
 
 class Request
 {
@@ -52,7 +53,7 @@ class Request
             $this->content_type = 'text/xml';
         }
         $this->payload = $this->xml_header($charsetEncoding);
-        $this->payload .= '<methodName>' . $this->methodname . "</methodName>\n";
+        $this->payload .= '<methodName>' . Charset::instance()->encodeEntities($this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n";
         $this->payload .= "<params>\n";
         foreach ($this->params as $p) {
             $this->payload .= "<param>\n" . $p->serialize($charsetEncoding) .