Skip to content
Advertisement

How to convert String with “ (ISO-8859-1) characters to normal (UTF-8)characters?

JavaScript

i have lot a raw html string in database. all the text have these weird characters. how can i convert to normal text for saving back it back in database.

JavaScript

i tried above code, it displays correctly in web browser but still saving the same weird characters in database.

the charset of database is utf-8

Advertisement

Answer

JavaScript

for past datas, i replaced the weird characters with UTF-8 characters.

for future datas, i made the charset to utf8 in php, html and databases connections.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement