Jeff
Jeff

Reputation: 4423

Powershell '>' operator, change encoding?

Is there a way to change the default encoding of the > operator in powershell? I'd like it to output as ANSI as UTF-8 for my requirements.txt:

pip freeze > requirements.txt

Upvotes: 11

Views: 4147

Answers (1)

sundar nataraj
sundar nataraj

Reputation: 8692

pip freeze | Out-File -Encoding UTF8 requirements.txt

or you can try

pip freeze > iconv -f UTF-8 -t ISO-8859-1 in.txt > out.txt

you can read about iconv

Upvotes: 14

Related Questions