Bisa Posted October 23, 2008 Share Posted October 23, 2008 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 =) Quote Link to comment Share on other sites More sharing options...
effigy Posted October 23, 2008 Share Posted October 23, 2008 What's in your meta tag(s)? Are both files saved as Latin-1? Quote Link to comment Share on other sites More sharing options...
Bisa Posted October 23, 2008 Author Share Posted October 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
effigy Posted October 23, 2008 Share Posted October 23, 2008 Your meta is commented out, so it may be relying on the browser, server, or file. Is there any meta information in the included files? When you save them, are there any encoding options? Quote Link to comment Share on other sites More sharing options...
Bisa Posted October 23, 2008 Author Share Posted October 23, 2008 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) Quote Link to comment Share on other sites More sharing options...
dropfaith Posted October 23, 2008 Share Posted October 23, 2008 @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 Quote Link to comment Share on other sites More sharing options...
Bisa Posted October 23, 2008 Author Share Posted October 23, 2008 uncommented the meta and removed the css line, still I can't get my head around why the echo "åäö"; shows up differently in example1.php and example2.php when they are included to the same index.php Quote Link to comment Share on other sites More sharing options...
Bisa Posted October 23, 2008 Author Share Posted October 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.