webForumDet fria alternativet

DOCTYPE - validering - Character

4 svar · 317 visningar · startad av Sjodahl

SjodahlMedlem sedan maj 20033 218 inlägg
#1

Försöker att validera min sida via http://validator.w3.org men får följande fel:

No Character Encoding Found! Falling back to UTF-8.

 I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

och

 Sorry, I am unable to validate this document because on lines 6-7, 43, 69, 74-75  it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.

Överst i min index fil har jag följande:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
Web-TorMedlem sedan nov. 200013 890 inlägg
SjodahlMedlem sedan maj 20033 218 inlägg
#3

Japp det gjorde susen (hmm var väl lite för dålig med sökknappen) tackar!

La till följande rad i min indexfil:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

zcorpanMedlem sedan dec. 20042 245 inlägg
#4

Det kan vara en bra idé att sätta charset-parametern med HTTP också/istället.

Content-Type: text/html; charset=iso-8859-1

Det kan du göra med .htaccess om du använder Apache, eller med en PHP-funktion om du använder det.

.htaccess:

AddType: text/html;charset=iso-8859-1 htm html

eller

AddCharset iso-8859-1 htm html

eller

AddDefaultCharset iso-8859-1

PHP:

<?php
 header('Content-Type: text/html; charset=iso-8859-1');
?>
SjodahlMedlem sedan maj 20033 218 inlägg
#5

Valde följande rad i apache:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Tack för alla svar! :birp

121 ms totalt · 3 externa anrop · v20260731065814-full.3ab8d573
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
118 ms — hämta tråd, inlägg och bilagor (db)