Answer the question
In order to leave comments, you need to log in
How are Emoticons "arranged"?
How are Emoticons "arranged"?
How can you unambiguously determine that they are present in the received response?
For example:
{
"date":1476961874,
"text":"\ud83c\udf45"
}
Answer the question
In order to leave comments, you need to log in
Question: are we parsing this JSON or not?
For simplicity, let's assume that we parse (well, or the JS translator parses - everything is the same). Then the text is encoded in UTF-16.
• Symbols 0000…D7FF - they are.
• Characters D800…DBFF - This character must be followed by a character from DC00…DFFF and form a surrogate pair that will be one character. Google "UTF-16" for details. If one of these two characters goes without a pair, it's invalid UTF-16.
• And characters E000…FFFF are also encoded as is.
This surrogate pair that you threw in is encoded into the symbol 1F345, some kind of tomato.
The function of converting a surrogate pair to a character code:
And what codes you don't need - dig Unicode tables.
An easier way that may work for you is to disable all surrogate pairs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question