[forge:site-support:#539]
Trying to browse Subversion repository, for example page
https://sourceforge.net/p/gputils/code/813/
for every file you'll see "Cannot display: file marked as a binary type."
I do not see any mark of binary type.
The files have properties:
Properties on 'ChangeLog': svn:keywords Author Date Id Revision svn:eol-style native
The svn-book says "If the file has no svn:mime-type property, or has a MIME type that is textual (e.g., text/*), Subversion assumes it is text. Otherwise, Subversion assumes the file is binary."
These files have no svn:mime-type property, so they are assumed to be text by subversion.
The example given is for svn, but we should go for improvements/detection for all scms.
We're already reading the data for the file (or about to), so we could check SVN/git/hg metadata for the file, or use heuristics on the first few hundred bytes.
Created #170: [#4933] better mime type detection for code browser (1cp)
Related
Tickets:
#4933Closed #170. Branch 42cc_4933.
We use heuristic on a file content using python-magic lib.