Andrei,
I have a "bug" on cenerating pictures seo names with accents.
FI. I have this name:
bavlněnýImage generated system name is:
bavlnnbut should be:
bavlneny(The same works fine on SEO url)
Thanks [b][/b]
I made some research and I am sending you a pieco of code I used in another project:
using System.Globalization;
using System.Text;
namespace XYZ
{
public class StringHelper
{
// For de-accenting string
public static string ToUrl(string s, string deli = "_", bool tolower = true)
{
s = s.Normalize(NormalizationForm.FormD).Trim();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.Length; i++)
{
if (CharUnicodeInfo.GetUnicodeCategory(s[i]) != UnicodeCategory.NonSpacingMark) sb.Append(s[i]);
}
string tit = sb.ToString();
tit = (tolower) ? tit.ToLower() : tit;
tit = tit.Replace("/", "-");
tit = tit.Replace("&", "and");
tit = tit.Replace(" ", deli);
tit = tit.Replace("+", deli+"plus");
tit = tit.Replace("„", "");
tit = tit.Replace("“", "");
tit = tit.Replace("”", "");
tit = tit.Replace("‚", "");
tit = tit.Replace("‘", "");
tit = tit.Replace("’", "");
tit = tit.Replace(":", "");
tit = tit.Replace("-", deli);
tit = tit.Replace("\"", "");
tit = tit.TrimEnd();
return tit;
}
}
}
Maybe can inspire you.