session_start() and UTF-8 characters error
Posted: Mon Jun 16, 2003 1:39 pm
Situation: I am trying to display Japanese characters in my PHP site. I set up a test case where I first do a session_start(), then echo out some Japanese characters. I save the file as UTF-8.
The code looks like:
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
echo "Home:ホーム<br>";
?>
</body>
</html>
When bringing up this page I get the error:
Warning: Cannot send session cookie - headers already sent by (output started at /var/www/html/fbx_SettingsUTF8.php:5) in /var/www/html/fbx_SettingsUTF8.php on line 6
Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/html/fbx_SettingsUTF8.php:5) in /var/www/html/fbx_SettingsUTF8.php on line 6
When I save the file as ANSI I do not get the error, but then the Japanese characters do not display correctly.
Does anybody know a resolution for this? The session_start() is causing the problem?
Thanks
Dennis
dennis_e_browne aatt hotmail ddott com
The code looks like:
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
echo "Home:ホーム<br>";
?>
</body>
</html>
When bringing up this page I get the error:
Warning: Cannot send session cookie - headers already sent by (output started at /var/www/html/fbx_SettingsUTF8.php:5) in /var/www/html/fbx_SettingsUTF8.php on line 6
Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/html/fbx_SettingsUTF8.php:5) in /var/www/html/fbx_SettingsUTF8.php on line 6
When I save the file as ANSI I do not get the error, but then the Japanese characters do not display correctly.
Does anybody know a resolution for this? The session_start() is causing the problem?
Thanks
Dennis
dennis_e_browne aatt hotmail ddott com