-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
fsPromises.readFile ignores encoding option #19286
Comments
Looks like a bug to me, |
Can reproduce locally
Note this works correctly when calling |
Looks like the encoding handling is missing in https://github.com/nodejs/node/blob/master/lib/fs/promises.js#L132 ignores |
Going to tackle this one |
Use the encoding parameter passed to fsPromises.readFile if it is passed. Currently the encoding parameter is ignored in fsPromises PR-URL: nodejs#19296 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Fixes: nodejs#19286
data will be of type string, when specifying the encoding in the method call, but with the latest version (v10.0.0-nightly20180309099e621648) I have to
data.toString("utf8")
again, to get the result as string.By design?
The text was updated successfully, but these errors were encountered: