Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do symbols like apostrophes and hyphens get replaced with black diamonds on my website?

A website I've made has a few problems... On one of the pages, wherever there's an apostrophe (') or a dash (-), the symbol gets replaced with a weird black diamond with a question mark in the center of it

Here's what I mean
screen

It seems this is happening all over the site wherever these symbols appear. I've never seen this before, can anyone explain it to me?

Suggestions on how to fix it would also be greatly appreciated.

See http://test.rfinvestments.co.za/index.php?c=team for a clear look at the problem.

like image 276
Ortund Avatar asked Nov 03 '10 11:11

Ortund


People also ask

Why do my apostrophe turn into question marks?

Question marks usually appear in a message's text if your e-mail program does not know how to display the actual typographical character used by the sender. Certain types of quotation marks, apostrophes and foreign accents are typically the characters that may be rendered incorrectly.

What is &# 39 HTML?

&#39 is the HTML entity code for the apostrophe. It simply means it had an issue decoding the special characters for correct display. https://www.w3schools.com/html/html_entities.asp.


1 Answers

It's an encoding problem. You have to set the correct encoding in the HTML head via meta tag:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 

Replace "ISO-8859-1" with whatever your encoding is (e.g. 'UTF-8'). You must find out what encoding your HTML files are. If you're on an Unix system, just type file file.html and it should show you the encoding. If this is not possible, you should be able to find out somewhere what encoding your editor produces.

like image 140
joni Avatar answered Oct 31 '22 18:10

joni