Bug #69333 [NEW]: UTF8 output to console window is ... interesting!

From: Date: Mon, 30 Mar 2015 12:54:45 +0000
Subject: Bug #69333 [NEW]: UTF8 output to console window is ... interesting!
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191721@lists.php.net to get a copy of this message
From: RQuadling at GMail dot com Operating system: Windows PHP version: 5.4.39 Package: CGI/CLI related Bug Type: Bug Bug description:UTF8 output to console window is ... interesting! Description: ------------ Attempting to display UTF-8 content in a Windows console (having used chcp 65001 to allow UTF-8 content to be displayed) 2 issues are found. 1 - php -r does not read UTF-8 from the commandline. php -r "echo 'página';" fails with p�gina 2 - echo-ing utf-8 content adds an extra line. Running the script ... <?php echo echo 'página'; outputs página correctly, but with an extra line on the display. But, if you capture the output, there is no extra line, which suggests to me that PHP is calling a function that outputs the extra line in some way. Test script: --------------- This is a batch file that demonstrates that UTF-8 output is possible in some circumstances. https://gist.github.com/RQuadling/068ac672d97e2e3e6cfa Expected result: ---------------- Lots of ... ====== [description] página ==OK== Actual result: -------------- Some ... ====== [description] página ==OK== but also ... ====== Via php -r p�gina =????= **** NON UNICODE DISPLAYED **** ====== Via php -r, captured to a log file and displayed p�gina =????= **** NON UNICODE DISPLAYED **** ====== From a php script página =????= **** EXTRA LINE DISPLAYED **** -- Edit bug report at https://bugs.php.net/bug.php?id=69333&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69333&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69333&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69333&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69333&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69333&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69333&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69333&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69333&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69333&r=support Expected behavior: https://bugs.php.net/fix.php?id=69333&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69333&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69333&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69333&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69333&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69333&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69333&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69333&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69333&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69333&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69333&r=mysqlcfg

« previous php.bugs (#191721) next »