DataStandardizer.File.iCal 2.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package DataStandardizer.File.iCal --version 2.0.0
                    
NuGet\Install-Package DataStandardizer.File.iCal -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DataStandardizer.File.iCal" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DataStandardizer.File.iCal" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DataStandardizer.File.iCal" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DataStandardizer.File.iCal --version 2.0.0
                    
#r "nuget: DataStandardizer.File.iCal, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DataStandardizer.File.iCal@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DataStandardizer.File.iCal&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DataStandardizer.File.iCal&version=2.0.0
                    
Install as a Cake Tool

Introduction

OpenSSF Scorecard

Data Standardizer provides implementations of various internationally recognised standards in data processing, covering topics ranging from languages to currencies and geographical entities. With strongly-typed enumerations for each standard (where applicable) or other targeted data types, you can represent these elements in your code such that errors with invalid values are minimised.

Supported target platforms include (modern) .Net and .Net Standard. Data Standardizer can be used in modern application software, but is also available as an option for older codebases that are being upgraded more gradually or may remain on older frameworks indefinitely.

📚 Documentation

Full documentation — user guides, concepts, and API reference for every package — is published at matthew25187.github.io/DataStandardizer.

Supporting the project

If you derive a commercial benefit from use of Data Standardizer or feel it otherwise adds value to your project, you are asked to please consider supporting the project. You can do this by becoming a GitHub sponsor to make a financial contribution. Data Standardizer is maintained and enhanced by @matthew25187 in his personal time and made available for free for all to use.

Getting Started

Installation

Data Standardizer is available as a series of packages from NuGet.org that can be linked to your existing projects. Available packages include:

Package Description
DataStandardizer.Chronology Supports the following standards:<ul><li>TZ Database</li><li>Unix time</li><li>DOS date & time</li></ul>
DataStandardizer.Communication Supports the following standards:<ul><li>Recommendation ITU-T E.164, The international public telecommunication numbering plan</li><li>MIME, as defined by:<ul><li>RFC 2045, Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</li><li>RFC 2046, Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</li><li>RFC 2047, MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</li><li>RFC 2231, MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</li><li>RFC 2397, The "data" URL scheme</li><li>RFC 2978, IANA Charset Registration Procedures</li><li>RFC 4289, Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures</li><li>RFC 4648, The Base16, Base32, and Base64 Data Encodings</li><li>RFC 6657, Update to MIME regarding "charset" Parameter Handling in Textual Media Types</li><li>RFC 6838, Media Type Specifications and Registration Procedures</li><li>RFC 6839, Additional Media Type Structured Syntax Suffixes</li></ul></li></ul>
DataStandardizer.Core Common types used to implement standards in the other packages. You should not need to link to this package directly.
DataStandardizer.File.CSV Supports the following standards:<ul><li>RFC 4180, Common Format and MIME Type for Comma-Separated Values (CSV) Files</li></ul>
DataStandardizer.File.iCal Supports the following standards:<ul><li>RFC 5545, Internet Calendaring and Scheduling Core Object Specification (iCalendar)</li><li>RFC 6868, Parameter Value Encoding in iCalendar and vCard</li><li>RFC 7986, New Properties for iCalendar</li><li>RFC 7265, jCal: The JSON Format for iCalendar</li><li>RFC 6321, xCal: The XML Format for iCalendar</li></ul>
DataStandardizer.File.InternetMessage Supports the following standards:<ul><li>RFC 5322, Internet Message Format</li><li>RFC 6532, Internationalized Email Headers</li><li>RFC 6854, Update to Internet Message Format to Allow Group Syntax in the "From:" and "Sender:" Header Fields</li><li>MIME in a message, as defined by:<ul><li>RFC 2045, Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</li><li>RFC 2046, Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</li><li>RFC 2047, MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</li><li>RFC 2183, Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</li><li>RFC 2231, MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</li><li>RFC 2387, The MIME Multipart/Related Content-type</li><li>RFC 2392, Content-ID and Message-ID Uniform Resource Locators</li><li>RFC 3282, Content Language Headers</li></ul></li><li>RFC 2557, MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)</li><li>RFC 4155, The application/mbox Media Type</li><li>Apple Mail EMLX files, which have no published standard</li></ul>
DataStandardizer.File.vCard Supports the following standards:<ul><li>RFC 6350, vCard Format Specification</li><li>RFC 6868, Parameter Value Encoding in iCalendar and vCard</li><li>RFC 7095, jCard: The JSON Format for vCard</li><li>RFC 6351, xCard: vCard XML Representation</li><li>vCard 2.1, The Electronic Business Card</li><li>RFC 2425, A MIME Content-Type for Directory Information, and RFC 2426, vCard MIME Directory Profile (vCard 3.0)</li><li>RFC 2739, Calendar Attributes for vCard and LDAP</li><li>RFC 4770, vCard Extensions for Instant Messaging (IM)</li><li>RFC 9554, vCard Format Extensions for JSContact</li><li>RFC 6473, vCard KIND:application, and RFC 6869, vCard KIND:device</li><li>RFC 6474, vCard Format Extensions: Place of Birth, Place and Date of Death</li><li>RFC 6715, vCard Format Extensions: Representing vCard Extensions Defined by the Open Mobile Alliance (OMA) Converged Address Book (CAB) Group</li><li>RFC 8605, vCard Format Extensions: ICANN Extensions for the Registration Data Access Protocol (RDAP)</li></ul>
DataStandardizer.Geography Supports the following standards:<ul><li>ISO 3166-1, Codes for the representation of names of countries and their subdivisions – Part 1: Country code</li><li>ISO 3166-2, Codes for the representation of names of countries and their subdivisions – Part 2: Country subdivision code</li><li>UN M49, Standard Country or Area Codes for Statistical Use (Series M, No. 49)</li></ul>
DataStandardizer.Language Supports the following standards:<ul><li>ISO 639, Code for the representation of names of languages</li><ul><li>Part 1: Alpha-2 code</li><li>Part 2: Alpha-3 code</li><li>Part 3: Alpha-3 code for comprehensive coverage of languages</li><li>Part 5: Alpha-3 code for language families and groups</li></ul><li>ISO 15924, Codes for the representation of names of scripts</li></ul>
DataStandardizer.LanguageTag Supports the following standards:<ul><li>IETF BCP 47 language tags, as defined by:<ul><li>RFC 5646, Tags for Identifying Languages, including well-formed and valid tags, and the IANA Language Subtag Registry format</li></ul></li></ul>
DataStandardizer.Money Supports the following standards:<ul><li>ISO 4217, Codes for the representation of currencies and funds</li><ul><li>Table A.1 – Current currency & funds code list</li><li>Table A.2 – Current funds codes</li><li>Table A.3 – List of codes for historic denominations of currencies & funds</li></ul><li>Money type, as described in Patterns of Enterprise Application Architecture by Martin Fowler</li></ul>

To use a particular standard in your application, find the corresponding package from the above list and add it as a dependency to your project. Instructions for doing so will depend on what development tooling you are using.

See the Get started guide for step-by-step installation and a quickstart.

Software dependencies

Depending on which .Net platform you are targeting, the above packages will also depend on various other system- and third-party packages. They will be included as static dependencies where required and should be automatically resolved, but if you are using a proxy for your package server you may need to make sure these other packages are also available. For example, the netstandard1.1 and netstandard2.0 builds of DataStandardizer.LanguageTag depend on System.Memory for their span-based API.

Latest releases

Package Promoted version nuget.org Release build
DataStandardizer.Chronology DataStandardizer.Chronology promoted version DataStandardizer.Chronology on nuget.org Release build
DataStandardizer.Communication DataStandardizer.Communication promoted version DataStandardizer.Communication on nuget.org Release build
DataStandardizer.Core DataStandardizer.Core promoted version DataStandardizer.Core on nuget.org Release build
DataStandardizer.File.CSV DataStandardizer.File.CSV promoted version DataStandardizer.File.CSV on nuget.org Release build
DataStandardizer.File.iCal DataStandardizer.File.iCal promoted version DataStandardizer.File.iCal on nuget.org Release build
DataStandardizer.File.InternetMessage DataStandardizer.File.InternetMessage promoted version DataStandardizer.File.InternetMessage on nuget.org Release build
DataStandardizer.File.vCard DataStandardizer.File.vCard promoted version DataStandardizer.File.vCard on nuget.org Release build
DataStandardizer.Geography DataStandardizer.Geography promoted version DataStandardizer.Geography on nuget.org Release build
DataStandardizer.Language DataStandardizer.Language promoted version DataStandardizer.Language on nuget.org Release build
DataStandardizer.LanguageTag DataStandardizer.LanguageTag promoted version DataStandardizer.LanguageTag on nuget.org Release build
DataStandardizer.Money DataStandardizer.Money promoted version DataStandardizer.Money on nuget.org Release build

