0

The file load error keeps popping up after I added contents to the file by using commands.

I was working on Windows PowerShell on JupyterLab. Firstly, I created a new file using the following command:

New-Item -Path "test.txt"

I managed to open the file and type down a few lines directly into it.

However, after I tried to add some content to the file using the command:

echo abc >> test.txt 

I can not open the file by clicking on its symbol any more. The file load error keeps popping up every time I try to do so.

File Load Error for test.txt

C:\Users\Admin\AppData\Roaming\Python\Python310\Scripts\Git\test\test.txt is not UTF-8 encoded

However, it is still possible for me to get the content from the file using the command:

Get-Content test.txt

Can someone please shed some light on my problem?

1 Answer 1

0

Your text editor may be changing the text file's encoding when you save it.

If you're using Notepad to edit the text file, make sure you set the encoding to UTF-8 in the Save As dialog.

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

1 Comment

Thank you for your response. Can you suggest solutions to the problem?

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.