public static bool ValidateSortRules(string rules, out string message)
 {
     Collator.CollationRuleErrorInfo errorInfo = Collator.CheckRules(LdmlCollationParser.ReplaceUnicodeEscapesForIcu(rules));
     if (errorInfo != null)
     {
         message = string.Format("Invalid ICU rules (Line: {0}, Column: {1}).", errorInfo.Line, errorInfo.Offset);
         return(false);
     }
     message = null;
     return(true);
 }
 public IcuRulesCollator(string rules)
 {
     try
     {
         _collator = new RuleBasedCollator(LdmlCollationParser.ReplaceUnicodeEscapesForIcu(rules));
     }
     catch (DllNotFoundException e)
     {
         throw new DllNotFoundException("IcuRulesCollator requires the ICU dlls to be present", e);
     }
 }
 public IcuRulesCollator(string rules)
 {
     try
     {
         lock (((ICollection)_createdCollators).SyncRoot)
         {
             _collator = new RuleBasedCollator(LdmlCollationParser.ReplaceUnicodeEscapesForIcu(rules));
             _createdCollators.Add(_collator, this);
         }
     }
     catch (DllNotFoundException e)
     {
         throw new DllNotFoundException("IcuRulesCollator requires the ICU dlls to be present", e);
     }
 }