Description
When HTML produced by EnrichedTextInput.getHTML() on Android contains non-ASCII text, Android serializes those characters as numeric HTML character references such as 今. If that saved HTML is later loaded into EnrichedTextInput on iOS via setValue / defaultValue, iOS renders the numeric entities literally instead of decoding them back to Unicode text.
This creates a cross-platform persistence problem: content saved from Android can look correct in an HTML renderer, but becomes unreadable when opened for editing on iOS.
Reproduction
- On Android, enter Chinese text in
EnrichedTextInput, for example:
- Call
editorRef.current.getHTML() and persist the returned value.
Observed Android HTML output includes numeric entities, for example:
<html>
<p>今晚用软尺量一次腰围</p>
</html>
- On iOS, load that same saved HTML into
EnrichedTextInput using setValue or defaultValue.
Expected behavior
The iOS editor should display:
Actual behavior
The iOS editor displays the numeric entities as literal text:
今晚用软尺量一次腰围
Notes
This appears related to HTML entity handling, but different from #235 / #258. Those seem to cover named/special entities like <, >, and &. In this case the problem is numeric character references emitted by Android for non-ASCII characters and then not decoded by the iOS parser.
This is especially visible with Chinese, Japanese, Korean, emoji, and other non-ASCII text.
Environment
react-native-enriched: 0.8.0
react-native: 0.85.3
react: 19.2.3
expo: 56.0.11
- Android: observed from Android
getHTML() output
- iOS: observed when loading the saved HTML into
EnrichedTextInput
Description
When HTML produced by
EnrichedTextInput.getHTML()on Android contains non-ASCII text, Android serializes those characters as numeric HTML character references such as今. If that saved HTML is later loaded intoEnrichedTextInputon iOS viasetValue/defaultValue, iOS renders the numeric entities literally instead of decoding them back to Unicode text.This creates a cross-platform persistence problem: content saved from Android can look correct in an HTML renderer, but becomes unreadable when opened for editing on iOS.
Reproduction
EnrichedTextInput, for example:editorRef.current.getHTML()and persist the returned value.Observed Android HTML output includes numeric entities, for example:
EnrichedTextInputusingsetValueordefaultValue.Expected behavior
The iOS editor should display:
Actual behavior
The iOS editor displays the numeric entities as literal text:
Notes
This appears related to HTML entity handling, but different from #235 / #258. Those seem to cover named/special entities like
<,>, and&. In this case the problem is numeric character references emitted by Android for non-ASCII characters and then not decoded by the iOS parser.This is especially visible with Chinese, Japanese, Korean, emoji, and other non-ASCII text.
Environment
react-native-enriched:0.8.0react-native:0.85.3react:19.2.3expo:56.0.11getHTML()outputEnrichedTextInput