UTF-8 encoding conversion todo list
This commit is contained in:
15
config.php
15
config.php
@@ -4495,6 +4495,21 @@ class ToolBox
|
||||
|
||||
return $asResult;
|
||||
}
|
||||
|
||||
public static function utf8_compliant($sText)
|
||||
{
|
||||
if(strlen($sText) == 0) return true;
|
||||
return (preg_match('/^.{1}/us', $sText, $ar) == 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Only works with ISO-8859-1 and UTF-8 encoding
|
||||
*/
|
||||
public static function strlen($sText)
|
||||
{
|
||||
if(utf8_compliant($sText)) return strlen(utf8_decode($sText));
|
||||
else return strlen($sText);
|
||||
}
|
||||
}
|
||||
|
||||
/* Debug */
|
||||
|
||||
Reference in New Issue
Block a user