Angular DOM sanitizer: How to keep accents in message input?

87 views Asked by At

I am using DomSanitizer to search if there are any scripts inside an message(a formgroup of the site). The scripting part works, but if I use any accent inside the message, it get's changed . How to solve this?

this.formGroup.value.message= this.sanitizer.sanitize( SecurityContext.HTML, this.formGroup.value.message );

Sent message: "é"

content in BD:

message content

enter image description here

What's the best way to convert it for the user? And in your opinion, convert it back to normal in the backend or front?

0

There are 0 answers