Tk Source Code

Sandbox
Login

Fixing binary attachments

Symptom

Some binary attachments in this Fossil repository cannot be opened. The software reading the downloaded file complains that the file format is incorrect.

Cause

Ticket attachments dating back to before the ticketing system transitioned from SourceForge to Fossil have an encoding issue. It is believed that this problem originated in the conversion process from SF to Fossil. Only binary attachments exhibit the problem, and only those dating back to the SF times.

Fix

Option 1

Using the ticket hash, find the original ticket with the same hash at the SF old repository, which is still available online (readonly). Download the attachment from there.

Option 2

When downloading such an old binary attachment from the Fossil repository, it is obtained as utf-8 encoded file. The recipe consists in "de-utf8-ing" it after download as follows:
set f [open {MyBinaryAttachment.zip} rb]
fconfigure $f -encoding utf-8
set f2 [open {MyBinaryAttachment(fixed).zip} wb]
puts $f2 [read $f]
close $f2
close $f

In any case

Please re-attach the fixed attachment to the ticket, using the same filename so that the fixed version replaces the broken version.