Swedish characters and UTF-8

I use UTF-8 on all my pages, but some Swedish characters (å ä and ö) get messed up (just a square box with some letters in). My database is set to utf8_general_ci, but I'm not even connected so that doesn't really matter. Or should I use another charset? It's not a Swedish site, it's all in English but I want å ä and ö to work anyway.

<!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>
  <title>Untitled document</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="default.css" />
</head>
<body>
  <p>åäö</p>
</body>
</html>

What's the problem? :/

I use WAMP by the way.


Solution 1:

I know this is old, but I came across the same problem.

I just needed to set the correct charset:

<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1" />

Solution 2:

I think it is important that your file is encoded in the same way that of which you set your charset in the meta tag. When they differ I think there are problems. So you need to know what your file is encoded to!

If file is encoded utf-8 then use:

<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>

If yout file is encoded with ISO-8859 then use:

<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1"/>

When I keept them both the same, the encoding of file and charset in meta-tag it worked. Good luck!