Skip to content

DataStandardizer.Communication 2.0.1

Choose a tag to compare

@github-actions github-actions released this 23 Nov 08:09
· 1 commit to develop since this release
d23d8d6

Breaking changes:

  • A parameter given both as name and in an RFC 2231 form such as name* is now rejected as a duplicate (RFC 6838 §4.3), where the RFC 2231 value used to be kept.
  • MimeParameter.Equals and GetHashCode compare the character set of such a value, so the same octets in different character sets are no longer equal.
  • An encoded word in a character set that switches modes, such as ISO-2022-JP, is accepted only if it switches back to ASCII by its end (RFC 2047 §3), on every target and with every option.
  • In MimeQuotedPrintableMode.Body, the quoted-printable decoder rejects an encoded line longer than 76 characters, not counting its transport padding and CRLF (RFC 2045 §6.7 rule 5).
  • The quoted-printable encoder writes a bare LF in text as =0A, not as a CRLF line break, so the encoded data decodes to the original octets (RFC 2045 §6.7 rule 4).
  • In a comment (MimeEncodedWordContext.Comment, MimeQuotedPrintableMode.EncodedWordComment), "Q"-encoded text containing a literal \ is now rejected, as RFC 2047 §5(2) erratum 504 requires.
  • MimeCharsetResolver no longer resolves charset names that aren't registered with IANA, such as ascii, ucs-2, unicode and unicodeFFFE; pass a resolver for them to the MimeCharsetResolver constructor to accept them.
  • A Content-Transfer-Encoding mechanism that is neither one of the five RFC 2045 defines nor an x- token, such as uuencode or x-, is rejected as RFC 2045 §6.1 requires: MimeTransferEncoding.Parse and TryParse fail, and readers that parse the field report it as invalid.
  • MimeEncodedWord.TryParse with AllowLongWords rejects a word over 75 characters that can't be written back within the limit: one with empty text, a language over 61 characters, or a character set the resolver doesn't resolve.
  • ItuE164InternationalNumber.Parse and TryParse reject a number with any character between its digits, such as 1-205-555-0199, whatever the ItuE164InternationalNumberStyles; remove any grouping before parsing.
  • ItuE164InternationalNumber.CreateNumberForNetwork(countryCode, identificationCode, subscriberNumber) throws ArgumentException for an Identification Code not assigned under the Country Code, such as IC110 (883) with GMSS (881).
  • ItuE164InternationalNumber.Parse and TryParse throw ArgumentOutOfRangeException for a numberStyles value with a bit that no ItuE164InternationalNumberStyles member defines.
  • ItuE164InternationalNumber.ToString and TelephonyInfo formatting throw FormatException for a pattern without a placeholder for every digit of the number, instead of dropping digits.

New:

  • MimeQuotedPrintableDecoderOptions.AllowLongLines accepts quoted-printable lines longer than 76 characters (RFC 2045 §6.7 note 5).

