• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Text.Encoding类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Portable.Text.Encoding的典型用法代码示例。如果您正苦于以下问题:C# Portable.Text.Encoding类的具体用法?C# Portable.Text.Encoding怎么用?C# Portable.Text.Encoding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Portable.Text.Encoding类属于命名空间,在下文中一共展示了Portable.Text.Encoding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SaslMechanismLogin

		/// <summary>
		/// Initializes a new instance of the <see cref="MailKit.Security.SaslMechanismLogin"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new LOGIN SASL context.
		/// </remarks>
		/// <param name="uri">The URI of the service.</param>
		/// <param name="encoding">The encoding to use for the user's credentials.</param>
		/// <param name="credentials">The user's credentials.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="uri"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="credentials"/> is <c>null</c>.</para>
		/// </exception>
		public SaslMechanismLogin (Uri uri, Encoding encoding, ICredentials credentials) : base (uri, credentials)
		{
			if (encoding == null)
				throw new ArgumentNullException (nameof (encoding));

			this.encoding = encoding;
		}
开发者ID:jstedfast,项目名称:MailKit,代码行数:23,代码来源:SaslMechanismLogin.cs


示例2: Pop3Command

		public Pop3Command (CancellationToken cancellationToken, Pop3CommandHandler handler, Encoding encoding, string format, params object[] args)
		{
			Command = string.Format (format, args);
			CancellationToken = cancellationToken;
			Encoding = encoding;
			Handler = handler;
		}
开发者ID:dcga,项目名称:MailKit,代码行数:7,代码来源:Pop3Command.cs


示例3: InternetAddress

        /// <summary>
        /// Initializes a new instance of the <see cref="MimeKit.InternetAddress"/> class.
        /// </summary>
        /// <remarks>
        /// Initializes the <see cref="Encoding"/> and <see cref="Name"/> properties of the internet address.
        /// </remarks>
        /// <param name="encoding">The character encoding to be used for encoding the name.</param>
        /// <param name="name">The name of the mailbox or group.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="encoding"/> is <c>null</c>.
        /// </exception>
        protected InternetAddress(Encoding encoding, string name)
        {
            if (encoding == null)
                throw new ArgumentNullException ("encoding");

            Encoding = encoding;
            Name = name;
        }
开发者ID:richard2753,项目名称:MimeKit,代码行数:19,代码来源:InternetAddress.cs


示例4: MailboxAddress

		/// <summary>
		/// Initializes a new instance of the <see cref="MimeKit.MailboxAddress"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="MailboxAddress"/> with the specified name, address and route. The
		/// specified text encoding is used when encoding the name according to the rules of rfc2047.
		/// </remarks>
		/// <param name="encoding">The character encoding to be used for encoding the name.</param>
		/// <param name="name">The name of the mailbox.</param>
		/// <param name="route">The route of the mailbox.</param>
		/// <param name="address">The address of the mailbox.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="route"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="address"/> is <c>null</c>.</para>
		/// </exception>
		public MailboxAddress (Encoding encoding, string name, IEnumerable<string> route, string address) : base (encoding, name)
		{
			if (address == null)
				throw new ArgumentNullException ("address");

			Route = new DomainList (route);
			Route.Changed += RouteChanged;
			Address = address;
		}
开发者ID:dcga,项目名称:MimeKit,代码行数:27,代码来源:MailboxAddress.cs


示例5: SmtpStream

		static SmtpStream ()
		{
			UTF8 = Encoding.GetEncoding (65001, new EncoderExceptionFallback (), new DecoderExceptionFallback ());

			try {
				Latin1 = Encoding.GetEncoding (28591);
			} catch (NotSupportedException) {
				Latin1 = Encoding.GetEncoding (1252);
			}
		}
开发者ID:nachocove,项目名称:MailKit,代码行数:10,代码来源:SmtpStream.cs


示例6: HtmlWriter

		/// <summary>
		/// Initializes a new instance of the <see cref="MimeKit.Text.HtmlWriter"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="HtmlWriter"/>.
		/// </remarks>
		/// <param name="stream">The output stream.</param>
		/// <param name="encoding">The encoding to use for the output.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="stream"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// </exception>
		public HtmlWriter (Stream stream, Encoding encoding)
		{
			if (stream == null)
				throw new ArgumentNullException ("stream");

			if (encoding == null)
				throw new ArgumentNullException ("encoding");

			html = new StreamWriter (stream, encoding, 4096);
		}
开发者ID:dcga,项目名称:MimeKit,代码行数:23,代码来源:HtmlWriter.cs


示例7: Header

		/// <summary>
		/// Initializes a new instance of the <see cref="MimeKit.Header"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new message or entity header for the specified field and
		/// value pair. The encoding is used to determine which charset to use
		/// when encoding the value according to the rules of rfc2047.
		/// </remarks>
		/// <param name="charset">The charset that should be used to encode the
		/// header value.</param>
		/// <param name="id">The header identifier.</param>
		/// <param name="value">The value of the header.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="charset"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="value"/> is <c>null</c>.</para>
		/// </exception>
		/// <exception cref="System.ArgumentOutOfRangeException">
		/// <paramref name="id"/> is not a valid <see cref="HeaderId"/>.
		/// </exception>
		public Header (Encoding charset, HeaderId id, string value)
		{
			if (charset == null)
				throw new ArgumentNullException ("charset");

			if (id == HeaderId.Unknown)
				throw new ArgumentOutOfRangeException ("id");

			if (value == null)
				throw new ArgumentNullException ("value");

			Options = ParserOptions.Default.Clone ();
			Field = id.ToHeaderName ();
			Id = id;

			SetValue (charset, value);
		}
开发者ID:gphummer,项目名称:MimeKit,代码行数:37,代码来源:Header.cs


示例8: Header

		/// <summary>
		/// Initializes a new instance of the <see cref="MimeKit.Header"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new message or entity header for the specified field and
		/// value pair. The encoding is used to determine which charset to use
		/// when encoding the value according to the rules of rfc2047.
		/// </remarks>
		/// <param name="encoding">The character encoding that should be used to
		/// encode the header value.</param>
		/// <param name="id">The header identifier.</param>
		/// <param name="value">The value of the header.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="value"/> is <c>null</c>.</para>
		/// </exception>
		/// <exception cref="System.ArgumentOutOfRangeException">
		/// <paramref name="id"/> is not a valid <see cref="HeaderId"/>.
		/// </exception>
		public Header (Encoding encoding, HeaderId id, string value)
		{
			if (encoding == null)
				throw new ArgumentNullException ("encoding");

			if (id == HeaderId.Unknown)
				throw new ArgumentOutOfRangeException ("id");

			if (value == null)
				throw new ArgumentNullException ("value");

			Options = ParserOptions.Default.Clone ();
			Field = id.ToHeaderName ();
			Id = id;

			rawField = Encoding.ASCII.GetBytes (Field);
			SetValue (encoding, value);
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:38,代码来源:Header.cs


示例9: CharsetConvert

		static byte[] CharsetConvert (Encoding charset, char[] word, int length, out int converted)
		{
			var encoder = charset.GetEncoder ();
			int count = encoder.GetByteCount (word, 0, length, true);
			var encoded = new byte[count];

			converted = encoder.GetBytes (word, 0, length, encoded, 0, true);

			return encoded;
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:10,代码来源:Rfc2047.cs


示例10: EncodeText

		/// <summary>
		/// Encodes the unstructured text.
		/// </summary>
		/// <remarks>
		/// Encodes the unstructured text according to the rules of rfc2047
		/// using the specified charset encoding and formatting options.
		/// </remarks>
		/// <returns>The encoded text.</returns>
		/// <param name="options">The formatting options</param>
		/// <param name="charset">The charset encoding.</param>
		/// <param name="text">The text to encode.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="options"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="charset"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="text"/> is <c>null</c>.</para>
		/// </exception>
		public static byte[] EncodeText (FormatOptions options, Encoding charset, string text)
		{
			if (options == null)
				throw new ArgumentNullException ("options");

			if (charset == null)
				throw new ArgumentNullException ("charset");

			if (text == null)
				throw new ArgumentNullException ("text");

			return Encode (options, charset, text, false);
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:31,代码来源:Rfc2047.cs


示例11: EncodePhrase

		/// <summary>
		/// Encodes the phrase.
		/// </summary>
		/// <remarks>
		/// Encodes the phrase according to the rules of rfc2047 using
		/// the specified charset encoding and formatting options.
		/// </remarks>
		/// <returns>The encoded phrase.</returns>
		/// <param name="options">The formatting options</param>
		/// <param name="charset">The charset encoding.</param>
		/// <param name="phrase">The phrase to encode.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="options"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="charset"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="phrase"/> is <c>null</c>.</para>
		/// </exception>
		public static byte[] EncodePhrase (FormatOptions options, Encoding charset, string phrase)
		{
			if (options == null)
				throw new ArgumentNullException ("options");

			if (charset == null)
				throw new ArgumentNullException ("charset");

			if (phrase == null)
				throw new ArgumentNullException ("phrase");

			return Encode (options, charset, phrase, true);
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:31,代码来源:Rfc2047.cs


示例12: FormatRawValue

		byte[] FormatRawValue (FormatOptions format, Encoding encoding)
		{
			switch (Id) {
			case HeaderId.DispositionNotificationTo:
			case HeaderId.ResentFrom:
			case HeaderId.ResentBcc:
			case HeaderId.ResentCc:
			case HeaderId.ResentTo:
			case HeaderId.From:
			case HeaderId.Bcc:
			case HeaderId.Cc:
			case HeaderId.To:
				return EncodeAddressHeader (Options, format, encoding, Field, textValue);
			case HeaderId.Received:
				return EncodeReceivedHeader (Options, format, encoding, Field, textValue);
			case HeaderId.ResentMessageId:
			case HeaderId.MessageId:
			case HeaderId.ContentId:
				return EncodeMessageIdHeader (Options, format, encoding, Field, textValue);
			case HeaderId.References:
				return EncodeReferencesHeader (Options, format, encoding, Field, textValue);
			case HeaderId.ContentDisposition:
				return EncodeContentDisposition (Options, format, encoding, Field, textValue);
			case HeaderId.ContentType:
				return EncodeContentType (Options, format, encoding, Field, textValue);
			case HeaderId.DkimSignature:
				return EncodeDkimSignatureHeader (Options, format, encoding, Field, textValue);
			default:
				return EncodeUnstructuredHeader (Options, format, encoding, Field, textValue);
			}
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:31,代码来源:Header.cs


示例13: Encode

		static byte[] Encode (FormatOptions options, Encoding charset, string text, bool phrase)
		{
			var mode = phrase ? QEncodeMode.Phrase : QEncodeMode.Text;
			var words = Merge (options, charset, GetRfc822Words (options, charset, text, phrase));
			var str = new StringBuilder ();
			int start, length;
			Word prev = null;
			byte[] encoded;

			foreach (var word in words) {
				// append the correct number of spaces between words...
				if (prev != null && !(prev.Type == WordType.EncodedWord && word.Type == WordType.EncodedWord)) {
					start = prev.StartIndex + prev.CharCount;
					length = word.StartIndex - start;
					str.Append (text, start, length);
				}

				switch (word.Type) {
				case WordType.Atom:
					str.Append (text, word.StartIndex, word.CharCount);
					break;
				case WordType.QuotedString:
					AppendQuoted (str, text, word.StartIndex, word.CharCount);
					break;
				case WordType.EncodedWord:
					if (prev != null && prev.Type == WordType.EncodedWord) {
						// include the whitespace between these 2 words in the
						// resulting rfc2047 encoded-word.
						start = prev.StartIndex + prev.CharCount;
						length = (word.StartIndex + word.CharCount) - start;

						str.Append (phrase ? '\t' : ' ');
					} else {
						start = word.StartIndex;
						length = word.CharCount;
					}

					switch (word.Encoding) {
					case 0: // us-ascii
						AppendEncodedWord (str, Encoding.ASCII, text, start, length, mode);
						break;
					case 1: // iso-8859-1
						AppendEncodedWord (str, CharsetUtils.Latin1, text, start, length, mode);
						break;
					default: // custom charset
						AppendEncodedWord (str, charset, text, start, length, mode);
						break;
					}
					break;
				}

				prev = word;
			}

			encoded = new byte[str.Length];
			for (int i = 0; i < str.Length; i++)
				encoded[i] = (byte) str[i];

			return encoded;
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:60,代码来源:Rfc2047.cs


示例14: AuthenticateAsync

		/// <summary>
		/// Asynchronously authenticates using the specified user name and password.
		/// </summary>
		/// <remarks>
		/// <para>If the server supports one or more SASL authentication mechanisms,
		/// then the SASL mechanisms that both the client and server support are tried
		/// in order of greatest security to weakest security. Once a SASL
		/// authentication mechanism is found that both client and server support,
		/// the credentials are used to authenticate.</para>
		/// <para>If the server does not support SASL or if no common SASL mechanisms
		/// can be found, then the default login command is used as a fallback.</para>
		/// <note type="tip">To prevent the usage of certain authentication mechanisms,
		/// simply remove them from the <see cref="AuthenticationMechanisms"/> hash set
		/// before calling this method.</note>
		/// </remarks>
		/// <returns>An asynchronous task context.</returns>
		/// <param name="encoding">The encoding to use for the user's credentials.</param>
		/// <param name="userName">The user name.</param>
		/// <param name="password">The password.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="userName"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="password"/> is <c>null</c>.</para>
		/// </exception>
		/// <exception cref="System.ObjectDisposedException">
		/// The <see cref="MailService"/> has been disposed.
		/// </exception>
		/// <exception cref="System.InvalidOperationException">
		/// The <see cref="MailService"/> is not connected or is already authenticated.
		/// </exception>
		/// <exception cref="System.OperationCanceledException">
		/// The operation was canceled via the cancellation token.
		/// </exception>
		/// <exception cref="MailKit.Security.AuthenticationException">
		/// Authentication using the supplied credentials has failed.
		/// </exception>
		/// <exception cref="MailKit.Security.SaslException">
		/// A SASL authentication error occurred.
		/// </exception>
		/// <exception cref="System.IO.IOException">
		/// An I/O error occurred.
		/// </exception>
		/// <exception cref="ProtocolException">
		/// A protocol error occurred.
		/// </exception>
		public Task AuthenticateAsync (Encoding encoding, string userName, string password, CancellationToken cancellationToken = default (CancellationToken))
		{
			if (encoding == null)
				throw new ArgumentNullException ("encoding");

			if (userName == null)
				throw new ArgumentNullException ("userName");

			if (password == null)
				throw new ArgumentNullException ("password");

			var credentials = new NetworkCredential (userName, password);

			return AuthenticateAsync (encoding, credentials, cancellationToken);
		}
开发者ID:dcga,项目名称:MailKit,代码行数:63,代码来源:MailService.cs


示例15: Authenticate

		/// <summary>
		/// Authenticates using the supplied credentials.
		/// </summary>
		/// <remarks>
		/// <para>If the server supports one or more SASL authentication mechanisms,
		/// then the SASL mechanisms that both the client and server support are tried
		/// in order of greatest security to weakest security. Once a SASL
		/// authentication mechanism is found that both client and server support,
		/// the credentials are used to authenticate.</para>
		/// <para>If the server does not support SASL or if no common SASL mechanisms
		/// can be found, then the default login command is used as a fallback.</para>
		/// <note type="tip">To prevent the usage of certain authentication mechanisms,
		/// simply remove them from the <see cref="AuthenticationMechanisms"/> hash set
		/// before calling this method.</note>
		/// </remarks>
		/// <param name="encoding">The encoding to use for the user's credentials.</param>
		/// <param name="credentials">The user's credentials.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="credentials"/> is <c>null</c>.</para>
		/// </exception>
		/// <exception cref="System.ObjectDisposedException">
		/// The <see cref="MailService"/> has been disposed.
		/// </exception>
		/// <exception cref="System.InvalidOperationException">
		/// The <see cref="MailService"/> is not connected or is already authenticated.
		/// </exception>
		/// <exception cref="System.OperationCanceledException">
		/// The operation was canceled via the cancellation token.
		/// </exception>
		/// <exception cref="MailKit.Security.AuthenticationException">
		/// Authentication using the supplied credentials has failed.
		/// </exception>
		/// <exception cref="MailKit.Security.SaslException">
		/// A SASL authentication error occurred.
		/// </exception>
		/// <exception cref="System.IO.IOException">
		/// An I/O error occurred.
		/// </exception>
		/// <exception cref="ProtocolException">
		/// A protocol error occurred.
		/// </exception>
		public abstract void Authenticate (Encoding encoding, ICredentials credentials, CancellationToken cancellationToken = default (CancellationToken));
开发者ID:dcga,项目名称:MailKit,代码行数:45,代码来源:MailService.cs


示例16: EstimateEncodedWordLength

		static int EstimateEncodedWordLength (Encoding charset, int byteCount, int encodeCount)
		{
			return EstimateEncodedWordLength (CharsetUtils.GetMimeCharset (charset), byteCount, encodeCount);
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:4,代码来源:Rfc2047.cs


示例17: ExceedsMaxLineLength

		static bool ExceedsMaxLineLength (FormatOptions options, Encoding charset, Word word)
		{
			int length;

			switch (word.Type) {
			case WordType.EncodedWord:
				switch (word.Encoding) {
				case 1:
					length = EstimateEncodedWordLength ("iso-8859-1", word.ByteCount, word.EncodeCount);
					break;
				case 0:
					length = EstimateEncodedWordLength ("us-ascii", word.ByteCount, word.EncodeCount);
					break;
				default:
					length = EstimateEncodedWordLength (charset, word.ByteCount, word.EncodeCount);
					break;
				}
				break;
			case WordType.QuotedString:
				length = word.ByteCount + word.QuotedPairs + 2;
				break;
			default:
				length = word.ByteCount;
				break;
			}

			return length + 1 >= options.MaxLineLength;
		}
开发者ID:naeemkhedarun,项目名称:MimeKit,代码行数:28,代码来源:Rfc2047.cs


示例18: SetText

		/// <summary>
		/// Sets the text content and the charset parameter in the Content-Type header.
		/// </summary>
		/// <remarks>
		/// This method is similar to setting the <see cref="Text"/> property, but allows
		/// specifying a charset encoding to use. Also updates the
		/// <see cref="ContentType.Charset"/> property.
		/// </remarks>
		/// <param name="encoding">The charset encoding.</param>
		/// <param name="text">The text content.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="encoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="text"/> is <c>null</c>.</para>
		/// </exception>
		public void SetText (Encoding encoding, string text)
		{
			if (encoding == null)
				throw new ArgumentNullException ("encoding");

			if (text == null)
				throw new ArgumentNullException ("text");

			ContentType.Parameters["charset"] = CharsetUtils.GetMimeCharset (encoding);
			var content = new MemoryStream (encoding.GetBytes (text));
			ContentObject = new ContentObject (content);
		}
开发者ID:ALange,项目名称:OutlookPrivacyPlugin,代码行数:27,代码来源:TextPart.cs


示例19: GetText

		/// <summary>
		/// Gets the decoded text content using the provided charset encoding to
		/// override the charset specified in the Content-Type parameters.
		/// </summary>
		/// <remarks>
		/// Uses the provided charset encoding to convert the raw text content
		/// into a unicode string, overriding any charset specified in the
		/// Content-Type header.
		/// </remarks>
		/// <returns>The decoded text.</returns>
		/// <param name="encoding">The charset encoding to use.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <paramref name="encoding"/> is <c>null</c>.
		/// </exception>
		public string GetText (Encoding encoding)
		{
			if (encoding == null)
				throw new ArgumentNullException ("encoding");

			if (ContentObject == null)
				return string.Empty;

			using (var memory = new MemoryStream ()) {
				ContentObject.DecodeTo (memory);

#if PORTABLE
				var buffer = memory.ToArray ();
#else
				var buffer = memory.GetBuffer ();
#endif

				return encoding.GetString (buffer, 0, (int) memory.Length);
			}
		}
开发者ID:ALange,项目名称:OutlookPrivacyPlugin,代码行数:34,代码来源:TextPart.cs


示例20: CharsetFilter

		/// <summary>
		/// Initializes a new instance of the <see cref="MimeKit.IO.Filters.CharsetFilter"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="CharsetFilter"/> to convert text from the specified
		/// source encoding into the target charset encoding.
		/// </remarks>
		/// <param name="sourceEncoding">Source encoding.</param>
		/// <param name="targetEncoding">Target encoding.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="sourceEncoding"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="targetEncoding"/> is <c>null</c>.</para>
		/// </exception>
		public CharsetFilter (Encoding sourceEncoding, Encoding targetEncoding)
		{
			if (sourceEncoding == null)
				throw new ArgumentNullException ("sourceEncoding");

			if (targetEncoding == null)
				throw new ArgumentNullException ("targetEncoding");

			SourceEncoding = sourceEncoding;
			TargetEncoding = targetEncoding;

			decoder = (Decoder) SourceEncoding.GetDecoder ();
			encoder = (Encoder) TargetEncoding.GetEncoder ();
		}
开发者ID:dcga,项目名称:MimeKit,代码行数:28,代码来源:CharsetFilter.cs



注:本文中的Portable.Text.Encoding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PortableExecutableKinds类代码示例发布时间:2022-05-24
下一篇:
C# PortType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap