0

Usually this txt shows the logs of my program running. Nothing was changed and it started now spitting out null characters.

Not really sure what to do. Is this any unicode issue? The code does not have any known errors as terminal shows it running and stopping properly. Just the log report is being weird

3
  • That does in fact seems to be an encoding problem. Did you open the file with another program? If so, you might have saved it and it changed the encoding. Same thing happens if you do not specify the same enconding when moving between Powershell 5.1 and 7.x Commented Jul 12, 2024 at 14:52
  • @sirtao yup that was the issue, thank you Commented Jul 12, 2024 at 14:57
  • Usually with >> or out-file -append, two different encodings are in the same file. utf16 has twice as many nulls. Or some windows utilities make a utf16 file without a bom. Commented Jul 12, 2024 at 15:23

1 Answer 1

0

Figured it out, used notepad to check encoding and the text file was in wrong format (UTF 8). Changed it to UCS 2 LE BOM

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.