Skip to content
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

fs: fix WTF-8 decoding issue #4092

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jul 12, 2023

We forgot to mask off the high bits from the first byte, so we ended up always failing the subsequent range check.

Refs: #2970 (need to fix this in the commit message when merging)
Fixes: nodejs/node#48673

We forgot to mask off the high bits from the first byte, so we ended up
always failing the subsequent range check.

Refs: libuv#297
Fixes: nodejs/node#48673
@vtjnash
Copy link
Member Author

vtjnash commented Jul 12, 2023

I don't have an easy way to test this since they aren't exported utilities, but this is the cause of the test failure in #4021, where we do export this.

@santigimeno

This comment was marked as outdated.

@vtjnash

This comment was marked as outdated.

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, gcc's -Wmisleading-indentation should've flagged this. Is our copy of mingw so old it doesn't print anything?

@vtjnash
Copy link
Member Author

vtjnash commented Jul 13, 2023

The indentation was fine. It was missing the bit mask.

@vtjnash vtjnash merged commit d09441c into libuv:v1.x Jul 13, 2023
13 checks passed
@vtjnash vtjnash deleted the jn/wtf8-decode-4byte branch July 13, 2023 16:22
@AlttiRi AlttiRi mentioned this pull request Nov 3, 2023
@AlttiRi
Copy link

AlttiRi commented Nov 23, 2023

No tests for files with Unicode surrogate pair(s) in names were added?

  • my-notes-📄.txt
  • 🛸-ufo.mov
  • SpaceX-🚀🚀🚀.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Windows) FS can not handle certain characters in file name
4 participants