more fixes to the manual
[plcapi.git] / src / Client.php
index e46e1d5..8fce704 100644 (file)
@@ -137,6 +137,16 @@ class Client
         // by default the xml parser can support these 3 charset encodings
         $this->accepted_charset_encodings = array('UTF-8', 'ISO-8859-1', 'US-ASCII');
 
+        // Add all charsets which mbstring can handle, but remove junk not found in IANA registry at
+        // in http://www.iana.org/assignments/character-sets/character-sets.xhtml
+        // NB: this is disabled to avoid making all the requests sent huge... mbstring supports more than 80 charsets!
+        /*if (function_exists('mb_list_encodings')) {
+
+            $encodings = array_diff(mb_list_encodings(), array('pass', 'auto', 'wchar', 'BASE64', 'UUENCODE', 'ASCII',
+                'HTML-ENTITIES', 'Quoted-Printable', '7bit','8bit', 'byte2be', 'byte2le', 'byte4be', 'byte4le'));
+            $this->accepted_charset_encodings = array_unique(array_merge($this->accepted_charset_encodings, $encodings));
+        }*/
+
         // initialize user_agent string
         $this->user_agent = PhpXmlRpc::$xmlrpcName . ' ' . PhpXmlRpc::$xmlrpcVersion;
     }
@@ -1049,25 +1059,20 @@ class Client
             }
 
             $response = array();
-            //for ($i = 0; $i < $numRets; $i++) {
             foreach($rets as $val) {
-                //$val = $rets->arraymem($i);
                 switch ($val->kindOf()) {
                     case 'array':
                         if ($val->count() != 1) {
                             return false;       // Bad value
                         }
                         // Normal return value
-                        //$response[] = new Response($val->arraymem(0));
                         $response[] = new Response($val[0]);
                         break;
                     case 'struct':
-                        //$code = $val->structmem('faultCode');
                         $code = $val['faultCode'];
                         if ($code->kindOf() != 'scalar' || $code->scalartyp() != 'int') {
                             return false;
                         }
-                        //$str = $val->structmem('faultString');
                         $str = $val['faultString'];
                         if ($str->kindOf() != 'scalar' || $str->scalartyp() != 'string') {
                             return false;