From 07791d46a571d3d6eed23e98ec0fe1c46ea0d37f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 23 Oct 2016 15:14:57 -0400 Subject: rework scheduled tasks in preparation of common project going portable --- .../Extensions/BaseExtensions.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 MediaBrowser.Controller/Extensions/BaseExtensions.cs (limited to 'MediaBrowser.Controller/Extensions/BaseExtensions.cs') diff --git a/MediaBrowser.Controller/Extensions/BaseExtensions.cs b/MediaBrowser.Controller/Extensions/BaseExtensions.cs new file mode 100644 index 000000000..84a9b1524 --- /dev/null +++ b/MediaBrowser.Controller/Extensions/BaseExtensions.cs @@ -0,0 +1,25 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Text; +using MediaBrowser.Model.Cryptography; + +namespace MediaBrowser.Controller.Extensions +{ + /// + /// Class BaseExtensions + /// + public static class BaseExtensions + { + public static ICryptographyProvider CryptographyProvider { get; set; } + + public static string RemoveDiacritics(this string text) + { + return String.Concat( + text.Normalize(NormalizationForm.FormD) + .Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) != + UnicodeCategory.NonSpacingMark) + ).Normalize(NormalizationForm.FormC); + } + } +} -- cgit v1.2.3