How I can convert a HTML entity to unicode?
like: —
to \u2014
or better:
const msg = 'i am &mdash lucky' // convert to i am \u2014 lucky
or is there any way to tell babel do it on compile time?!!
Edit
- Don't offer DOM to do this, I need it for both client and server side.
- And I don't want to replace
—
with—
, I want\u2014
.