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 =)

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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  ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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