I am working on a chatting application in WPF and I want to use emoticons in it. I am working on WPF app. I want to read emoticons which are coming from Android/iOS devices and show respective images.
On WPF, I am getting a black Emoticon looking like . I somehow got a library of emoji icons which are saved with respective hex/escaped unicode values. So, I want to convert these symbols of emoticons into UTF-32/escaped unicode so that I can directly replace related emoji icons with them.
I had tried to convert an emoticon to its unicode but end up getting a different string with couple of symbols, which are having different unicode.
string unicodeString = "\u1F642"; // represents
Your escaped Unicode String is invalid in C#.
Please be aware that
Encoding.Unicode
is UTF-16 in C#. To read 32 bits Unicode, there is thisEncoding.UTF32
. Link on MSDN for Encoding.UTF32