+ // try to 'guestimate' the character encoding of the received response
+ $respEncoding = XMLParser::guessEncoding(@$this->httpResponse['headers']['content-type'], $data);
+
+ if ($this->debug) {
+ $start = strpos($data, '<!-- SERVER DEBUG INFO (BASE64 ENCODED):');
+ if ($start) {
+ $start += strlen('<!-- SERVER DEBUG INFO (BASE64 ENCODED):');
+ $end = strpos($data, '-->', $start);
+ $comments = substr($data, $start, $end - $start);
+ Logger::instance()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t" .
+ str_replace("\n", "\n\t", base64_decode($comments)) . "\n---END---", $respEncoding);
+ }
+ }
+