summaryrefslogtreecommitdiffstats
path: root/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.php')
-rwxr-xr-xlib/util.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 01e2df7bfc4..224ed32061c 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -1,4 +1,7 @@
<?php
+
+require_once 'Patchwork/PHP/Shim/Normalizer.php';
+
/**
* Class for utility functions
*
@@ -823,5 +826,16 @@ class OC_Util {
return $theme;
}
+ /**
+ * Normalize a unicode string
+ * @param string $value a not normalized string
+ * @return bool|string
+ */
+ public static function normalizeUnicode($value) {
+ if(class_exists('Patchwork\PHP\Shim\Normalizer')) {
+ $value = \Patchwork\PHP\Shim\Normalizer::normalize($value);
+ }
+ return $value;
+ }
}