Skip to content

Instantly share code, notes, and snippets.

@rsxdalv
Created June 19, 2018 06:22
Show Gist options
  • Save rsxdalv/14024bfe27f9f4ba094985fea3daf1e3 to your computer and use it in GitHub Desktop.
Save rsxdalv/14024bfe27f9f4ba094985fea3daf1e3 to your computer and use it in GitHub Desktop.
JS-string-to-css-charcodes
const x = 'ievelc šeit'
console.log(
Array(x.length).fill(0).map((_, i) =>
`/${Number(
x.charCodeAt(i)
).toString(16).padStart(4, 0)}`
).join("")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment