Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
838 views
in Technique[技术] by (71.8m points)

encoding - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...