Why Foreing Characters Not Working Shows Black Diamon �
- Forums
- General Errors
- Why Foreing Characters Not Working Shows Black Diamon �
just wanted to share with you guys what i learned. so if you web pages are showing a little black diamond with a question mark inside, [8638], Last Updated: Sat May 18, 2024
boriz
Wed Dec 31, 1969
0 Comments
132 Visits
hello everyone, i just wanted to tell you that for the last couple of months i have been trying to fix a problem with my website. you see, i have a website like yours that has spanish web pages and sometimes, the users type spanish characters like for example, when they write espanol. in the united states, we dont have keys like for example: Ñ to write espanol. it should be written as español
so when users where leaving comments with foreign characters, it would show a black diamond with a question mark in the browser.
at first, i thought it was my code that was creating all this problems. but after extensive research, i read about encoding. i thought encoding was within the code. you can manipulate the encoding through code in PHP, but that was not my problem.
i was using Dreamweaver CS5 to create my php scripts, and usually i was being lazy to create the php files from Dreamweaver, instead i would just right click on windows explorer and select new text file, then i would just rewrite the file extension from .txt for .php
that was my mistake, for some reason, windows was creating the files with ANSI encoding instead of UTF-8
UTF-8 is what you need for foreign characters like ñ
so what i did to fix my files, i downloaded notepad++ - notepadd++ has an encoding menu where is shows what encoding the files is using. there is also and option to change the encoding. so after i changed the encoding to UTF-8 it worked.
anywayz, just wanted to share with you guys what i learned. so if you web pages are showing a little black diamond with a question mark inside, i hope i was able to help you resolve this issue. as this also works on javascript code.