Sunday, January 4, 2015

Capture standard output of another command-line program, with characters not in current codepage

I tried similar thing, not programmatically, but directly in Windows command prompt, using varios combination of /u, /c, chcp 65001. In all cases I use " > file.txt" at the end of the command line, and they all showed the same result: special characters were stripped away. It seems that this is what the behavior of Windows just is.


Fortunately I found that the program I'm dealing with, which is youtube-dl as I said, also offers to output information in non-ascii-characters-escaped JSON format.


No comments:

Post a Comment