summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-24 20:35:01 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-24 20:35:01 +0200
commit661b5501b0e3f456d3a56d72e342074062ded0e8 (patch)
tree9997388d69d04a18f623589d692683b6c4d75b1f /lib
parentd4b700ef4ebfa9aba9bcadda864ed5a2a92174ed (diff)
downloadnextcloud-server-661b5501b0e3f456d3a56d72e342074062ded0e8.tar.gz
nextcloud-server-661b5501b0e3f456d3a56d72e342074062ded0e8.zip
added normalizeUnicode() method to OC_Util
Diffstat (limited to 'lib')
-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;
+ }
}