gameboyz Posted July 11, 2009 Share Posted July 11, 2009 Hi I'm making a website for fun using PHP, but have some little questions which I'm not too sure about even after Googling.1) For the <html> tag what's the difference between the lang attribute and the xml:lang one?2) For the <meta> tag, what should I put in for the attribute "content"? I am guessing the front part is text/html, but what about charset? And is it necessary to put meta tags declaring your charset, encoding, etc? Link to comment Share on other sites More sharing options...
gameboyz Posted July 11, 2009 Author Share Posted July 11, 2009 Bump Link to comment Share on other sites More sharing options...
Ingolme Posted July 11, 2009 Share Posted July 11, 2009 Well, there's not much of a difference between lang and xml:lang except that one of them is an HTML standard and the other one is an XML standard.It's not really necessary to put <meta> tags in your document, you can send headers through other means, for example by setting it in a .htaccess file or by sending headers in PHP.To declare a character set in your document you can use either of the following: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8" /> The first is for HTML, the second is for XHTML. But they're not really necessary, since UTF-8 is the default character set. If you want another character set, such as ISO-8859-1, then specify it in the <meta> element. Link to comment Share on other sites More sharing options...
gameboyz Posted July 12, 2009 Author Share Posted July 12, 2009 Well, there's not much of a difference between lang and xml:lang except that one of them is an HTML standard and the other one is an XML standard.It's not really necessary to put <meta> tags in your document, you can send headers through other means, for example by setting it in a .htaccess file or by sending headers in PHP.To declare a character set in your document you can use either of the following:<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8" /> The first is for HTML, the second is for XHTML. But they're not really necessary, since UTF-8 is the default character set. If you want another character set, such as ISO-8859-1, then specify it in the <meta> element. Thanks! But how do I check my character set? Link to comment Share on other sites More sharing options...
Ingolme Posted July 12, 2009 Share Posted July 12, 2009 If you're using Firefox, you can see the character set that's being used on a site by opening the Tools menu and clicking on "Page information".About character sets, UTF-8 accepts the original ASCII character set, and any other character has to be encoded to UTF-8 to be visible on the page (a UTF8 character can look something like this: Åè)If you want general European characters such as é, ô, and à, you can use ISO-8859-1 and you won't have to do any encoding. Whichever encoding you use, you can use HTML entities to write character in any character set. Link to comment Share on other sites More sharing options...
gameboyz Posted July 12, 2009 Author Share Posted July 12, 2009 If you're using Firefox, you can see the character set that's being used on a site by opening the Tools menu and clicking on "Page information".About character sets, UTF-8 accepts the original ASCII character set, and any other character has to be encoded to UTF-8 to be visible on the page (a UTF8 character can look something like this: Åè)If you want general European characters such as é, ô, and à, you can use ISO-8859-1 and you won't have to do any encoding. Whichever encoding you use, you can use HTML entities to write character in any character set.Weird.. Firefox reports UTF-8 but I saved the .php file with ASCI (at least that's what notepad++ states at the bottom right corner ) Link to comment Share on other sites More sharing options...
Ingolme Posted July 12, 2009 Share Posted July 12, 2009 Weird.. Firefox reports UTF-8 but I saved the .php file with ASCI (at least that's what notepad++ states at the bottom right corner )The file is saved in ANSI format. UTF-8 is the encoding that the browser uses on the parsed HTML. Link to comment Share on other sites More sharing options...
gameboyz Posted July 13, 2009 Author Share Posted July 13, 2009 The file is saved in ANSI format. UTF-8 is the encoding that the browser uses on the parsed HTML.So the encoding that Notepad++ uses and the one that the browser uses to read the HTML is two separate things? Link to comment Share on other sites More sharing options...
Ingolme Posted July 13, 2009 Share Posted July 13, 2009 So the encoding that Notepad++ uses and the one that the browser uses to read the HTML is two separate things?ANSI is the encoding of the file itself. UTF-8 is the encoding that the browser is using when parsing the information sent by the server. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.