Closed larskn closed 3 years ago
When I specify replacements for umlauts (e.g. "ae" for "ä" which is the common replacement) these are not working anymore after moving to 3.0.0
For this test:
[Fact] public void TestUmlauts() { const string original = "äöüÄÖÜß"; const string expected = "aeoeueaeoeuess"; var helper = new SlugHelper(new SlugHelperConfiguration { StringReplacements = new Dictionary<string, string> { {" ", "-" }, {"Ä", "Ae" }, {"Ö", "Oe" }, {"Ü", "Ue" }, {"ä", "ae" }, {"ö", "oe" }, {"ü", "ue" }, {"ß", "ss" } }, }); Assert.Equal(expected, helper.GenerateSlug(original)); }
This is the result:
The reason is that the string normalisation changes the single umlaut char to multiple chars and therefore the replacement char is not found in the input string.
When I specify replacements for umlauts (e.g. "ae" for "ä" which is the common replacement) these are not working anymore after moving to 3.0.0
For this test:
This is the result:
The reason is that the string normalisation changes the single umlaut char to multiple chars and therefore the replacement char is not found in the input string.