Few utf-8 characters are not being decoded properly in linux OS

I have a javascript file where i encode, decode and remove/modify some characters from the url. I have been recently facing some issues during the decoding of this particular character (“ and ”). When this character is parsed it throws a Uncaught SyntaxError: Invalid regular expression: /?/: Nothing to repeat error. When i commented the decoding it parsed the file without an issue. I want to know why this character is being not parsed by the browser.

This is my function for reference:

decodeEntities = function(v){
if (v !== null && v !== '' && typeof(v) == 'string') {
v = v.replace(/>/gi,">"); // 62
v = v.replace(/&lt;/gi,"<"); // 60
v = v.replace(/&#38;/g, "&");
v = v.replace(/``/g, " ");
v = v.replace(/“/gi,""");//<-- exception in chrome version 95 and up, works for 94
v = v.replace(/”/gi,""");//<-- exception in chrome version 95 and up, works for 94
}
return v;
};

Following two statements from the function above fails with the error above for chrome versions 95 and above. 94 however has no problem with it. v = v.replace(/“/gi,”””);
v = v.replace(/”/gi,”””); Any help as to how to rewrite the last two lines of the code would be greatly appreciated. Thanks.