Commit db5f07b0 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'Fix-ConvertUnicodeToAscii-Utility' into 'master'

Fix convertUnicodeToAscii text utility method

See merge request gitlab-org/gitlab!40737
parents 650f3ad4 937a80d8
......@@ -283,7 +283,7 @@ const unicodeConversion = [
[/[ÌÍÎÏĨĪĬĮİ]/g, 'I'],
[/[Ððĥħ]/g, 'h'],
[/[ÑŃŅŇʼn]/g, 'N'],
[/[ÒÓÔÕÖØŌŎŐ]/g, 'O'],
[/[ÒÓÔÕØŌŎŐ]/g, 'O'],
[/[ÙÚÛŨŪŬŮŰŲ]/g, 'U'],
[/[ÝŶŸ]/g, 'Y'],
[/[Þñþńņň]/g, 'n'],
......@@ -293,7 +293,7 @@ const unicodeConversion = [
[/[çćĉċč]/g, 'c'],
[/[èéêëēĕėęě]/g, 'e'],
[/[ìíîïĩīĭį]/g, 'i'],
[/[òóôõöøōŏő]/g, 'o'],
[/[òóôõøōŏő]/g, 'o'],
[/[ùúûũūŭůűų]/g, 'u'],
[/[ýÿŷ]/g, 'y'],
[/[ĎĐ]/g, 'D'],
......
......@@ -218,10 +218,11 @@ describe('text_utility', () => {
it('replaces Unicode characters', () => {
expect(textUtils.convertUnicodeToAscii('Dĭd söméònê äšk fœŕ Ůnĭċődę?')).toBe(
'Did someone aesk foer Unicode?',
'Did soemeone aesk foer Unicode?',
);
expect(textUtils.convertUnicodeToAscii("Jürgen's Projekt")).toBe("Juergen's Projekt");
expect(textUtils.convertUnicodeToAscii('öäüÖÄÜ')).toBe('oeaeueOeAeUe');
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment