The problem may be related to both the file encoding and some error in the output of your PHP.
Start by changing / configuring the encoding of the file by opening it in your IDE by changing the encoding option (or encoding in Portuguese) to UTF-8. Below are the step-by-step two editors that I believe are the most used by current professionals in the market and dev. beginners:
If you use Sublime text you can change by going to:
File - > reopen with enconding - > UTF-8 (English)
Archive - > reopen with encoding - > UTF-8 (Portuguese)
If you use Notepad :
Encoding - > Convert to UTF-8
Encoding - > Convert to UTF-8 (Portuguese)
For other IDE's you can consult its documentation.
After doing the above step, verify that in PHP you are using exactly header('Content-Type: text/html; charset=utf-8');
.
Also check using a debug tool (such as Google's Dev Tools ) if your output is exactly that : <meta charset="UTF-8">
, without any character. For some time now I have read a text that says about this charset need to be in the first 512kb of the document to avoid some bugs in some browsers . Unfortunately I could not find the link for you to take a look and I also believe that the problem related to this already must be solved, however, only for guarantee I recommend that you place between the 1st and 3rd line of your file, I usually put it after the % with% being in the first line after opening <meta http-equiv="X-UA-Compatible" content="IE=Edge">
.
Well, if after all this your problem persists, it can also be a byte-order mark ) being related to ASCII, usually caused by copies by copy and paste also known as CTRL + V and CTRL + C, I talked about it #. Page 92 To simplify, to solve you can open the file in a basic editor (for example the windows text editor) that does not interpret unicode or one that interprets but can display non-ASCII characters and delete the code snippet with problem retyping the same.
Finally, the MySQL connection may also be related if you use this response from the Jpsy user in the OS. You can resolve by assigning <head>
to the PDO builder call.