From c672d42d1109a5daa4cf243ba1f0383717e43104 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 12 Jul 2015 20:24:09 +0100 Subject: [PATCH] Add some commented code to remind the user that the client can accept many charsets now --- src/Client.php | 10 ++++++++++ src/Server.php | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index e46e1d5..e91ec51 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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; } diff --git a/src/Server.php b/src/Server.php index 20ec5a0..9b4c59d 100644 --- a/src/Server.php +++ b/src/Server.php @@ -51,7 +51,8 @@ class Server public $allow_system_funcs = true; /** * List of charset encodings natively accepted for requests. - * Set at constructor time. + * Set at constructor time. + * UNUSED so far... */ public $accepted_charset_encodings = array(); /** -- 2.43.0