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

String translation between React-Native and Java is Trimming #32412

Closed
nickwelp opened this issue Oct 15, 2021 · 3 comments
Closed

String translation between React-Native and Java is Trimming #32412

nickwelp opened this issue Oct 15, 2021 · 3 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Resolution: Locked This issue was locked by the bot.

Comments

@nickwelp
Copy link

nickwelp commented Oct 15, 2021

I have a JS Uint8array that contains binary data, which is converted to a string and sent to Java which reads the string. These strings/byte arrays are made using protocol buffers. The string in JS is "R\u0000", with "\u0000" being a null code. When the string arrives in Java, it is only "R" and the \u0000 is stripped. The typecasting from JS to Java is stripping some data out.

I'm looking at using ReadableMap as a workaround.

System:
OS: macOS 11.6
CPU: (8) x64 Apple M1
Memory: 20.20 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.0.0 - ~/.nvm/versions/node/v14.0.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.0.0/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v14.0.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: ~0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
(Use NPX, Expo, and react native modules)

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Oct 15, 2021
@github-actions
Copy link

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@nickwelp
Copy link
Author

Enviromental info has been added.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Oct 15, 2021
@nickwelp
Copy link
Author

nickwelp commented Oct 16, 2021

I developed a work around, encoding the null character and decoding it. It's worth mentioning in the Documentation that null characters are trimmed when going between react-native and java.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 16, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants