What is the correct encoding for PS1 files

Question:

I am doing some text stream processing on a series of PS1 & PSM1 files, and I ran into some issues with smart quotes and em-dashes (never, NEVER, cut and paste code from MS Scripting Guy blog). I figured the issue was encoding so I looked, and I have files of both ASCII & UTF8, but of course both have issues with my funky text. So I have done some replacements, and I have that working, but I wonder if I shouldn’t also standardize on one encoding, and if so, which one?

Answer:

Not a direct answer to your question but you may find it useful nonetheless, I have a tool I wrote to handle PS and SQL scripts but quickly found people were pasting from their emails which screwed a ton of stuff. I had to implement this to correct it all, and it should get everything:

Source:

What is the correct encoding for PS1 files by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply