- // Have php try to detect the encoding from the text given to us.\r
- $charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) );\r
- if (is_object($debug_object)) {$debug_object->debugLog(2, 'mb_detect found: ' . $charset);}\r
+ // Use this in case mb_detect_charset isn't installed/loaded on this machine.\r
+ $charset = false;\r
+ if (function_exists('mb_detect_encoding'))\r
+ {\r
+ // Have php try to detect the encoding from the text given to us.\r
+ $charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) );\r
+ if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);}\r
+ }\r