...

View Full Version : Apostrophes appear as squares in html



waq963
05-28-2009, 12:06 PM
Hi, I am coding an XHTML 1.0 transitional page and have a <p> tag with some text that includes apostrophes and a degrees celcius. When i preview them in IE or firefox the apostrophes and the degrees celcius do not appear as they should. Any ideas? thanks.

VIPStephan
05-28-2009, 12:17 PM
Do you mind showing us your code please?

Sounds like a character encoding issue. You should always use UTF 8 encoding (specified in the resective meta element). If you wanna be 100% sure then use HTML entities (http://www.w3schools.com/tags/ref_entities.asp) such as &deg; for the degree sign.

And please don’t use a transitional doctype. The only thing you should use is strict.

frankle
05-28-2009, 12:17 PM
Hi, I am coding an XHTML 1.0 transitional page and have a <p> tag with some text that includes apostrophes and a degrees celcius. When i preview them in IE or firefox the apostrophes and the degrees celcius do not appear as they should. Any ideas? thanks.


Please paste your code here.

Regards.

waq963
05-28-2009, 12:27 PM
Here is my code, i have put in some dummy code in the <p> tag because it was quite long. By the way I am using Notepad++.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction</title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>

<body>
<h4>Introduction</h4>
<p>
My name is 'John' my temperature is 36C
</p>
</body>
</html>

frankle
05-28-2009, 12:38 PM
Here is my code, i have put in sum dummy code in the <p> tag because it was quite long. By the way I am using Notepad++.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction</title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>

<body>
<h4>Introduction</h4>
<p>
My name is 'John' my temperature is 36C
</p>
</body>
</html>



Try using "&deg;" without the double quotes for degree and " ' " without the double quotes for apostrophe.





Regards,

waq963
05-28-2009, 12:44 PM
Thanks that worked fine. What can i do about the apostrophes not showing?

frankle
05-28-2009, 12:48 PM
Thanks that worked fine. What can i do about the apostrophes not showing?


Here it is:


&acute; =


Regards,

abduraooft
05-28-2009, 12:54 PM
I think I have another solution :)
Just change the encoding type of your file to utf-8 (in notepad => Choose "Save As" option and change; in notepad++ => Change from the format menu) and then after you could display any utf characters typed in your file as such in your browser.

waq963
05-28-2009, 01:00 PM
Thanks guys, it works now.

VIPStephan
05-28-2009, 02:57 PM
Here it is:


&acute; =


Regards,

This is not an apostrophe (http://en.wikipedia.org/wiki/Apostrophe), its an accent (http://en.wikipedia.org/wiki/Acute_accent).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum