New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle astral Unicode symbols #11

Closed
fb55 opened this Issue Jul 30, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@fb55
Owner

fb55 commented Jul 30, 2013

Probably the same way mathiasbynens/he does it.

@mathiasbynens

This comment has been minimized.

Show comment
Hide comment
@mathiasbynens

mathiasbynens Jul 30, 2013

FYI, if you only care about supporting Node, it’s even easier: you can use the built-in punycode module to convert the numeric code point value into the correct symbol.

var punycode = require('punycode'); // no need to `npm install`; it ships with Node
punycode.ucs2.encode([0x1D306]); // returns a string containing only U+1D306 TETRAGRAM FOR CENTRE, i.e. `'𝌆'`

mathiasbynens commented Jul 30, 2013

FYI, if you only care about supporting Node, it’s even easier: you can use the built-in punycode module to convert the numeric code point value into the correct symbol.

var punycode = require('punycode'); // no need to `npm install`; it ships with Node
punycode.ucs2.encode([0x1D306]); // returns a string containing only U+1D306 TETRAGRAM FOR CENTRE, i.e. `'𝌆'`
@fb55

This comment has been minimized.

Show comment
Hide comment
@fb55

fb55 Jul 30, 2013

Owner

That's really neat, thanks! I'll probably implement it myself anyways, for performance reasons, but there were already plenty of cases were I wished I had something like that :)

Owner

fb55 commented Jul 30, 2013

That's really neat, thanks! I'll probably implement it myself anyways, for performance reasons, but there were already plenty of cases were I wished I had something like that :)

@mathiasbynens

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment