function normalizer_normalize($s, $form = s\Normalizer::NFC)
{
    return s\Normalizer::normalize($s, $form);
}
Exemple #2
0
 /**
  * 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;
 }