The promoted version is the latest release promoted from this repository's builds (a GitHub Release). It does not necessarily correspond with the latest package version published to NuGet or any other publically available source.

Build and test

Data Standardizer is open source so you can read, build, and adapt it for your own use. The project does not currently accept third-party code contributions; the instructions below are provided as a convenience for working with your own copy or fork of the repository.

After cloning the repository, you can compile the entire solution from the repository root:

dotnet build DataStandardizer.sln

and run the XUnit-based tests with:

dotnet test DataStandardizer.sln

Per-package solution filter (*.slnf) files let you build or test a single package in isolation. For the full branching strategy, per-package builds, IDE testing, and the PowerShell scripts that regenerate the standard enums, see Build from source in the documentation.

Usage

Though each package contains many types, typically there are only a few you will use directly in your application. See the project documentation for user guides, concepts, and API reference covering each package — including built-in CSV reading, writing, and normalization in DataStandardizer.File.CSV, iCalendar reading, writing, and recurrence expansion in DataStandardizer.File.iCal, reading and writing of Internet messages in EML, MHTML, mbox and EMLX files in DataStandardizer.File.InternetMessage, and reading, writing and conversion of vCard 4.0, 3.0 and 2.1 cards, jCard and xCard in DataStandardizer.File.vCard.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.1 is compatible.  netstandard1.2 was computed.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore was computed.  netcore45 was computed.  netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 85 11/17/2026
2.0.0 95 11/10/2026
1.0.0 142 10/23/2026 1.0.0 is deprecated because it has critical bugs.

Breaking changes:
- The packages no longer have a `net8.0` build. An application on .NET 8 or .NET 9 gets a .NET Standard build, without the APIs that only the `net10.0` build has, such as `DateOnly` and `TimeOnly` support. To keep those APIs, move the application to .NET 10.
- The `netstandard1.x` and `netstandard2.0` builds no longer list `JetBrains.Annotations` as a NuGet dependency. If your code uses its attributes and you got the package through DataStandardizer, add a reference to `JetBrains.Annotations` to your project.
- `IcalReader`, `XcalReader`, `JcalReader` and their writers reject a `FMTTYPE` parameter that isn't one type and subtype (RFC 5545 §3.2.8), or that appears twice. Set `IcalOptions.AllowInvalidValues` to accept it.
- `IcalReader`, `XcalReader`, `JcalReader` and their writers reject a parameter defined with one value that has more, such as `CN=Doe, John`, and a parameter repeated on a property RFC 5545 or RFC 7986 defines. Set `IcalOptions.AllowInvalidValues` to accept them.
- `default(TzDataTimezone)` is `Etc/UTC`, equal to the new `TzDataTimezone.Etc.UTC` field: it converts to `"Etc/UTC"` instead of `null`, `ToString()` returns `"UTC"`, and its members return the zone lines, location and offsets of `Etc/UTC` instead of throwing `InvalidOperationException`.
- `IcalReader` and `IcalContentLineReader` reject a last content line that doesn't end with CRLF, as RFC 5545 §3.1 requires. Set the new `IcalOptions.AcceptMissingFinalLineBreak` to accept it.
- `IcalReader` and `IcalContentLineReader` reject a byte order mark at the start of the data (RFC 5545 §3.6), and a byte order mark no longer selects UTF-16 or UTF-32. Set the new `IcalOptions.AcceptByteOrderMark` to skip it, and `IcalOptions.Encoding` to read data that isn't UTF-8.
- `IcalReader` and `IcalContentLineReader` throw `IcalFileException` for data that isn't valid UTF-8 (RFC 5545 §3.1.4), instead of replacing it with U+FFFD, and can't read on after it. Set `IcalOptions.Encoding` to `Encoding.UTF8` to replace it.
- `JcalWriter` and `XcalWriter` refuse further writes, with `InvalidOperationException`, after a write to their stream or XML writer, or a flush of it, fails, rather than going on to write a document that isn't valid jCal or xCal. A calendar refused before any of it is written still leaves the writer able to continue.

