New
#11
Ohh, yess, I used Command Promt instead of Powershell!
However, at the same 1st code of step 3, I get now:
"
At line:1 char:17
+ $env:USERPROFILE\Desktop\CheckFileEncoding.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '\Desktop\CheckFileEncoding.ps1' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
"
I can't get it to work. It seems that it could work on the files, that were created and saved in ANSI using the non-English system locale without warning. So the text was saved properly and is just unreadable in the English locale. However I created and saved the document in the English system locale, didn't pay attention to the warning and probably this was the moment when the text was lost. I was able to run the script, but the converted file still shows "?" marks for me.
Hi and welcome to TenForums!
Since the post was created, notepad has changed its default encoding from ANSI to UTF8 with BOM, when saving documents, in Windows 10.
The ANSI encoding was the one creating issues to the non-English locales, since it could not recognize the characters above 255. Nowadays shouldn't be any problem. And especially to English locales!
Would it be possible to post the exact steps you took, so I can reproduce the problem you're facing?
For all people that this solution does not work (like me), the easy manual per file solution, is to open the older ANSI text with the free Notepad++ editor, change the coding to UTF or UTF with BOM and save it. Voila!
At line:1 char:17
+ $env:USERPROFILE\Desktop\CheckFileEncoding.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '\Desktop\CheckFileEncoding.ps1' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken