itinance / itinance/react-native-fs

"ascii" encoding behavior

Open
#467 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

RNFS seems to treat `ascii` type as binary string. This is not actually explained anywhere in the README but is obvious in the treatment in the codebase. We use it to [read](https://github.com/SheetJS/js-xlsx/blob/master/demos/react/react-native.js#L41) and [write](https://github.com/SheetJS/js-xlsx/blob/master/demos/react/react-native.js#L67) binary data in React Native.

1) The readme currently recommends using `base64` for reading and writing binary files. Is there a reason not to use the current `ascii` encoding to read or write binary strings?

2) Given the behavior, would it make sense to make `binary` follow the current `ascii` behavior?

3) Should `ascii` be changed to remove non-ASCII characters (or just take the lowest 7 bits of the individual character codes)?

Related: https://github.com/itinance/react-native-fs/issues/204

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.