Beispiel #1
0
        public void Test()
        {
            string content = @"Unicode 的编码和解码类;";
            var    cnt     = UnicodeUtil.Encode(content);
            var    dcnt    = UnicodeUtil.Decode(cnt);

            Assert.IsTrue(dcnt == content);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var val = reader.Value;

            if (val == null)
            {
                return(null);
            }
            return(UnicodeUtil.Decode(val as string));
        }