[TASK] Add function to check and fix utf8
This commit is contained in:
parent
bb6ca7da07
commit
ef09ca9302
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user