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