Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2023-05-21 17:34:34 +02:00
21 changed files with 154 additions and 78 deletions

View File

@@ -8937,6 +8937,22 @@ function utf8_check($str)
return true;
}
/**
* Check if a string is in UTF8
*
* @param string $str String to check
* @return boolean True if string is valid UTF8 string, false if corrupted
*/
function utf8_valid($str)
{
/* 2 other methods to test if string is utf8
$validUTF8 = mb_check_encoding($messagetext, 'UTF-8');
$validUTF8b = ! (false === mb_detect_encoding($messagetext, 'UTF-8', true));
*/
return preg_match('//u', $str) ? true : false;
}
/**
* Check if a string is in ASCII
*