New:
- `IcalContentLine.GetFormatType` and `IcalContentLineView.GetFormatType` read the FMTTYPE parameter (RFC 5545 §3.2.8) as a `MimeMediaType`.
- `TzDataTimezone.Parse`, `TryParse` and the explicit conversion accept `Etc/UTC` and the deprecated names linked to it, such as `UTC` and `Zulu`.
- `IcalTimeZoneResolver.TzData` resolves the TZIDs `Etc/UTC`, `UTC`, `Zulu` and the other names the TZ Database links to `Etc/UTC`, with an offset of 0.
- `IcalOptions.AllowQuotedParameterValues` accepts a quoted value for a parameter whose grammar has no quoted form, reported as the new `IcalDiagnosticKind.QuotedParameterValue`.

Fixed:
- Debuggers can step into the packages' source through Source Link.
- `MaxLineLength` also limits the folds in a content line, so a line with more folds than the limit is rejected as too long.
- `TzDataTimezone.CompareTo` orders time zones by identifier instead of throwing `ArgumentException`.
- `IcalReader` rejects, and `IcalWriter` refuses to write, a parameter value in double quotes where the parameter's grammar has no quoted form, such as `FMTTYPE="audio/basic"` (RFC 5545 §3.2.8).
- `IcalContentLineReader` and `IcalReader` can't read on after their `TextReader` or `Stream` throws, instead of joining the characters on either side of the failure into one line.
- IcalContentLineReader throws ObjectDisposedException for a read disposed while it completes from the buffer.
- `IcalContentLineWriter.WriteLineAsync` completes with `ObjectDisposedException` when the writer is disposed during a write that completes without waiting, and no longer does synchronous I/O when releasing it.
- `IcalContentLineWriter.WriteLinesAsync` cancels when given no lines and a canceled token.
- `IcalContentLineWriter.WriteLineAsync` faults its task, rather than canceling it, when the writer is disposed during a write whose text writer throws an `OperationCanceledException` whose token isn't canceled.
- `IcalContentLineWriter`'s asynchronous methods, and `DisposeAsync`, fault their task, rather than canceling it, when the underlying text writer or stream throws an `OperationCanceledException` while the caller's token isn't canceled, and the writer can continue after it.
- `IcalContentLineWriter.WriteLineAsync` cancels its task when the caller's token is canceled and the text writer throws an `OperationCanceledException` that carries another token, or none.
- IcalWriter, JcalWriter, XcalWriter and IcalContentLineReader cancel an asynchronous operation only when the caller's token is canceled.
- IcalReader, JcalReader and XcalReader cancel an asynchronous read only when the caller's token is canceled.
- XcalReader and XcardReader no longer overflow the stack on .NET Framework when their source fails a read with an OperationCanceledException.
- IcalTimeZoneRules.ToUtc throws ArgumentOutOfRangeException, as documented, for a local time whose instant falls before year 1 or after year 9999.
- IcalTimeZoneRules.ToUtc throws ArgumentOutOfRangeException for a time in an overlap whose first occurrence falls before year 1, instead of returning the second occurrence.
- IcalEvent.GetOccurrences throws ArgumentOutOfRangeException, not a wrong end time, for a nominal duration of more days than the range of dates holds.
- XcalReader.ReadCalendar throws IcalFileException, not XmlException, for malformed XML in the text of an element.
- `XcalReader` throws `IcalFileException`, not `ArgumentOutOfRangeException`, for an XML declaration with a garbled encoding name on .NET 10.
- reading a calendar with a very long TZID that starts with a solidus no longer takes time quadratic in its length.

Changed:
- The netstandard1.x and netstandard2.0 builds now carry nullable annotations, so projects on C# 8 or later with nullable enabled get null warnings from them.
- The package now depends on `DataStandardizer.Communication`, for media types and base64.
- `IcalTimeZone.FromTzData` defines `Etc/UTC` for `default(TzDataTimezone)` instead of throwing `InvalidOperationException`.
- IcalReader, XcalReader and JcalReader accept at most 64 levels of nested components; deeper nesting throws IcalFileException.