diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-27 23:17:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-27 23:17:31 -0400 |
| commit | 57f83a2744fb5ebdf5774d51d2125ea46f4ce8ab (patch) | |
| tree | f0a8c9137d24160fe8e2955bff7010163f2d4066 /MediaBrowser.Server.Implementations/Localization | |
| parent | 8fcc7a0385b9db202c1f93ee897eb5a11d2759da (diff) | |
| parent | f6acc5fbff081728138564867a58b7848c92c467 (diff) | |
Merge pull request #2256 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Localization')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs index ec544dd70..e4db98b3f 100644 --- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs +++ b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Extensions; using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Localization; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Serialization; @@ -11,7 +10,10 @@ using System.Globalization; using System.IO; using System.Linq; using System.Reflection; -using CommonIO; +using System.Text; +using MediaBrowser.Common.IO; +using MediaBrowser.Controller.IO; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; namespace MediaBrowser.Server.Implementations.Localization @@ -81,7 +83,7 @@ namespace MediaBrowser.Server.Implementations.Localization var target = Path.Combine(localizationPath, filename); _logger.Info("Extracting ratings to {0}", target); - using (var fs = _fileSystem.GetFileStream(target, FileMode.Create, FileAccess.Write, FileShare.Read)) + using (var fs = _fileSystem.GetFileStream(target, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read)) { stream.CopyTo(fs); } @@ -107,6 +109,20 @@ namespace MediaBrowser.Server.Implementations.Localization } } + public string RemoveDiacritics(string text) + { + return String.Concat( + text.Normalize(NormalizationForm.FormD) + .Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) != + UnicodeCategory.NonSpacingMark) + ).Normalize(NormalizationForm.FormC); + } + + public string NormalizeFormKD(string text) + { + return text.Normalize(NormalizationForm.FormKD); + } + /// <summary> /// Gets the cultures. /// </summary> |
