0

I launch a PHP script from Windows command prompt, redirecting the stdout and stderr to two files. If the PHP script outputs accented characters, they will result in strange symbols in the two files mentioned above.

How to set correct chaset output when redirecting output to files?

I launch the script using:

C:\>php myscript.php 2>stderr.log 1>stdout.log
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
Marco Marsala
  • 2,332
  • 5
  • 25
  • 39
  • I think you might find some answers [in this previous question](http://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how). – kuroi neko Jan 13 '14 at 07:39
  • How exactly are you viewing these files? Maybe only the program that's *reading* the file is getting it wrong? – deceze Jan 13 '14 at 08:30
  • no I'm using Notepad++ and I usually read UTF-8 files properly – Marco Marsala Jan 13 '14 at 09:23
  • I already say the thread but it doesn't work when redirecting output. Also I'm experiencing exactly the same problem on Linux – Marco Marsala Jan 13 '14 at 09:24

0 Answers0