Jump to content

[SOLVED] @charset "iso-8859-1" gives me two different results


Bisa

Recommended Posts

On my index page I inlcude the css.css-file like this:

<link rel="stylesheet" type="text/css" href="css.css" />

 

later on the index I use the php include to fetch various pages depending on what the user want to brows.

 

if I include "example1.php" which lists a set of products from a database there are no problems at all displaying å, ä and ö correctly in my browser. I am also able to use echo "åäö"; and they are displayed correctly.

 

if I however include "example2.php" which only welcomes the user with a echo "Hello user. This is å, ä and ö"; I cannot see the Swedish characters correctly, they become something like ä...

 

any pointers on this isue ould be greatly appreciated =)

Lets see, the index.php which I include the other files into has a meta that looks like this:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="se">
<!--<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /> -->

 

and the save... I'm not sure how to check this but all files have been saved/created with dreamweaver as either .css or .php

 

 

I commented the meta on purpose since I am including the css.css which starts like this:

@charset "iso-8859-1";

hence I figured I would not need the meta any more.

 

When saving I can choose something called "Unicode Normalization" but no encoding options (or is that an encoding option?)

 

and no, the includes have no meta/head whatever tags, mostly just php stuff and forms/tables

(and yes, the forms/tables use classes from my css.css and it works great with width and bg colours and so on)

@charset "iso-8859-1"; on the css will not effect the charset of your page to my understanding external style sheets run different then php includes//

 

uncomment out your meta you can remove that from your css as well

 

not sure why its in the css  ive never seen that done

Solved, seems you cannot include a file in another file and at the same time have the meta cover that new set of code. What I did can be explained like this:

 

- Index includes example1 which in turn includes content1 or content 2

in this case I would not be able to see "åäö"

 

I then rewrote the code in example1 and put it in the index file instead and now it looks like this:

 

- Index includes content1 or content2

This way the meta "follow" along and hence also the charset, problem solved.

 

Thnx for trying to help me  ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.