remove diacritics from the TitleFirstCharacter

This commit is contained in:
Stevie Robinson 2023-10-01 17:28:14 +02:00
parent 93709ec1e9
commit e7ef30ee6f
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
[TestCase("좀비버스", "좀\\좀비버스")]
[TestCase("¡Mucha Lucha!", "M\\¡Mucha Lucha!")]
[TestCase(".hack", "H\\hack")]
[TestCase("Ütopya", "Ü\\Ütopya")]
[TestCase("Ütopya", "U\\Ütopya")]
public void should_get_expected_folder_name_back(string title, string expected)
{

View File

@ -381,13 +381,13 @@ namespace NzbDrone.Core.Organizer
{
if (char.IsLetterOrDigit(title[0]))
{
return title.Substring(0, 1).ToUpper();
return title.Substring(0, 1).ToUpper().RemoveAccent();
}
// try the second character if the first was non alphanumeric
if (char.IsLetterOrDigit(title[1]))
{
return title.Substring(1, 1).ToUpper();
return title.Substring(1, 1).ToUpper().RemoveAccent();
}
// default to "_" if no alphanumeric character can be found in the first 2 positions