From 661b5501b0e3f456d3a56d72e342074062ded0e8 Mon Sep 17 00:00:00 2001 From: Florin Peter <github@florin-peter.de> Date: Fri, 24 May 2013 20:35:01 +0200 Subject: [PATCH] added normalizeUnicode() method to OC_Util --- lib/util.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/util.php b/lib/util.php index 01e2df7bfc..224ed32061 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; + } } -- GitLab