UTF-8 and session problem.
Moderator: General Moderators
UTF-8 and session problem.
Hi guys;
I'm sure that there are many who were faced the problem that i m gonna specify.
I'm using Dreamweaver as my PHP editor. Until now, I haven't use the UTF-8 encoding. But now I'm working on a project that is in my native language. And since I want to display some special characters I changed the encoding type of some of my files from win-1254 to utf-8.
But then i got the following error :
Warning: Cannot send session cache limiter - headers already sent (output started at c:\apache\htdocs\adven\cadmin\cadmin_main.php:1) in session.php on line 2
When i open the file in Homesite, or phpEdit I just find a special hidden character at the beginning of the file, the character is .
I have no information about these set of chars but when i deleted these and save the file, the "headers sent" error was gone. However the characters like "çşğöı" are gone, too.
I think this is very interesting and caused me more than 6 hours. Do you know anything about what happened to me? Any help would be great.
Good Luck..
I'm sure that there are many who were faced the problem that i m gonna specify.
I'm using Dreamweaver as my PHP editor. Until now, I haven't use the UTF-8 encoding. But now I'm working on a project that is in my native language. And since I want to display some special characters I changed the encoding type of some of my files from win-1254 to utf-8.
But then i got the following error :
Warning: Cannot send session cache limiter - headers already sent (output started at c:\apache\htdocs\adven\cadmin\cadmin_main.php:1) in session.php on line 2
When i open the file in Homesite, or phpEdit I just find a special hidden character at the beginning of the file, the character is .
I have no information about these set of chars but when i deleted these and save the file, the "headers sent" error was gone. However the characters like "çşğöı" are gone, too.
I think this is very interesting and caused me more than 6 hours. Do you know anything about what happened to me? Any help would be great.
Good Luck..
feyd probably you did not understand my problem.
here is the session.php
How can i send anything on line 1 
The character is hidden, it doesn't shown using Dreamweaver.
I edit the file using vi after I upload it to server.
vi displays the hidden characters.
The problem is not about session.
It stems from some hidden characters.
When I delete these hidden chars, then any browser is unable to select UTF-8 encoding even if I placed following line in my HTML.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
here is the session.php
Code: Select all
<?php
session_start();
?>The character is hidden, it doesn't shown using Dreamweaver.
I edit the file using vi after I upload it to server.
vi displays the hidden characters.
The problem is not about session.
It stems from some hidden characters.
When I delete these hidden chars, then any browser is unable to select UTF-8 encoding even if I placed following line in my HTML.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
i'm sure you didn't understand the problem. 
the "" are the hidden characters.
they are invisible if your using dreamweaver.
i saw them when i tried to edit the file in my linux server.
Any windows editor except homesite are not able to display this chars.
I thing they are some kind of flags that tells the operating system, the file is UTF-8 encoded.
thnx.
the "" are the hidden characters.
they are invisible if your using dreamweaver.
i saw them when i tried to edit the file in my linux server.
Any windows editor except homesite are not able to display this chars.
I thing they are some kind of flags that tells the operating system, the file is UTF-8 encoded.
thnx.
i did this before, and surprisingly some characters are changed.
by the way, if I upload this file to another server, server displayed characters(şöçğ) very well.
i know it is strange but this is the way it is
one of friends told me he had same problem once, and he thinks
converting win1252 file to utf8 in dreamweaver causes this problem.
now, when your last suggestion is applied the situation is that,
since the chars are removed the session error is solved,
however, any browser(I tried 5 of them) tries to set the encoding to the default encoding (although the file has
header('Content-type: text/html; charset=UTF-8') ; line.).
thnx.
by the way, if I upload this file to another server, server displayed characters(şöçğ) very well.
i know it is strange but this is the way it is
one of friends told me he had same problem once, and he thinks
converting win1252 file to utf8 in dreamweaver causes this problem.
now, when your last suggestion is applied the situation is that,
since the chars are removed the session error is solved,
however, any browser(I tried 5 of them) tries to set the encoding to the default encoding (although the file has
header('Content-type: text/html; charset=UTF-8') ; line.).
thnx.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you may need to set the DTD too.. Here's specific info on the character set UTF-8
Code: Select all
Name: UTF-8 їRFC3629]
MIBenum: 106
Source: RFC 3629
Alias: None