Welcome to WebmasterWorld Guest from 107.21.149.142

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

same doctype, declaration different output

html chars not shown correctly

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

Junior Member

5+ Year Member

joined:Nov 20, 2009
posts: 98
votes: 0


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.
4:54 am on July 2, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13218
votes: 348


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?
6:43 am on July 2, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Have you run the code through the W3C HTML validator?
Fixing any reported errors there has to be the fist step.
6:12 pm on July 2, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 20, 2009
posts: 98
votes: 0


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
12:11 am on July 3, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13218
votes: 348


?

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.
2:43 pm on July 4, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 20, 2009
posts: 98
votes: 0


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