I have a strangeness problem. In Windows7 operation system,I try to run the command in powershell.
ruby -E UTF-8 -e "puts 'どうぞよろしくお願いします,Mr Jason'" > test.txt
When I read test.txt file:
ruby -E UTF-8 -e "puts gets" < test.txt
the result is:
�i0F0^0�0�0W0O0J0X�D0W0~0Y0,Mr Jason
I check test.txt file,find the file type encoding is Unicode,not UTF-8.
What should I do ?
How should I ensure the encoding of the output file type after redirection? Please help me.