Re: Re: require() causing strange characters ?

From: Date: Tue, 10 Feb 2009 11:36:13 +0000
Subject: Re: Re: require() causing strange characters ?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-288056@lists.php.net to get a copy of this message
On Mon, 9 Feb 2009 15:46:35 +0100, cr.vegelin@gmail.com wrote: > I've tested it again, from scratch with Notepad editor: > > echoUTF8.php <?php require("echoUTF8sub.php"); ?> > echoUTF8sub.php <?php echo "test"; ?> > and keep getting strange characters. > > Would you be so kind to run these 2 scripts on your pc ? Works fine for me, probably because my copy of Notepad is so old it has never heard of Unicode... Here's another test: echoUTF8.php: ------------- <?php require 'echoUTF8sub.php'; echoUTF8sub.php: ---------------- <?php echo "\xef\xbb\xbf", "test\n"; // Manual BOM When I run this from a browser, I get different output depend on the server's and browser's default charset, and PHP's "default_charset" setting. I get consistent results when I add header ('Content-Type: text/plain; charset=utf-8'); to echoUTF8.php. (When the scripts are run from command-line, the output would also depend on the shells ability to handle utf-8.) /Nisse

« previous php.general (#288056) next »