{"ScriptPreparationCode":"const replaceMap = {\r\n \u0153: \u0027oe\u0027,\r\n \u00E6: \u0027ae\u0027,\r\n}\r\nconst replacementsRegex = new RegExp(Object.keys(replaceMap).join(\u0027|\u0027), \u0027g\u0027)\r\nwindow.removeDiacritics = (value) =\u003E {\r\n return value\r\n .normalize(\u0027NFD\u0027)\r\n .replace(/[\\u0300-\\u036f]/g, \u0027\u0027)\r\n .replace(replacementsRegex, (char) =\u003E {\r\n return replaceMap[char] || char\r\n })\r\n}\r\n\r\nwindow.oldRemoveDiacritics = function(s) {\r\n if (!s)\r\n return s;\r\n\r\n let r = s;\r\n\r\n r = r.replace(/[\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g, \u0027a\u0027);\r\n r = r.replace(/\u00E6/g, \u0027ae\u0027);\r\n r = r.replace(/\u00E7/g, \u0027c\u0027);\r\n r = r.replace(/[\u00E8\u00E9\u00EA\u00EB]/g, \u0027e\u0027);\r\n r = r.replace(/[\u00EC\u00ED\u00EE\u00EF]/g, \u0027i\u0027);\r\n r = r.replace(/\u00F1/g, \u0027n\u0027);\r\n r = r.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6]/g, \u0027o\u0027);\r\n r = r.replace(/\u0153/g, \u0027oe\u0027);\r\n r = r.replace(/[\u00F9\u00FA\u00FB\u00FC]/g, \u0027u\u0027);\r\n r = r.replace(/[\u00FD\u00FF]/g, \u0027y\u0027);\r\n r = r.replace(/\\\\W/g, \u0027\u0027);\r\n\r\n // To prevent some weird behaviors with MacOS diacritics\r\n r = _(r).map(function(char) {\r\n return String.fromCharCode(char.charCodeAt(0));\r\n });\r\n\r\n return r.join(\u0027\u0027);\r\n};","TestCases":[{"Name":"Old","Code":" oldRemoveDiacritics(\u0060\r\n \r\n Dji pou magn\u00EE do v\u00EAre, \u00E7oula m\u0027 freut n\u00E9n m\u00E5 - \u00E6sope - robot \u0153uf\r\n \r\n Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reiciendis voluptatem dolores molestiae possimus laudantium consequuntur placeat earum neque maxime modi quasi fugiat quae inventore, illo in corporis corrupti esse a!\r\n \u0060)","IsDeferred":false},{"Name":"New","Code":" removeDiacritics(\u0060\r\n \r\n Dji pou magn\u00EE do v\u00EAre, \u00E7oula m\u0027 freut n\u00E9n m\u00E5 - \u00E6sope - robot \u0153uf\r\n \r\n Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reiciendis voluptatem dolores molestiae possimus laudantium consequuntur placeat earum neque maxime modi quasi fugiat quae inventore, illo in corporis corrupti esse a!\r\n \u0060)","IsDeferred":false}]}