Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29999 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22307 invoked by uid 1010); 31 May 2007 13:18:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22292 invoked from network); 31 May 2007 13:18:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2007 13:18:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 129.187.110.13 cause and error) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 129.187.110.13 c013.fhm.vpn.lrz-muenchen.de Received: from [129.187.110.13] ([129.187.110.13:48544] helo=johannes.nop) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/4E-13361-23BCE564 for ; Thu, 31 May 2007 09:18:43 -0400 Received: from johannes.nop (localhost [127.0.0.1]) by johannes.nop (8.13.8/8.13.8) with ESMTP id l4VDIjxu020083; Thu, 31 May 2007 15:18:45 +0200 Received: (from johannes@localhost) by johannes.nop (8.13.8/8.13.8/Submit) id l4VDIist020082; Thu, 31 May 2007 15:18:44 +0200 X-Authentication-Warning: johannes.nop: johannes set sender to johannes@php.net using -f To: Nikhil Gupta Cc: internals@lists.php.net In-Reply-To: <21164.19427.qm@web57408.mail.re1.yahoo.com> References: <21164.19427.qm@web57408.mail.re1.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 31 May 2007 15:18:43 +0200 Message-ID: <1180617523.3330.144.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Subject: Re: [PHP-DEV] fwrite( ) gives Notice with Unicode ON From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, yes, the notice is expected. You either have to cast to a binary string or by setting the stream's encoding using stream_encode() since we can't guess which encoding you're going to use for a stream. johannes On Thu, 2007-05-31 at 05:38 -0700, Nikhil Gupta wrote: > Hi, > I'm writing some PHPT test cases for PHP 6 and wanted to check that I was seeing the correct behaviour with unicode. > I tried the following simple testcase and gets Notice message with php6 unicode ON. > > --TEST-- > test.phpt > --FILE-- > $fh = fopen ("tempfile.tmp", "w" ); > fwrite( $fh, "Sample text" ); > fclose( $fh ); > ?> > --UEXPECT-- > > command: > php run-tests.php -u test.phpt > cat test.u.out > > Following Notice is displayed: > Notice: fwrite(): 11 character unicode buffer downcoded for binary stream runtime_encoding in %s on line %d > > There in no notice message with PHP6 unicode OFF, please would you confirm that the additional notices with Unicode on are intended? I think it will result in a large number of additional Notices if we use fwrite in a for loop. > > Thanks & Regards > Nikhil > > > ____________________________________________________________________________________ > Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7