Skip to content

Instantly share code, notes, and snippets.

@virtueer
Created April 12, 2023 10:47
Show Gist options
  • Save virtueer/82d2355f57def7c77c769c7a5ff2d362 to your computer and use it in GitHub Desktop.
Save virtueer/82d2355f57def7c77c769c7a5ff2d362 to your computer and use it in GitHub Desktop.
const list = rawStr.match(/\\u..../g) || []
for (const code of list)
rawStr = rawStr.replace(code, decodeURIComponent(Buffer.from(code.slice(-2), 'hex')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment