So basically I have use an Api with unicode characters in my angular project . For example " and ' I tried to use pipes to decode them but there are lots of them . Is there any library or any other way to decode them ?
here is a code if my pipe if it will be helpfull:
transform(value: string) {
let finalValue = value;
if (finalValue.includes(""") || finalValue.includes('“')) {
finalValue = finalValue.replace(/"/g, '"');
finalValue = finalValue.replace(/“/g, '"');
}
if (finalValue.includes("'") || finalValue.includes('’')) {
finalValue = finalValue.replace(/'/g, "'");
finalValue = finalValue.replace(/’/g, "'");
}
if (finalValue.includes("&")) {
finalValue = finalValue.replace(/&/g, "&");
}
return finalValue;
}