I'm pulling tweets from Twitter and want to show them on a web page, but instead of emoji I only see boxes for characters like
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Default settings for JSLint and other quality checkers don't accept several of the Twitter Flags and Sequences.
For convenience, based on the answer above, I've commented out the offending escape sequences and used the actual characters in the Regex.
Please, please, never blindly delete chunks of text, especially not just because you can't see or understand them; it destroys information. Someone put them there for a reason; tweets containing emoji often don't make any sense without the emoji.
For what it's worth, what you're seeing isn't really "binary"; it's most likely a small square with the Unicode codepoint spelled out in hex. For
twitter finally released it ;) Hope it helps https://github.com/twitter/twemoji
Unfortunately, what is or is not a Twitter Emoji is not simply all code points >= U+10000. There is also the issue of the regional flags, and the variant sequences.
I realized this is probably going to be a common problem so until the Twitter API provides native Emoji support, you can try something similar to this: