fix: fix wrong unicodechar regx (#23468)

This commit is contained in:
Good Wood 2025-08-06 09:48:25 +08:00 committed by GitHub
parent ad622cea9e
commit eb12fd9461
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,7 @@ function unicodeToChar(text: string) {
if (!text) if (!text)
return '' return ''
return text.replace(/\\u[0-9a-f]{4}/g, (_match, p1) => { return text.replace(/\\u([0-9a-f]{4})/g, (_match, p1) => {
return String.fromCharCode(Number.parseInt(p1, 16)) return String.fromCharCode(Number.parseInt(p1, 16))
}) })
} }