Skip to content

importer: convert different file encodings to UTF-8

Otávio Silva requested to merge otavio.ols/gnome-calendar:encodings-1243 into main

As reported in the issue #1243 (closed), files that aren't in the UTF-8 encoding break the import dialog. Using the Byte Order Mark (BOM), this commit tries to guess the encoding of the file before processing it and then converts it to UTF-8. Notice that files without the BOM will not be identified and will keep breaking the import dialog, as these bytes aren't mandatory.

This partially fixes the issue above, because the issue also reports a problem with events that use custom timezones.

Also, here are some files in different encodings (the same ics file provided in the issue) that can be used to test the behavior: utf8.ics utf16be.ics utf16le.ics utf32be.ics utf32le.ics

Edited by Otávio Silva

Merge request reports

Loading