/** * UTF8 Encode data * * @param $mixed * @return array|string */ public static function utf8ize($mixed) { if (is_array($mixed)) { foreach ($mixed as $key => $value) { $mixed[$key] = SafeJson::utf8ize($value); } } else { if (is_string($mixed)) { return utf8_encode($mixed); } } return $mixed; }