Compare commits

...

1 Commits

Author SHA1 Message Date
Git'Fellow f3b4fdccd0 refactor(encoding): Check if strings are valid for the specified encoding
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2025-01-29 11:39:04 +01:00
@@ -37,7 +37,7 @@ class Encoding extends Wrapper {
* Returns whether the given string is only made of ASCII characters
*/
private function isAscii(string $str): bool {
return !preg_match('/[\\x80-\\xff]+/', $str);
return mb_check_encoding($str, 'ASCII');
}
/**