utf8 in a class
Posted: Thu Sep 03, 2009 3:23 am
I have created a class which is a web page temlate.
All the files are utf-8 encoded.
When I run the page it writes a unseen question mark at the very beggining of the page.
Headers does not help.
What I have to do to remove that question mark?
Here is the main page:
And here is the class:
The output in Firefox source view is:
In the Notepad++ is (copied from Firefox):
It is a problem while rendering the page (CSS).
All the files are utf-8 encoded.
When I run the page it writes a unseen question mark at the very beggining of the page.
Headers does not help.
What I have to do to remove that question mark?
Here is the main page:
Code: Select all
<?php
header ('Content-type: text/html; charset=utf-8');
require ('template.php');
$homepage = new Page();
$homepage -> title="dsf";
$homepage -> keywords="dsf";
$homepage -> description="dsf";
$homepage -> content="dsf";
$homepage ->Display();
?>Code: Select all
<?php
class Page
{
public $title;
public $keywords;
public $description;
public $content;
public $top_menu = array(bla bla bla);
public $left_menu = array(bla bla bla);
public function Display()
{
$this -> DisplayTypes();
$this -> DisplayDescription();
$this -> DisplayKeywords();
//bla bla bla
$this -> DisplayFooter();
}
public function DisplayTypes()
{
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://bla bla blaCode: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang bla bla blaCode: Select all
?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang bla bla bla