Encoding in UTF8 (ohne -BOM) Geändert. System.Text.Encoding.UTF8 ist standardmäßig mit -BOM, was beim Import in Android-Handys Probleme machte

This commit is contained in:
Christopher Kirchhöfer 2025-01-07 15:31:13 +01:00
parent b16cf3d860
commit fefef83a32

View File

@ -273,8 +273,6 @@ Public Class frmMain
Private Sub IcalNetTest(OutputFile As String)
Dim calendar As New Ical.Net.Calendar
'calendar.AddTimeZone(New Ical.Net.CalendarComponents.VTimeZone("Europe/Berlin"))
'calendar.AddTimeZone(New Ical.Net.CalendarComponents.VTimeZone(General.Settings.DefaultTimezoneId))
For Each evt As EventEntry In ds.Where(Function(e) e.IsInvalid = False AndAlso e.Exclude = False)
calendar.Events.Add(New Ical.Net.CalendarComponents.CalendarEvent With {
.Start = New CalDateTime(evt.StartDate),
@ -286,7 +284,8 @@ Public Class frmMain
Next
Dim serializer As New CalendarSerializer
Using sw As New StreamWriter(OutputFile, False, System.Text.Encoding.UTF8)
Dim utf8WithoutBom As New System.Text.UTF8Encoding(False)
Using sw As New StreamWriter(OutputFile, False, utf8WithoutBom) 'NICHT einfach System.Text.Encoding.UTF8 nehmen, da dann als UTF8-BOM gespeichert wird und der Import z.B. Bei Samsung/Android-Handys nicht funktioniert
sw.Write(serializer.SerializeToString(calendar))
End Using
@ -324,4 +323,8 @@ Public Class frmMain
xlsSheet.SelectedCell = activeSheet.Cells($"A{grdv.GetFocusedRowCellValue("RowIndex")}")
activeSheet.ScrollTo(activeSheet.SelectedCell)
End Sub
Private Sub FluentDesignFormControl1_Click(sender As Object, e As EventArgs) Handles FluentDesignFormControl1.Click
End Sub
End Class