Home > Back-end >  How to encode this JSON value to an emoji in c#
How to encode this JSON value to an emoji in c#

Time:08-30

I have this JSON data of countries with its telephone code, name, flag etc. For the flag the data has the value in this format \ud83c\udde6\ud83c\uddfc, how do I decode this to an actual picture of the flag in C#. Here is the sample of the data -

 {
        "name": {
            "common": "Angola",
            "official": "Republic of Angola",
        },

        "idd": {
            "root": " 2",
            "suffixes": [
                "44"
            ]
        },
        "capital": [
            "Luanda"
        ],

        "flag": "\ud83c\udde6\ud83c\uddf4",

    },

CodePudding user response:

You can deserialize this JSON string directly to an object with a matching schema. Displaying flags requires a font that actually contains those flags. The Pirate flag

  • Related