Old 10-01-2008, 22:09   #1 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,563
xhtml strict and CHARSET

I am coding my page in xhtml strict. When validating it, I got an error, as I had included a charset. Is there another way to refer to the charset with xhtml strict? Here is the code I am using:

Code:
<?xml version="1.0" encoding="Shift_JIS" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html" charset="Shift_JIS" />

The problem is in the last line int he meta tag where I have included the charset. Should I just leave this out?

note: I am programming a Japanese site which is why the charset is set to shift_jis. That's not an error.
  Reply With Quote
Old 11-01-2008, 01:39   #2 (permalink)
iblastoff
gotsa a malanga!
 
iblastoff's Avatar
 
Join Date: Apr 2006
Location: ottawa, canada
Posts: 489
you are doing it wrong.

it should be this:

Code:
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" />
__________________
  Reply With Quote
Old 11-01-2008, 02:08   #3 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,563
I actually did that, but it didn't like it. I cut the charset out of it altogether, and it worked?! Apparently you can't use a charset with the strict doctype.
  Reply With Quote
Old 11-01-2008, 02:23   #4 (permalink)
Blue Ire
Magic Pan
 
Blue Ire's Avatar
 
Join Date: Sep 2006
Posts: 66
Don't be absurd, of course you can.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> for example.
  Reply With Quote
Old 11-01-2008, 02:53   #5 (permalink)
iblastoff
gotsa a malanga!
 
iblastoff's Avatar
 
Join Date: Apr 2006
Location: ottawa, canada
Posts: 489
Quote:
Originally Posted by haku
I actually did that, but it didn't like it. I cut the charset out of it altogether, and it worked?! Apparently you can't use a charset with the strict doctype.

must be a typo somewhere then. copy and paste exactly what i had into your document then validate. it should go through (i tested it already). you most definitely can use a charset with xhtml strict. would be silly if you couldn't.
__________________
  Reply With Quote
Old 11-01-2008, 04:17   #6 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,563
You're right, I must have had a typo in there somewhere cause it works fine now.

My bad guys! Thanks for the help!
  Reply With Quote
Old 14-01-2008, 14:05   #7 (permalink)
longisland6
stephen eighmey
 
Join Date: Oct 2006
Location: earth
Posts: 152
don't forget about the mime type along with the character set... since you're validating as xhtml strict you'll probably want to serve your pages with the correct mime type, which, if the browser supports it, is application/xhtml+xml. you can do this very nicely if you have dynamic scripting capability.
  Reply With Quote
Old 14-01-2008, 18:45   #8 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,563
I read a big long thing recently about setting the mime-type to application/xhtml+xml, and the verdict was that its not worth it.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8