How to fix strange webpage characters?

When browsing the Internet, you may also notice that some of the letters on a page appear as strange characters or question marks. This error, also called Mojibake, is usually related to a character "encoding" problem and become a reason of unusual characters on your HTML webpages as seen in this example:

 

In the above example, the browser cannot interpret the characters that have been added to the HTML page source code and display them as the boxes and question marks. The issue can be solved by locating the problem code and changing it to standard ASCII characters. If you are unable to fix the pages by editing the characters, use one of the solutions below. 

 

Apostrophe and quotation marks

 

In your page copy, you may be using left and right apostrophe and quotation marks, however in HTML pages you should use the centered apostrophe ' and centered quotation marks " to avoid any browser rendering issues. 

 

Fixing individual characters

 

If there are only a few of these strange characters and do not want to change the doctype as outlined below, you can use HEX code to make them viewable. In this case, you should find the code for each problem character. 

 

Changing HTML page encoding (HTML5)

 

IThis issue can also be related to incorrect database or page encoding. In order to fix this issue, page encoding needs to be changed. Your website should also have UTF-8 meta tag: 

 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

You may also try to add this line at the top of your index.php page:

 

header('Content-Type: text/html; charset=utf-8');

 

Using of "Save as" with different encoding option

 

Open your HTML page in a text editor like Notepad or TextEdit. Choose to save your page using "save as". In the "encoding" options at the bottom, you can save your HTML page as "UTF-8" instead of "ANSI". Check the "meta charset" tag near the top of your HTML page to see what type of encoding the page is using and save as that type.

 

Coupon partner DomainhostCoupon.com