Reply to post: Re: Code Review

This is why copy'n'paste should be banned from developers' IDEs

Robert Carnegie Silver badge

Re: Code Review

I got caught out by reading something on a support blog.

"Why does powershell 4 automatically convert my UTF-8 text to Unicode?"

That was what actually I wanted it to do.

But it doesn't. It just treats it as ASCII or ANSI or something.

Powershell 5 does allow e.g.

powershell -version 5.0 -command "&{gc -encoding utf8 euro-utf.txt | sc -encoding unicode euro-ucs.txt}"

I am going to need a little more than that though. Specifically, arbitrary input file name, e.g. to be dropped onto the CMD file. I can have four of those, because I want four output files.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019