-
Notifications
You must be signed in to change notification settings - Fork 247
Use UTF-8 Encoding Without BOM by Default in All Serializers #827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ❌ Your project status has failed because the head coverage (68%) is below the target coverage (80%). You can increase the head coverage or adjust the target coverage. @@ Coverage Diff @@
## main #827 +/- ##
===================================
Coverage 68% 68%
===================================
Files 106 106
Lines 4216 4217 +1
Branches 941 942 +1
===================================
+ Hits 2849 2850 +1
Misses 1039 1039
Partials 328 328
🚀 New features to boost your workflow:
|
Summary: Changed the default encoding for all serializers to UTF-8 without BOM (`new UTF8Encoding(false)`). This ensures compatibility with iCalendar consumers that do not support BOM and provides consistent encoding across all serialization operations. Affected serializers: All serializers inheriting from `SerializerBase`, `ComponentSerializer`, `EncodableDataTypeSerializer`, or `DataTypeSerializer` now default to UTF-8 without BOM unless an explicit encoding is provided. - **Directly from `SerializerBase`:** - `SimpleDeserializer` - `ComponentSerializer` - `DataMapSerializer` - `DataTypes.DataTypeSerializer` - `DataTypes.DateTimeSerializer` - `DataTypes.DurationSerializer` - `GenericListSerializer` - `ParameterSerializer` - `PropertySerializer` - **From `ComponentSerializer`:** - `CalendarSerializer` - `EventSerializer` - `SerializerFactory` - **From `EncodableDataTypeSerializer` or `DataTypeSerializer`:** - `DataTypes.AttachmentSerializer` - `DataTypes.EnumSerializer` - `DataTypes.GeographicLocationSerializer` - `DataTypes.IntegerSerializer` - `DataTypes.PeriodListSerializer` - `DataTypes.PeriodSerializer` - `DataTypes.RecurrencePatternSerializer` - `DataTypes.StringSerializer` - `DataTypes.UriSerializer` - `DataTypes.UtcOffsetSerializer` - `DataTypes.WeekDaySerializer` **Rationale:** Ensures all iCalendar output is encoded in UTF-8 without BOM by default, as required by many consumers.
6aee7a2 to
877568c
Compare
|
Not sure, I understand this correctly. As the method is only invoked from test cases, this only makes a difference when invoked from externally if omitting the encoding, right? Doesn't this also affect all the places where serialization is triggered internally? Were searching for |
Yes. Without an encoding parameter we use UTF8 without BOM for serialization (writing).
Yes, as far as writing is concerned. For reading, BOM-handling is transparent by .Net.
All where writing is concerned should be covered. |
|



Summary:
Changed the default encoding for all serializers to UTF-8 without BOM (
new UTF8Encoding(false)). This ensures compatibility with iCalendar consumers that do not support BOM and provides consistent encoding across all serialization operations.Affected serializers:
All serializers inheriting from
SerializerBase,ComponentSerializer,EncodableDataTypeSerializer, orDataTypeSerializernow default to UTF-8 without BOM unless an explicit encoding is provided.Directly from
SerializerBase:SimpleDeserializerComponentSerializerDataMapSerializerDataTypes.DataTypeSerializerDataTypes.DateTimeSerializerDataTypes.DurationSerializerGenericListSerializerParameterSerializerPropertySerializerFrom
ComponentSerializer:CalendarSerializerEventSerializerSerializerFactoryFrom
EncodableDataTypeSerializerorDataTypeSerializer:DataTypes.AttachmentSerializerDataTypes.EnumSerializerDataTypes.GeographicLocationSerializerDataTypes.IntegerSerializerDataTypes.PeriodListSerializerDataTypes.PeriodSerializerDataTypes.RecurrencePatternSerializerDataTypes.StringSerializerDataTypes.UriSerializerDataTypes.UtcOffsetSerializerDataTypes.WeekDaySerializerRationale:
Ensures all iCalendar output is encoded in UTF-8 without BOM by default, as required by many consumers.
Resolves #823