The Octet vs. Character Conundrum
The iCalendar specification, formally known as RFC 5545, dictates line length limits for calendar data. Many developers and systems interpret this limit as 75 characters. However, the specification explicitly states that lines should not exceed 75 octets, excluding the line break. This distinction is crucial when dealing with multi-byte character encodings, such as those used in Japanese or other non-ASCII languages.
AI Change Watch, an independent project that monitors AI vendor announcements, discovered this issue firsthand. The project publishes subscribable calendars (in .ics format) of announced model shutdowns and updates. While the English version of their calendar feed worked seamlessly, the Japanese feed was consistently rejected. The root cause? The difference between characters and octets.
For ASCII characters, one character is equivalent to one octet. This is why the 75-character interpretation often goes unnoticed. However, in UTF-8, the dominant encoding for the web, characters can consume multiple octets. A single Japanese character, for instance, might require 3 or even 4 octets. When a line in the .ics file contains Japanese text, the octet count can quickly exceed the 75-octet limit, even if the character count remains below 75.
The relevant section of RFC 5545 (Section 3.1) states: "Lines of text SHOULD NOT be longer than 75 octets, excluding the line break." The use of "SHOULD NOT" indicates a recommendation, not a strict requirement, but many parsers treat it as a hard limit, especially for interoperability.

Implications for Parsers and Implementations
Calendar applications and services that parse .ics files often have built-in length limits to prevent denial-of-service attacks or to ensure predictable parsing. These limits are typically implemented as character counts rather than octet counts, leading to the incompatibility. When a line exceeds the parser's assumed character limit, the entire .ics file can be rejected, or the specific event containing the long line may not be processed correctly.
This issue highlights a common pitfall in internationalization: assuming that character counts are universal across different languages and encodings. Developers building systems that handle text data, especially user-generated content or data from diverse sources, must be acutely aware of the difference between characters and octets. UTF-8 is designed for flexibility and extensibility, allowing for a vast range of characters, but this comes at the cost of variable-length encoding.
AI Change Watch's experience underscores the need for robust handling of character encodings. Their solution involved ensuring that their calendar generation process correctly handled UTF-8 encoding and truncated or folded lines appropriately to adhere to the 75-octet limit. This might involve splitting a long line into multiple shorter lines, a process known as line folding, which is also part of the iCalendar specification to manage line length.
Line Folding and Best Practices
RFC 5545 addresses line length by defining a line folding mechanism. A folded line is essentially a long line that is split into two or more physical lines using a specific line break sequence followed by a single space or tab character. The parser then reassembles these folded lines into a single logical line.
For example, a very long line in an iCalendar component might be represented as:
DESCRIPTION:This is a very long description that needs to be folded because it exceeds the 75 octet limit specified by RFC 5545 and the parsing application cannot handle long lines. DESCRIPTION:This is the continuation of the long description.
However, the primary issue discovered by AI Change Watch was not that lines were too long for folding, but that the parsers were misinterpreting the character limit as an octet limit. The fix, therefore, was to ensure the generated .ics data adhered to the octet limit from the outset, rather than relying on parsers to handle potential overages, which they were not doing correctly.
Developers working with the iCalendar format should always consider the octet length of their data, particularly when including text in languages other than English. Tools and libraries used for generating or parsing .ics files should be verified to correctly handle UTF-8 and adhere to the 75-octet line length recommendation. Failing to do so can lead to silent data corruption or outright rejection of calendar events, impacting users who rely on these integrations.
What Happens to Developers Building on This?
For developers integrating iCalendar feeds into their applications, this means a potential need to audit their existing parsing logic. If your application has ever rejected an .ics file, especially from non-English sources, this octet-vs-character discrepancy is a likely culprit. Ensuring your parser correctly handles UTF-8 and respects the 75-octet limit, potentially implementing line folding itself, is critical for broad compatibility.
The surprising detail here is not the existence of the octet limit, but how frequently it's misinterpreted as a character limit, leading to subtle but impactful bugs for international users. This underscores the ongoing challenge of building truly global software where character encodings and their implications are often overlooked.
