Function guess_encoding
xml charset encoding guessing helper function. Tries to determine the charset encoding of an XML chunk received over HTTP. NB: according to the spec (RFC 3023), if text/xml content-type is received over HTTP without a content-type, we SHOULD assume it is strictly US-ASCII. But we try to be more tolerant of unconforming (legacy?) clients/servers, which will be most probably using UTF-8 anyway...
Todo:
explore usage of mb_http_input(): does it detect http headers + post data? if
so, use it instead of hand-detection!!!
Located at wa-apps/blog/plugins/import/vendors/xmlrpc/lib/xmlrpc.php
Located at wa-apps/blog/plugins/import/vendors/xmlrpc/lib/xmlrpc.php
string |
$httpheader = '' |
$httpheaders the http Content-type header |
string |
$xmlchunk = '' |
xml content buffer |
string |
$encoding_prefs = null |
comma separated list of character encodings to be used as default (when mb extension is enabled) |