7
Hello,
I need to replace the string </script> transforming it into the string \n. The problem is that unfortunately my PHP project is with charset=ISO-8859-1, while javascript runs with UTF8.
What code or character can I use to represent the \n in the code conversion below?
str = str.replace(/\<\/script>/g, encodeURIComponent(String("\n")));
See how the string is displayed by an Alert after conversion?
Erro ao enviar email. %5CnErro ao enviar email. %5CnO seu chamado foi cadastrado com sucesso!
And how I wanted it to be printed:
Erro ao enviar email.
Erro ao enviar email.
O seu chamado foi cadastrado com sucesso!
Thank you!
Thank you @Bacco. The example worked perfectly for me.
– mayconfsbrito