Closed
Description
React version:
18.3.1
Steps To Reproduce
When I use remix to stream render a page, sometimes garbled characters appear on the page when my data contains Chinese characters. I saw through debugging that react-dom inserts null characters when parsing, which causes an exception during merging.
and when textEncoder.encodeInto
exec
Due to business issues, I can only provide a short reproducible fragment
var util = require('util')
var textEncoder = new util.TextEncoder()
var target = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
textEncoder.encodeInto(
'__remixContext.r("routes/page.$pageName", "getConfig", {"headTitle":"升级有礼","title":"有礼升级至新版立得块优惠券20"',
target
)
console.log(new TextDecoder().decode(target))
// result: __remixContext.r("routes/page.$pageName", "getConfig", {"headTitle":"升级有礼","title":"有��
The current behavior
When transmitting Chinese data, sometimes garbled code can occur
The expected behavior
streaming original data