public static Encoding GetEncoding(this MS.StringStorageWidthType type) { Contract.Ensures(Contract.Result <Encoding>() != null); switch (type) { case MS.StringStorageWidthType.Ascii: return(Encoding.ASCII); case MS.StringStorageWidthType.Unicode: return(Encoding.Unicode); case MS.StringStorageWidthType.UTF7: return(Encoding.UTF7); case MS.StringStorageWidthType.UTF8: return(Encoding.UTF8); case MS.StringStorageWidthType.UTF32: return(Encoding.UTF32); default: throw new Debug.UnreachableException(type.ToString()); } }
public static bool IsVariableWidth(this MS.StringStorageWidthType type) { return(type == MS.StringStorageWidthType.UTF7 || type == MS.StringStorageWidthType.UTF8); }