diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-25 15:02:04 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-25 15:02:04 -0400 |
| commit | ef6b90b8e6e6c317fcda85a392c79324f91250db (patch) | |
| tree | 570c78c0915d3608399f003038b66d56e5e29e84 /MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | |
| parent | edbe28d9fc3091121b7e2323fe42d62a70c9e351 (diff) | |
make controller project portable
Diffstat (limited to 'MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs index 2f4ff26cd..0b1878c06 100644 --- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs +++ b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs @@ -10,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 @@ -80,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); } @@ -106,6 +109,15 @@ 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); + } + /// <summary> /// Gets the cultures. /// </summary> |
