That same as below character.
"\ud83c\udf1f[C\u1eadp Nh\u1eadt"
You'll always meet this character when you dump or get data from website. The data send from server to web through JSON file
"Convert a Unicode string to an escaped ASCII string"
This tips will help you Encode and Decode unicode escape C# character! Follow my source code, you can easy do it!
// unicode escape C#
string unicodeString = "\ud83c\udf1f[C\u1eadp Nh\u1eadt"; Console.WriteLine(unicodeString); Console.WriteLine(" -------------------------------------------- "); string encoded = EncodeNonAsciiCharacters(unicodeString); Console.WriteLine(encoded); Console.WriteLine(" -------------------------------------------- "); string decoded = DecodeEncodedNonAsciiCharacters(encoded); Console.WriteLine(decoded); static string EncodeNonAsciiCharacters(string value) { StringBuilder sb = new StringBuilder(); foreach (char c in value) { if (c > 127) { // This character is too big for ASCII string encodedValue = "\\u" + ((int)c).ToString("x4"); sb.Append(encodedValue); } else { sb.Append(c); } } return sb.ToString(); } static string DecodeEncodedNonAsciiCharacters(string value) { return Regex.Replace( value, @"\\u(?<Value>[a-zA-Z0-9]{4})", m => { return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString(); }); }
Are you interested in topic "How to Encode and decode unicode escape C# character" from Webzone Tech Tips? If you have any thoughts or questions, please share them in the comment section below. I would love to hear from you and chat about it
Webzone Tech Tips Zidane