MDL-9075 utf-8 bom is now stripped from uploaded users cvs file
This commit is contained in:
@@ -322,5 +322,15 @@ class textlib {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the BOM from unicode string - see http://unicode.org/faq/utf_bom.html
|
||||
*/
|
||||
function trim_utf8_bom($str) {
|
||||
$bom = "\xef\xbb\xbf";
|
||||
if (strpos($str, $bom) === 0) {
|
||||
return substr($str, strlen($bom));
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user