Commit 937a80d8 authored by Kev's avatar Kev

Fix convertUnicodeToAscii text utility method

parent caae0ec3
......@@ -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