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

Description

@lll000111

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions