Replacement of special characters by ASCII codes

6

I'm setting up a site built in charset and when I move to UTF-8 the special characters appear on the screen with that diamond and a question mark, so in addition to charset I need to change the characters by ASCII codes.

Ex: á - á
    é - é
...

How can I do this in a faster way? Any function in PHP?

    
asked by anonymous 16.12.2014 / 18:10

1 answer

3

If I understand what you want, you have a function ready for this, the htmlentities() .

If you want to change this in the HTML source, you can do a quick script to process all files using this function.

You also have several utilities to do this, including online .

Depending on the editor you are using it has how to do this at some option or at the time of saving.

Furthermore you can use what Bacco has commented declare(encoding='ISO-8859-1'); in each PHP file , setting a directive for the correct generation of HTML.

    
16.12.2014 / 18:13