{
// tables used for transcoding different charsets into us-ascii xml
protected $xml_iso88591_Entities = array("in" => array(), "out" => array());
- protected $xml_iso88591_utf8 = array("in" => array(), "out" => array());
- /// @todo add to iso table the characters from cp_1252 range, i.e. 128 to 159?
- /// These will NOT be present in true ISO-8859-1, but will save the unwary
- /// windows user from sending junk (though no luck when receiving them...)
+ /// @todo should we add to the latin-1 table the characters from cp_1252 range, i.e. 128 to 159 ?
+ /// Those will NOT be present in true ISO-8859-1, but will save the unwary windows user from sending junk
+ /// (though no luck when receiving them...)
+ /// Note also that, apparently, while 'ISO/IEC 8859-1' has no characters defined for bytes 128 to 159,
+ /// IANA ISO-8859-1 does have well-defined 'C1' control codes for those - wikipedia's page on latin-1 says:
+ /// "ISO-8859-1 is the IANA preferred name for this standard when supplemented with the C0 and C1 control codes from ISO/IEC 6429."
+ /// Check what mbstring/iconv do by default with those?
/*
protected $xml_cp1252_Entities = array('in' => array(), out' => array(
'€', '?', '‚', 'ƒ',
/**
* This class is singleton for performance reasons.
+ * @todo can't we just make $xml_iso88591_Entities a static variable instead ?
*
* @return Charset
*/
return self::$instance;
}
+ /**
+ * @todo move the creation of the charset tables to be on-demand. This saves memory and time when latin-1 is not used at all
+ */
private function __construct()
{
for ($i = 0; $i < 32; $i++) {
default:
$escapedData = '';
- error_log('XML-RPC: ' . __METHOD__ . ": Converting from $srcEncoding to $destEncoding: not supported...");
+ Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ": Converting from $srcEncoding to $destEncoding: not supported...");
}
return $escapedData;
}
/**
- * Checks if a given charset encoding is present in a list of encodings or
- * if it is a valid subset of any encoding in the list.
+ * Checks if a given charset encoding is present in a list of encodings or if it is a valid subset of any encoding
+ * in the list.
*
* @param string $encoding charset to be tested
* @param string|array $validList comma separated list of valid charsets (or array of charsets)