|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 22:00:02 2025 UTC |
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>