// The following code might be better for mb_string enabled installs, but makes the lib about 200% slower...
//if (!is_valid_charset($valEncoding, array('UTF-8'))
if (!in_array($valEncoding, array('UTF-8', 'US-ASCII')) && !XMLParser::hasEncoding($xmlVal)) {
- /// @todo replace with function_exists
- if (extension_loaded('mbstring')) {
+ if (function_exists('mb_convert_encoding')) {
$xmlVal = mb_convert_encoding($xmlVal, 'UTF-8', $valEncoding);
} else {
if ($valEncoding == 'ISO-8859-1') {
// The following code might be better for mb_string enabled installs, but makes the lib about 200% slower...
//if (!is_valid_charset($respEncoding, array('UTF-8')))
if (!in_array($respEncoding, array('UTF-8', 'US-ASCII')) && !XMLParser::hasEncoding($data)) {
- /// @todo replace with function_exists
- if (extension_loaded('mbstring')) {
+ if (function_exists('mb_convert_encoding')) {
$data = mb_convert_encoding($data, 'UTF-8', $respEncoding);
} else {
if ($respEncoding == 'ISO-8859-1') {
// makes the lib about 200% slower...
//if (!is_valid_charset($reqEncoding, array('UTF-8')))
if (!in_array($reqEncoding, array('UTF-8', 'US-ASCII')) && !XMLParser::hasEncoding($data)) {
- /// @todo replace with function_exists
- if (extension_loaded('mbstring')) {
+ if (function_exists('mb_convert_encoding')) {
$data = mb_convert_encoding($data, 'UTF-8', $reqEncoding);
} else {
if ($reqEncoding == 'ISO-8859-1') {