diff --git a/lib/weblib.php b/lib/weblib.php
index <HASH>..<HASH> 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -1298,6 +1298,7 @@ function wikify_links($string) {
 function fix_non_standard_entities($string) {
     $text = preg_replace('/&#0*([0-9]+);?/', '&#$1;', $string);
     $text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', '&#x$1;', $text);
+    $text = preg_replace('/\p{Cc}/u', ' ', $text);
     return $text;
 }
MDL-<I> fix invalid XML unicode characters when uses KSES filtering - credit goes to Jenny Gray