Fixed:

  • The package now includes its XML documentation, so IntelliSense shows member descriptions.
  • MimeCharsetResolver returns a new instance of a built-in encoding on each call, so a caller that changes its EncoderFallback or DecoderFallback no longer changes the encoding other callers get.
  • MimeDataUri.TryParse no longer treats a percent-encoded /, ; or = in the media type as a delimiter (RFC 2397 §3).
  • MimeDataUri.TryParse accepts type, subtype and parameter names that are RFC 2045 tokens, such as text/x-a~b, so it reads everything MimeDataUri.Create writes.
  • MimeDataUri.Create percent-encodes /, ; and = in a quoted parameter value.
  • A MimeParameter read with MimeMediaTypeParseOptions.AllowUnknownCharsets in a character set that couldn't be resolved is written back as its octets in that character set (UNKNOWN-8BIT when it gave none), not as different text labelled UTF-8.
  • The netstandard1.1 build decodes runtime and custom character sets as the other builds do: invalid octets become U+FFFD with AllowInvalidOctets, and valid ISO-2022-JP values are accepted.
  • Encoder.Convert and Decoder.Convert of the built-in encodings accept empty input, and the netstandard1.1 UTF-32 decoder fits the array GetMaxCharCount sizes.
  • On netstandard2.0, ISO-8859-1 from MimeCharsetResolver uses the caller's fallbacks, and UTF-16 and UTF-32 have a BodyName and HeaderName.
  • The quoted-printable decoder removes trailing spaces and tabs (transport padding) of any length, instead of rejecting a run of more than 76 before a line break.
  • In a comment, a "Q"-encoded word may now contain a literal double quote, and one is written as itself rather than as =22 (RFC 2047 §5(2) erratum 504).
  • MimeEncodedWord.DecodeText with AllowSplitCharacters reads a character split between words in the byte order that a byte order mark earlier in the run gives, and in the mode an ISO-2022 character set such as ISO-2022-JP is in at the end of the word before.
  • "Q"-encoded words (MimeEncodedWord, and the "Q" modes of MimeQuotedPrintable) accept lower-case hexadecimal digits such as =c3=a9 by default, which RFC 2047 §4.2 allows.
  • MimeMediaType accepts lower-case hexadecimal digits in RFC 2231 extended parameter values, such as %c3%a9, by default (RFC 2231 §7, RFC 822 §2.1).
  • MimeCharsetResolver reads ISO-10646-UCS-2 and csUnicode as big-endian and holds them to the Basic Multilingual Plane, as the IANA registry requires, instead of reading them as little-endian UTF-16.
  • MimeCharset.TryGetDefault gives UTF-8 for text/csv, text/turtle, text/vtt, text/javascript and text/ecmascript, and no default for text/xml-external-parsed-entity, as their registrations say.
  • Quoted parameter values accept the US-ASCII control characters that RFC 822 allows, as text or as quoted-pairs, instead of rejecting them.
  • MimeMediaType.Tree reports Standards, not Unregistered, for subtypes that start with x-, such as application/x-www-form-urlencoded (RFC 6838 §3.4).
  • MimeMediaTypeParseOptions.AllowQuotedExtendedValues accepts an apostrophe in the value, as its docs say.
  • default(MimeParameter).TryFormat and FormatSections no longer throw.
  • MimeEncodedWord no longer writes a word longer than 75 characters, accepted with MimeEncodedWordParseOptions.AllowLongWords; its text is written as encoded words within the RFC 2047 §2 limit.
  • MimeBase64Encoder in MIME mode makes progress with a destination of 4 or 5 characters at the end of a line.
  • MimeMediaType compares the access-type and permission values of message/external-body without regard to case, and mode too when the access-type is ftp, anon-ftp or tftp (RFC 2046 §5.2.3).
  • MimeCharset.TryGetDefault returns false for a text subtype with the +xml suffix, such as text/foo+xml, which has no default character set (RFC 7303 §4.2), instead of giving US-ASCII.
  • ItuE164InternationalNumber.Parse, TryParse and CreateNumberForNetwork(ulong) accept a network number whose Subscriber Number has one digit, such as +88165.
  • ItuE164InternationalNumber.TryParse returns false for a null string instead of throwing, and Parse names the parameter s when it throws ArgumentNullException.
  • A new ItuE164InternationalNumberFormatInfo has the invariant patterns, so the i and I formats no longer give an empty string, and setting either pattern to null throws ArgumentNullException.
  • With TelephonyInfo as the format provider, string.Format formats arguments that aren't E.164 numbers with the current culture.
  • TelephonyInfo takes the neutral number patterns from the invariant culture, not the current UI culture.
  • ItuE164InternationalNumber.TryParse returns false for a number with decimal digits other than 0-9.

Deprecated and removed:

  • MimeMediaTypeParseOptions.AllowLowercaseHexDigits and MimeEncodedWordParseOptions.AllowLowercaseHexDigits are obsolete and have no effect, as lower-case hexadecimal digits are always accepted; they will be removed in a future major version.