Repository navigation
DataStandardizer.Communication 2.0.1
·
1 commit
to develop
since this release
Breaking changes:
- A parameter given both as
nameand in an RFC 2231 form such asname*is now rejected as a duplicate (RFC 6838 §4.3), where the RFC 2231 value used to be kept. MimeParameter.EqualsandGetHashCodecompare 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. MimeCharsetResolverno longer resolves charset names that aren't registered with IANA, such asascii,ucs-2,unicodeandunicodeFFFE; pass a resolver for them to theMimeCharsetResolverconstructor 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.ParseandTryParsereject a number with any character between its digits, such as1-205-555-0199, whatever theItuE164InternationalNumberStyles; remove any grouping before parsing.ItuE164InternationalNumber.CreateNumberForNetwork(countryCode, identificationCode, subscriberNumber)throwsArgumentExceptionfor an Identification Code not assigned under the Country Code, such asIC110(883) withGMSS(881).ItuE164InternationalNumber.ParseandTryParsethrowArgumentOutOfRangeExceptionfor anumberStylesvalue with a bit that noItuE164InternationalNumberStylesmember defines.ItuE164InternationalNumber.ToStringandTelephonyInfoformatting throwFormatExceptionfor a pattern without a placeholder for every digit of the number, instead of dropping digits.
New:
MimeQuotedPrintableDecoderOptions.AllowLongLinesaccepts 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.
MimeCharsetResolverreturns a new instance of a built-in encoding on each call, so a caller that changes itsEncoderFallbackorDecoderFallbackno longer changes the encoding other callers get.MimeDataUri.TryParseno longer treats a percent-encoded/,;or=in the media type as a delimiter (RFC 2397 §3).MimeDataUri.TryParseaccepts type, subtype and parameter names that are RFC 2045 tokens, such astext/x-a~b, so it reads everythingMimeDataUri.Createwrites.MimeDataUri.Createpercent-encodes/,;and=in a quoted parameter value.- A
MimeParameterread withMimeMediaTypeParseOptions.AllowUnknownCharsetsin a character set that couldn't be resolved is written back as its octets in that character set (UNKNOWN-8BITwhen 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.ConvertandDecoder.Convertof the built-in encodings accept empty input, and the netstandard1.1UTF-32decoder fits the arrayGetMaxCharCountsizes.- On netstandard2.0,
ISO-8859-1fromMimeCharsetResolveruses the caller's fallbacks, andUTF-16andUTF-32have aBodyNameandHeaderName. - 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.DecodeTextwithAllowSplitCharactersreads 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 ofMimeQuotedPrintable) accept lower-case hexadecimal digits such as=c3=a9by default, which RFC 2047 §4.2 allows. MimeMediaTypeaccepts lower-case hexadecimal digits in RFC 2231 extended parameter values, such as%c3%a9, by default (RFC 2231 §7, RFC 822 §2.1).MimeCharsetResolverreadsISO-10646-UCS-2andcsUnicodeas 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.TryGetDefaultgivesUTF-8fortext/csv,text/turtle,text/vtt,text/javascriptandtext/ecmascript, and no default fortext/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.TreereportsStandards, notUnregistered, for subtypes that start withx-, such asapplication/x-www-form-urlencoded(RFC 6838 §3.4).MimeMediaTypeParseOptions.AllowQuotedExtendedValuesaccepts an apostrophe in the value, as its docs say.default(MimeParameter).TryFormatandFormatSectionsno longer throw.MimeEncodedWordno longer writes a word longer than 75 characters, accepted withMimeEncodedWordParseOptions.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.
MimeMediaTypecompares theaccess-typeandpermissionvalues ofmessage/external-bodywithout regard to case, andmodetoo when the access-type isftp,anon-ftportftp(RFC 2046 §5.2.3).MimeCharset.TryGetDefaultreturnsfalsefor atextsubtype with the+xmlsuffix, such astext/foo+xml, which has no default character set (RFC 7303 §4.2), instead of givingUS-ASCII.ItuE164InternationalNumber.Parse,TryParseandCreateNumberForNetwork(ulong)accept a network number whose Subscriber Number has one digit, such as+88165.ItuE164InternationalNumber.TryParsereturnsfalsefor anullstring instead of throwing, andParsenames the parameterswhen it throwsArgumentNullException.- A new
ItuE164InternationalNumberFormatInfohas the invariant patterns, so theiandIformats no longer give an empty string, and setting either pattern tonullthrowsArgumentNullException. - With
TelephonyInfoas the format provider,string.Formatformats arguments that aren't E.164 numbers with the current culture. TelephonyInfotakes 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.AllowLowercaseHexDigitsandMimeEncodedWordParseOptions.AllowLowercaseHexDigitsare obsolete and have no effect, as lower-case hexadecimal digits are always accepted; they will be removed in a future major version.