pedia / epub3

epub3 read and write
1 stars 0 forks source link

unicode content in chapters can create corrupted epubs #3

Open denniskaselow opened 1 month ago

denniskaselow commented 1 month ago

The current version of archive (3.6.1) has a bug in ArchiveFile.string where it reads the content size of the string instead of utf8 encoded byte array, which can create corrupted files when using some characters, like the unicode apostrophe: ’ (U+2019, https://en.wikipedia.org/wiki/Right_single_quotation_mark)

https://github.com/pedia/epub3/blob/8ed5c7b098b88c5fd359815c6ad96c33c458fa45/epub3/lib/src/writer.dart#L53

There may not be anything you can do about it other than waiting for version 4.0 of archive, where this bug is fixed. (see https://github.com/brendan-duncan/archive/issues/354)