diff options
author | icewind1991 <icewind1991@gmail.com> | 2013-05-31 14:00:02 -0700 |
---|---|---|
committer | icewind1991 <icewind1991@gmail.com> | 2013-05-31 14:00:02 -0700 |
commit | 94a6622bcd3c4a77aa2af8fd09920f8ac1e0245f (patch) | |
tree | f95ad6e96bcaa8908b911ed326de8700c3b1a8ae /lib/util.php | |
parent | 1656cc2e7c70288e705dc47db9c618149ab79111 (diff) | |
parent | adcafbde34b8f4c75dbf724e929766a1f7d964d4 (diff) | |
download | nextcloud-server-94a6622bcd3c4a77aa2af8fd09920f8ac1e0245f.tar.gz nextcloud-server-94a6622bcd3c4a77aa2af8fd09920f8ac1e0245f.zip |
Merge pull request #3459 from owncloud/fix_for_2377
fix problems with german "Umlaut" in folder name
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index 581f35bc0ac..b5fbb49e308 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,21 @@ 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')) { + $normalizedValue = \Patchwork\PHP\Shim\Normalizer::normalize($value); + if($normalizedValue === false) { + \OC_Log::write( 'core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN); + } else { + $value = $normalizedValue; + } + } + return $value; + } } |