Newbie : Charset with W3C HTML validator

P

Paul Blay

I got this message

Note: The HTTP Content-Type header sent by your web browser (unknown) did not contain a "charset" parameter,
but the Content-Type was one of the XML text/* sub-types (text/xml). The relevant specification (RFC 3023)
specifies a strong default of "us-ascii" for such documents so we will use this value regardless of any encoding you
may have indicated elsewhere. If you would like to use a different encoding, you should arrange to have your
browser send this new encoding information.

What do I need to fix that? I have

<?xml version="1.0" encoding="Shift_JIS" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja"> <head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=shift_jis" />

at the start of the page.

(P.S. Yes, I probably do have no idea what I'm doing )
 
B

brucie

Note: The HTTP Content-Type header sent by your web browser (unknown)
did not contain a "charset" parameter, What do I need to fix that?

configure your server to send the correct charset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML

is there any reason for using XHTML?

please adjust your word wrap to something around 75 characters.
 
J

Jukka K. Korpela

brucie said:
configure your server to send the correct charset

Well, the complaint refers to a _browser_, which is somewhat odd, but
maybe the OP used a file submit feature to send a document for
validation. So apparently the only thing, apart from using a browser
that implements file submission better (and somehow manages to send the
Content-Type header needed), is to use the validator's interface for
setting the "charset".

At http://validator.w3.org/file-upload.html there's a pulldown menu
labelled "Encoding". And luckily shift_jis (which the OP's document
uses) is listed there as an alternative.
 
A

Andreas Prilop

Paul Blay said:
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=shift_jis" />

This is nonsense since it comes too late. If you are using XHTML 1.1,
you need to specify the Content-Type in the HTTP header.

Please restrict your line length to about 70 characters!
 
T

Toby A Inkster

Andreas said:
This is nonsense since it comes too late. If you are using XHTML 1.1,
you need to specify the Content-Type in the HTTP header.

Or use one of the character sets that all XML processors are *required* to
understand (utf-8, utf-16 and proper subsets of them, such as us-ascii)
and almost guaranteed to recognise without a declaration of any kind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top