I have a small C # console program that outputs some text using Console.WriteLine. Then I pass this output to a text file, for example:
c:myprogram > textfile.txt
However, the file is always ansi text file, even when I run cmd with the / u switch. cmd /? talks about the / u switch:
/ U Invokes the output of internal commands for a channel or file for Unicode
And it really matters when I do
c:echo "foo" > text.txt
text.txt is unicode (no specification)
I wonder why the output of my console program line to a new file does not create a unicode file in the same way and how can I change this?
I just use Windows Power Shell (which creates the unicode file with the correct specification), but I still would like to know how to do this with cmd.
Thanks!
cmd text pipe unicode
Ben schwehn
source share