This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
Default encoding fs.writeStream() and fs.readStream(): conflicting messages #487
Closed
Description
While doing minor cleanup for my upcoming PR I found conflicting information about what the default encoding (when none is given) is supposed to be for fs.writeStream
and fs.readStream
.
See https://github.com/wkh237/react-native-fetch-blob/blob/master/fs.js#L89
writeStream
has a line
encoding = encoding || 'utf8'
but then three lines below has
RNFetchBlob.writeStream(path, encoding || 'base64', append || false, (err, streamId:string)
So while the "utf8" wins it seems to me at one point you wanted to make base64 the default?
In readStream
there is no default set at all, I think it should be the same one used in writeStream
, for consistency.
EDIT: I set the default to "utf8" for both now,because that the behavior the tests expect.
Metadata
Metadata
Assignees
Labels
No labels