0

The warning is: "Trying to compare files with different encodings - the result might be inaccurate and misleading. Compare anyway?"

The two files I'm comparing have been outputted from the same script. The output from the script is via

# Write to file
($street | Out-String).Trim() | Add-Content -Path $filesPathAdminElectorateStreets -Encoding UTF8

The only difference is the filename e.g file.txt & file1.txt Functionality is normal from this point on.

Why am I receiving this message? Can you suggest a fix or workaround?

1 Answer 1

0

The issue is the Powershell version being used by my Visual Studio Code IDE. My VS Code was running an old version of PS (5.1) I was switching to the latest (7.4.4) manually in VS Code. This was the trap I set myself. I overlooked the fact that I had been doing this when I saved different versions of the same text file. The encodings were different for these two files because each was saved with a different version of PS.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.