Forum Moderators: coopster

Message Too Old, No Replies

same doctype, declaration different output

html chars not shown correctly

         

abushahin

12:06 am on Jul 2, 2012 (gmt 0)

10+ Year Member



Hi
I have this ' in my database so when it is output by html it should show '

which it does with this:

<!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>
<title>new title</title>
<meta name="Author" content="blah@example.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-language" content="en-gb"/>


But i have this in my index which is the same:

<!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" lang="en" xml:lang="en" >
<head>
<title>new title</title>
<meta name="Author" content="blah@example.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-language" content="en-gb"/>



but it isn't rendering correctly, any ideas/suggestions much appreciated.

lucy24

4:54 am on Jul 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The second version has two language declarations, "en" and "en-gb", in two different places.

Crystal ball is in the shop, so can you be a little more specific about what "isn't rendering correctly" means? Blank space, printed as-is, wrong kind of apostrophe, something else that I haven't thought of?

g1smd

6:43 am on Jul 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you run the code through the W3C HTML validator?
Fixing any reported errors there has to be the fist step.

abushahin

6:12 pm on Jul 2, 2012 (gmt 0)

10+ Year Member



Thanks for the replies!
yes it has been checked through w3c validator and it's fine, as for what it renders, this is what it being output â€
but the other pages it's fine

lucy24

12:11 am on Jul 3, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



†?

That has got to be an encoding problem. The leading â is something you see very often when a unicode character from the E2 range (three bytes) is reinterpreted as Latin1 (three characters, beginning with E2 which is â).

If your plain apostrophe is getting re-cast as a curly apostrophe, that's E28098 or E28099. Now, the 8x and 9x series aren't used in Latin-1, but they are permitted in Windows-Latin-1. And in Windows-Latin-1, 80 is

:: drumroll ::



I'd be happier if it were followed by ˜or ™ (tilde or "trademark" sign) which are 98 and 99 in Windows-Latin-1, but, oh well.

abushahin

2:43 pm on Jul 4, 2012 (gmt 0)

10+ Year Member



Thank you for the answers, I guessed it was an enconding problem.