Website Includes with Foreign language

I am having trouble having translated a website into Swedish getting it to format correctly.

The majority of the site is fine, it’s just when I have includes file in the pages anything in the includes file that uses a special character doesn’t work and I get the diamond with a question mark and just a white empty box on ie.

How can I fix this issue without having to lose the includes files? Because the same text in the actual page will work fine so it has to be an issue with the includes, none of the includes have a doctype but all the actual pages use the following doctype

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

You also need to give the character set the document is saved in (check the save settings in your editor). I think you could try the iso-8859-1, or -15 for adding the Euro sign, if you are not sure what you have.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="sv">
<head>
	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
	<title>Untitled Document</title>

Then I recommend the read of this thread about html/xhtml and doctypes.

You’ll have a mismatch of encoding and it is likely the includes are set to a default of ISO-8859-1. Do you have a live page at the moment.

You’ll be probably seeing ‘replacement character’ � (often a black diamond with a white question mark) a symbol found in the Unicode standard at codepoint U+FFFD in the Specials table.

I don’t know what include files you use and if that includes data from a database. But I normally have to set a utf-8 connection string.

The includes are just bog standard php includes with html in there. The test site is available at the following address

www. benzlers.com /se-test/ industrier.php

the includes is on the right hand side and is the black diamond error message.

You now give two charsets! Only one is permitted.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
-
-<title>Industrier</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

The documents character set statement must correspond with that the document is saved with (more clearly; edited in). Probably your editor is saving in ISO-8859-1, but then the first meta tag says it should be read as UTF-8.

Try remove the first meta tag and move the second up in place. I.e. remove it from the include file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-
<title>Industrier</title>
-

Or you can edit and save in utf-8 if you set your editor accordingly. You can open, then change editor setting for the includes, and re-save them as utf-8. Then keep the utf-8 meta tag as in original document.

Erik J, thank you that solution worked perfectly.