JavaScript strings with NULL character are not handled properly
See original GitHub issue🐛 Bug Report
JavaScript strings with NULL character are not handled properly
To Reproduce
<Text style={styles.welcome}>{'Hello \u0000 World'}</Text>
The text is cuted to Hello It does not happen when Debug JS Remotely.
Expected Behavior
Hello World
Code Example
https://github.com/gaodeng/RN-NULL-character-ISSUE
Environment
info
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (4) x64 Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz
Memory: 282.02 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.5.1 - /usr/local/bin/yarn
npm: 6.8.0 - /usr/local/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.0, 28.0.3
System Images: android-18 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-24 | Intel x86 Atom_64, android-25 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-P | Google APIs Intel x86 Atom, android-P | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5314842
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.1 => 0.59.1
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-git-upgrade: 0.2.7
react-native-rename: 2.1.5
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:23 (5 by maintainers)
Top Results From Across the Web
JavaScript strings with NULL character are not ... - GitHub
JavaScript strings with NULL character are not handled properly when passed to Native Modules #12731. Issues ideal for external contributors.
Read more >Why doesn't the null-terminator placed arbitrarily in a string ...
JavaScript does not use NULL terminated strings, while C does. Javascript strings are stored by keeping track of the characters and the ...
Read more >Null character and JavaScript strings - Google Groups
JavaScript core engine handles strings as NUL terminated character ... You have still not understood that U+0000 is a Unicode character without a...
Read more >Null Characters: Workarounds Aren't Good Enough
Strings are no longer null-terminated in the software of this century; instead, every string is stored with an explicit length.
Read more >String - JavaScript - MDN Web Docs
String literals can be specified using single or double quotes, which are treated identically, or using the backtick character ` .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just tested on hermes, It parses the string with null characters properly without any problem
Can some moderator please mark this as “do not close”, so that ugly stale-bot does not just cover a not-fixed bug?!?
AFAIK this bug is still present and such NULL-bugs are wild to find.