1
Vote

Accents in the Resource Name

description

Working with Applications in Portuguese and Spanish, there are accents (diacritics) and cedilla is not recommended to use as the resource name, it would be interesting if these characters come already replaced. As I can I am available, is an example of removal:
static string RemoveDiacritics(string text) 
{
    var normalizedString = text.Normalize(NormalizationForm.FormD);
    var stringBuilder = new StringBuilder();

    foreach (var c in normalizedString)
    {
        var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
        if (unicodeCategory != UnicodeCategory.NonSpacingMark)
        {
            stringBuilder.Append(c);
        }
    }

    return stringBuilder.ToString().Normalize(NormalizationForm.FormC);
}

comments