Re: Re: require() causing strange characters ?
| From: | Ashley Sheridan | Date: | Tue, 10 Feb 2009 19:57:58 +0000 |
| Subject: | Re: Re: require() causing strange characters ? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-288082@lists.php.net to get a copy of this message | ||
On Tue, 2009-02-10 at 12:36 +0100, Nisse Engström wrote:
> 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
>
I know this might be going slightly off topic, but just wanted to
suggest Notepad++ as an alternative text editor. I use it when I work on
Windows systems, and it's been a great boon, adding some of those nice
features as well as supporting utf-8, etc.
Ash
www.ashleysheridan.co.uk