I'm pretty sure I'm having the same problem this guy is having, but I the solution posted on that page doesn't seem to work for me (or I just understand it). I'm not particularly familiar with php and I've previously only used it for php includes so that I don't have to edit every page when I change a layout. My website is here. I've saved the file as UTF-8 and the text shows up properly in Dreamweaver, but doesn't work when I upload it to the website. What am I doing wrong?
Asked
Active
Viewed 548 times
0
-
I'm pretty sure that answer is the answer. When you check in your browser, what character encoding is selected in the "character set" menu? – Pekka Dec 01 '11 at 10:30
-
I changed the encoding to UTF-8. Is it showing up properly for you? o.0 – Sutaru Dec 01 '11 at 10:35
-
no, it is indeed not. Strange. So there is no database code involved here? You have everything directly in dreamweaver? – Pekka Dec 01 '11 at 10:36
-
I didn't originally code it in dreamweaver, so I can't guarantee nothing retarded happened, but it should just be the style.css, top.txt, indexx.php and bottom.txt going into to that page. I don't use any databases for this site. – Sutaru Dec 01 '11 at 10:40
-
Seems to me that this is a problem in your PHP source code, since what is displayed in the HTML source on the site is literal `?` characters, rather than nonsense characters like the dreaded rectangular blocks. So I guess that Dreamweaver is saving your PHP source in ASCII, iso-8859-1, or some other unibyte/non-standard multibyte character set. Open your PHP source in a text editor, not dreamweaver, and see if the characters display correctly there... If not, I would say this is definitely a problem with the way DW is saving the files. – DaveRandom Dec 01 '11 at 11:14
-
PHP will treat everything as binary and will not do anything about charsets unless you explicitly ask it to. – DaveRandom Dec 01 '11 at 11:16
-
When I open it in notepad, I can see the characters. – Sutaru Dec 01 '11 at 18:43
-
It works as an html file http://celestial-butterfly.sutaru.net/indexx.html but not as a php file http://celestial-butterfly.sutaru.net/indexx.php – Sutaru Dec 02 '11 at 02:07
2 Answers
0
you can use htmlentities() and html_entity_decode() php function to display any character set in web page

Sonal Khunt
- 1,876
- 12
- 20
0
Try to open the PHP code as an HTML file locally using your web browser and see if it displays properly. If it does not, manually change the encoding setting of the web browser to UTF-8. If it still doesn't display properly, the file itself is probably corrupted. If it does display properly locally, but not from a remote browser when using the web server, then the web server probably needs some configuration changes. (Ensure that if it is sending an encoding in the HTTP header that it is the correct one, etc.).

Noah
- 998
- 1
- 12
- 22