Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string GetUriForEmoji(string glyphs)
- {
- var result = string.Empty;
- var i = 0;
- do
- {
- if (char.IsSurrogatePair(glyphs, i))
- {
- result += char.ConvertToUtf32(glyphs, i).ToString("x2");
- i += 2;
- }
- else
- {
- result += ((short)glyphs[i]).ToString("x4");
- i++;
- }
- if (i < glyphs.Length)
- result += "-";
- } while (i < glyphs.Length);
- return $"ms-appx:///Assets/Emoji/Sprites/{result}.png";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement