Please confirm: output control and unicode encoded files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
donandre
Forum Newbie
Posts: 2
Joined: Thu Dec 11, 2003 5:17 am

Please confirm: output control and unicode encoded files

Post by donandre »

Hi!

I have experienced that php does not properly handle unicode encoded files. When I write a php script with some unicode characters and save it in unicode mode then apparently there are some characters preceding the content of the files (probably to inform that this file is unicode encoded). Php however interprets this characters as output and sends them to the browser.

So if you have:

Code: Select all

<?php
setcookie("somecookie",1,time()+10000,"/",$_SERVER["SERVER_NAME"],0);

if ($_COOKIE["somecookie"])
  echo "success";
else
  echo "failure";
?>
and you save that unicode encoded then setcookie will not work and you'll always get a warning that headers already been sent and failure is always printed out.

I only have php 4.2 or so, can someone confirm this behaviour is still there in the newest version of php?

Because Id like to file a bug report. Or if someone else wants to do, please feel free.... just do a notice here.

Don
donandre
Forum Newbie
Posts: 2
Joined: Thu Dec 11, 2003 5:17 am

Post by donandre »

hmm okay I tested it myself (installing php4.3 on windows *sweat*),

Conclusion: 4.3 doesnt seem to show this behaviour
Post Reply