-
Notifications
You must be signed in to change notification settings - Fork 18k
archive/zip: NonUTF8 does not work #72751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
As far as I can tell, you put a utf8 string in the name field, but marked it as not utf8. It's expected to be broken in whatever encoding unzip decided to try to decode the name with. |
No, this worked correctly previously. At least this commit. 0a3f3e1 |
BTW, NonUTF8 will not work correctly whether it is set to true or false. |
I think that's #44187 it works with: h := &zip.FileHeader{
Name: filename,
Method: zip.Deflate,
Modified: time.Now(),
} |
Yes, this is #44187 |
And I noticed ZipWriter.Create always not set Modified field. |
Go version
go version devel go1.24-608acff847 Wed Jan 22 10:13:04 2025 -0800 windows/amd64
Output of
go env
in your module/workspace:What did you do?
Run this Go code.
https://go.dev/play/p/eBJHlscxxcn
What did you see happen?
filename was broken.
What did you expect to see?
The text was updated successfully, but these errors were encountered: