[TASK] Add function to check and fix utf8

This commit is contained in:
Philipp Dieter 2021-07-05 14:25:06 +02:00
parent bb6ca7da07
commit ef09ca9302

View File

@ -64,4 +64,11 @@ class StringUtility
} }
return implode('', $pieces); return implode('', $pieces);
} }
public static function checkAndfixUtf8($string){
if (!mb_detect_encoding($string, 'UTF-8', true)) {
$string = mb_convert_encoding($string , 'UTF-8', 'ASCII');
}
return $string;
}
} }