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

Defaulting to utf-8 when encoding is not present #159

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

mcandeia
Copy link
Contributor

@mcandeia mcandeia commented Dec 17, 2024

Description

This is a bug that only happens on CF Workers, for some reason passing null or undefined as a encoding for buffers.toString() does not work.

image

Since node defaults to utf-8 when not present (source: https://www.w3schools.com/nodejs/met_buffer_tostring.asp) I changed it to use utf-8 by default instead of passing null/undefined

CF Fix: cloudflare/workerd#3252

@mcandeia mcandeia requested a review from james-pre as a code owner December 17, 2024 12:56
Copy link
Member

@james-pre james-pre left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@james-pre james-pre merged commit 14e05f2 into zen-fs:main Dec 17, 2024
1 check passed
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.

2 participants