I tried similar thing, not programmatically, but directly in Windows command prompt, using varios combination of /u, /c, chcp 65001. In all cases I end the command with " > file.txt", and they all showed the same result: special characters were stripped away. It seems that this is what the behavior of Windows just is. As long as redirect is involved, characters not in the default codepage get stripped out.
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