Commit 937a80d8 authored by Kev's avatar Kev

Fix convertUnicodeToAscii text utility method

parent caae0ec3
...@@ -283,7 +283,7 @@ const unicodeConversion = [ ...@@ -283,7 +283,7 @@ const unicodeConversion = [
[/[ÌÍÎÏĨĪĬĮİ]/g, 'I'], [/[ÌÍÎÏĨĪĬĮİ]/g, 'I'],
[/[Ððĥħ]/g, 'h'], [/[Ððĥħ]/g, 'h'],
[/[ÑŃŅŇʼn]/g, 'N'], [/[ÑŃŅŇʼn]/g, 'N'],
[/[ÒÓÔÕÖØŌŎŐ]/g, 'O'], [/[ÒÓÔÕØŌŎŐ]/g, 'O'],
[/[ÙÚÛŨŪŬŮŰŲ]/g, 'U'], [/[ÙÚÛŨŪŬŮŰŲ]/g, 'U'],
[/[ÝŶŸ]/g, 'Y'], [/[ÝŶŸ]/g, 'Y'],
[/[Þñþńņň]/g, 'n'], [/[Þñþńņň]/g, 'n'],
...@@ -293,7 +293,7 @@ const unicodeConversion = [ ...@@ -293,7 +293,7 @@ const unicodeConversion = [
[/[çćĉċč]/g, 'c'], [/[çćĉċč]/g, 'c'],
[/[èéêëēĕėęě]/g, 'e'], [/[èéêëēĕėęě]/g, 'e'],
[/[ìíîïĩīĭį]/g, 'i'], [/[ìíîïĩīĭį]/g, 'i'],
[/[òóôõöøōŏő]/g, 'o'], [/[òóôõøōŏő]/g, 'o'],
[/[ùúûũūŭůűų]/g, 'u'], [/[ùúûũūŭůűų]/g, 'u'],
[/[ýÿŷ]/g, 'y'], [/[ýÿŷ]/g, 'y'],
[/[ĎĐ]/g, 'D'], [/[ĎĐ]/g, 'D'],
......
...@@ -218,10 +218,11 @@ describe('text_utility', () => { ...@@ -218,10 +218,11 @@ describe('text_utility', () => {
it('replaces Unicode characters', () => { it('replaces Unicode characters', () => {
expect(textUtils.convertUnicodeToAscii('Dĭd söméònê äšk fœŕ Ůnĭċődę?')).toBe( 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("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