mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Normalise Line endings (#1284)
* Add .gitattributes * Normalise line endings
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using AngleSharp.Dom;
|
||||
using AngleSharp.Html;
|
||||
using AngleSharp.Dom;
|
||||
using AngleSharp.Html;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
@@ -30,19 +30,19 @@ namespace Jackett.Utils
|
||||
}
|
||||
|
||||
// replaces culture specific characters with the corresponding base characters (e.g. è becomes e).
|
||||
public static String RemoveDiacritics(String s)
|
||||
{
|
||||
String normalizedString = s.Normalize(NormalizationForm.FormD);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < normalizedString.Length; i++)
|
||||
{
|
||||
Char c = normalizedString[i];
|
||||
if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark)
|
||||
stringBuilder.Append(c);
|
||||
}
|
||||
|
||||
return stringBuilder.ToString();
|
||||
public static String RemoveDiacritics(String s)
|
||||
{
|
||||
String normalizedString = s.Normalize(NormalizationForm.FormD);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < normalizedString.Length; i++)
|
||||
{
|
||||
Char c = normalizedString[i];
|
||||
if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark)
|
||||
stringBuilder.Append(c);
|
||||
}
|
||||
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
|
||||
public static string FromBase64(string str)
|
||||
@@ -104,7 +104,7 @@ namespace Jackett.Utils
|
||||
}
|
||||
|
||||
public static void Add(this ICollection<KeyValuePair<string, string>> collection, string key, string value)
|
||||
{
|
||||
{
|
||||
collection.Add(new KeyValuePair<string, string>(key, value));
|
||||
}
|
||||
|
||||
@@ -113,11 +113,11 @@ namespace Jackett.Utils
|
||||
if (element == null)
|
||||
return "<NULL>";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringWriter sw = new StringWriter(sb);
|
||||
var formatter = new PrettyMarkupFormatter();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringWriter sw = new StringWriter(sb);
|
||||
var formatter = new PrettyMarkupFormatter();
|
||||
element.ToHtml(sw, formatter);
|
||||
return sb.ToString();
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user