1024programmer Java Golang file operation error: Thefilename,directoryname,orvolumelabelsyntaxisincorrect

Golang file operation error: Thefilename,directoryname,orvolumelabelsyntaxisincorrect

The occurrence of the phenomenon:

1. I want to open an AAAAAAA file on a disk:

2. Copy the path to the attribute:

3. Implementation:

It seems that there is no problem with the path.

4. Run:

f@ck.

After some research, it turns out that what you see with the naked eye is not real! There is actually a problem with the path.

Paste the copied path in Notepad:

But when saving:

So it can basically be concluded that it is an encoding problem. Let’s choose Unicode to take a look.

Open it again and it still looks the same:

At this time, I remembered a sentence I had read somewhere: “Notepad will secretly add some inexplicable things to your content.”

Then I decisively right-clicked the WordPad to open it, and saved it as plain text:

Yes.

Open this text again:

Caught. That question mark is because of the encoding method, and errors occur in different encodings.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/768490

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索