예제 #1
0
파일: Random.cs 프로젝트: Nielk1/NadekoBot
        public void Utf8CodepointsToEmoji()
        {
            var point          = @"0001F338";
            var hopefullyEmoji = YamlHelper.UnescapeUnicodeCodePoint(point);

            Assert.AreEqual("🌸", hopefullyEmoji, hopefullyEmoji);
        }
예제 #2
0
 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;
     }));
 }
예제 #3
0
        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);
        }