示例#1
0
 internal static bool TryGetEncodingFromCharSet(string charSet, out Encoding encoding)
 {
     encoding = null;
     if ((charSet != null) && (charSet.Length != 0))
     {
         return(TextEncoderDefaults.TryGetEncoding(charSet, out encoding));
     }
     return(true);
 }
示例#2
0
 internal override bool IsCharSetSupported(string charSet)
 {
     if ((charSet != null) && (charSet.Length != 0))
     {
         Encoding encoding;
         return(TextEncoderDefaults.TryGetEncoding(charSet, out encoding));
     }
     return(true);
 }
示例#3
0
        internal override bool IsCharSetSupported(string charSet)
        {
            if (charSet == null || charSet.Length == 0)
            {
                return(true);
            }

            Encoding tmp;

            return(TextEncoderDefaults.TryGetEncoding(charSet, out tmp));
        }
示例#4
0
            internal override bool IsCharSetSupported(string charSet)
            {
                Encoding tmp;

                if (!TextEncoderDefaults.TryGetEncoding(charSet, out tmp))
                {
                    // GetEncodingFromContentType supports charset with quotes (by simply stripping them) so we do the same here
                    // This also gives us parity with Desktop WCF behavior
                    if (charSet.Length > 2 && charSet[0] == '"' && charSet[charSet.Length - 1] == '"')
                    {
                        charSet = charSet.Substring(1, charSet.Length - 2);
                        return(TextEncoderDefaults.TryGetEncoding(charSet, out tmp));
                    }
                    return(false);
                }
                return(true);
            }
示例#5
0
            internal override bool IsCharSetSupported(string charSet)
            {
                Encoding tmp;

                return(TextEncoderDefaults.TryGetEncoding(charSet, out tmp));
            }