php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38105 Streams encoding doesn't seem to work
Submitted: 2006-07-14 17:05 UTC Modified: 2006-07-14 23:46 UTC
From: andrei@php.net Assigned: pollita (profile)
Status: Closed Package: Unicode Engine related
PHP Version: 6CVS-2006-07-14 (CVS) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andrei@php.net
New email:
PHP Version: OS:

 

 [2006-07-14 17:05 UTC] andrei@php.net
Description:
------------
Streams encodings don't seem to work as advertised.

Reproduce code:
---------------
code
----
file_put_contents('abcdef', 'str.txt', FILE_TEXT);

php.ini
-------
unicode.semantics = on
unicode.output_encoding = utf-8
unicode.runtime_encoding = iso-8859-1
unicode.script_encoding = utf-8
unicode.filesystem_encoding = utf-8


Expected result:
----------------
No stdout output and 6 chars in UTF-8 in str.txt.


Actual result:
--------------
Notice: file_put_contents(): 7 character unicode buffer downcoded for binary stream runtime_encoding in /home/andrei/dev/php-src/q.php on line 3


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-14 20:51 UTC] pollita@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2006-07-14 21:02 UTC] andrei@php.net
More problems:

$str = b"abcdef";
file_put_contents('str.txt', $str);

Result is (escaped):

<E6><89><A1><E6><91><A3><E6><99><A5><E8><90><80><E8><BF><8C><E2><A8><AA>

 [2006-07-14 23:46 UTC] andrei@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 12:01:27 2024 UTC