---
title: "DOCTYPE - validering - Character"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/127188-doctype-validering-character"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "Sjodahl"
published: "2005-04-27T06:19:24.000Z"
updated: "2005-04-27T07:34:43.000Z"
replies: 4
views: 319
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/html-css/127188-doctype-validering-character"
---

# DOCTYPE - validering - Character

## #1 — Sjodahl, 2005-04-27T06:19Z

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

```php
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 

```php
 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:

```php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
```

Permalänk: https://www.webforum.nu/p/127188

## #2 — Web-Tor, 2005-04-27T06:21Z

Hjälper detta?
<http://www.webforum.nu/showthread.php?s=&postid=577038#post577038>

Permalänk: https://www.webforum.nu/p/1600135

## #3 — Sjodahl, 2005-04-27T06:24Z

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" /\>

Permalänk: https://www.webforum.nu/p/1600137

## #4 — zcorpan, 2005-04-27T06:48Z

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
<?php
 header('Content-Type: text/html; charset=iso-8859-1');
?>
```

Permalänk: https://www.webforum.nu/p/1600144

## #5 — Sjodahl, 2005-04-27T07:34Z

Valde följande rad i apache:

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

 

Tack för alla svar! :birp

Permalänk: https://www.webforum.nu/p/1600170

---

Tråden på webben: https://www.webforum.nu/amne/html-css/127188-doctype-validering-character
