public void Utf8CodepointsToEmoji() { var point = @"0001F338"; var hopefullyEmoji = YamlHelper.UnescapeUnicodeCodePoint(point); Assert.AreEqual("🌸", hopefullyEmoji, hopefullyEmoji); }
public static string UnescapeUnicodeCodePoints(this string input) { return(CodePointRegex.Replace(input, me => { var str = me.Groups["code"].Value; var newString = YamlHelper.UnescapeUnicodeCodePoint(str); return newString; })); }
public string Serialize <T>(T obj) { var escapedOutput = _serializer.Serialize(obj); var output = CodePointRegex.Replace(escapedOutput, me => { var str = me.Groups["code"].Value; var newString = YamlHelper.UnescapeUnicodeCodePoint(str); return(newString); }); return(output); }